wapi-client 0.6.3 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/base-client.d.ts +4 -4
- package/dist/lib/validator.d.ts +3 -3
- package/dist/txs/get-database-export-progress/get-database-export-progress.enums.d.ts +7 -3
- package/dist/txs/index.d.ts +6 -6
- package/dist/txs/list-database-exports/list-database-exports.enums.d.ts +15 -0
- package/dist/txs/list-database-exports/list-database-exports.guards.d.ts +4 -0
- package/dist/wapi-client.cjs.development.js +83 -77
- package/dist/wapi-client.cjs.js +6 -6
- package/package.json +1 -1
- package/dist/txs/list-database-backups/list-database-backups.enums.d.ts +0 -15
- package/dist/txs/list-database-backups/list-database-backups.guards.d.ts +0 -4
package/dist/wapi-client.cjs.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var xF=Object.create;var Bi=Object.defineProperty,FF=Object.defineProperties,wF=Object.getOwnPropertyDescriptor,$F=Object.getOwnPropertyDescriptors,OF=Object.getOwnPropertyNames,Eg=Object.getOwnPropertySymbols,vF=Object.getPrototypeOf,Rg=Object.prototype.hasOwnProperty,jF=Object.prototype.propertyIsEnumerable;var Ag=(t,e,r)=>e in t?Bi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,P=(t,e)=>{for(var r in e||(e={}))Rg.call(e,r)&&Ag(t,r,e[r]);if(Eg)for(var r of Eg(e))jF.call(e,r)&&Ag(t,r,e[r]);return t},q=(t,e)=>FF(t,$F(e)),Ug=t=>Bi(t,"__esModule",{value:!0});var C=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),IF=(t,e)=>{Ug(t);for(var r in e)Bi(t,r,{get:e[r],enumerable:!0})},kF=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of OF(e))!Rg.call(t,n)&&n!=="default"&&Bi(t,n,{get:()=>e[n],enumerable:!(r=wF(e,n))||r.enumerable});return t},ri=t=>kF(Ug(Bi(t!=null?xF(vF(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var ye=(t,e,r)=>new Promise((n,a)=>{var s=f=>{try{o(r.next(f))}catch(u){a(u)}},i=f=>{try{o(r.throw(f))}catch(u){a(u)}},o=f=>f.done?n(f.value):Promise.resolve(f.value).then(s,i);o((r=r.apply(t,e)).next())});var es=C((
|
|
1
|
+
var xF=Object.create;var Bi=Object.defineProperty,FF=Object.defineProperties,wF=Object.getOwnPropertyDescriptor,$F=Object.getOwnPropertyDescriptors,OF=Object.getOwnPropertyNames,Eg=Object.getOwnPropertySymbols,vF=Object.getPrototypeOf,Rg=Object.prototype.hasOwnProperty,jF=Object.prototype.propertyIsEnumerable;var Ag=(t,e,r)=>e in t?Bi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,P=(t,e)=>{for(var r in e||(e={}))Rg.call(e,r)&&Ag(t,r,e[r]);if(Eg)for(var r of Eg(e))jF.call(e,r)&&Ag(t,r,e[r]);return t},q=(t,e)=>FF(t,$F(e)),Ug=t=>Bi(t,"__esModule",{value:!0});var C=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),IF=(t,e)=>{Ug(t);for(var r in e)Bi(t,r,{get:e[r],enumerable:!0})},kF=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of OF(e))!Rg.call(t,n)&&n!=="default"&&Bi(t,n,{get:()=>e[n],enumerable:!(r=wF(e,n))||r.enumerable});return t},ri=t=>kF(Ug(Bi(t!=null?xF(vF(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var ye=(t,e,r)=>new Promise((n,a)=>{var s=f=>{try{o(r.next(f))}catch(u){a(u)}},i=f=>{try{o(r.throw(f))}catch(u){a(u)}},o=f=>f.done?n(f.value):Promise.resolve(f.value).then(s,i);o((r=r.apply(t,e)).next())});var es=C((S4,qg)=>{"use strict";qg.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),EMPTY_BUFFER:Buffer.alloc(0),NOOP:()=>{}}});var cc=C((C4,r_)=>{var Ng=require("fs"),Ur=require("path"),Bg=require("os"),Lg=typeof __webpack_require__=="function"?__non_webpack_require__:require,SF=process.config&&process.config.variables||{},CF=!!process.env.PREBUILDS_ONLY,Vg=process.versions.modules,pc=GF()?"electron":"node",fc=Bg.arch(),uc=Bg.platform(),Hg=process.env.LIBC||(DF(uc)?"musl":"glibc"),dc=process.env.ARM_VERSION||(fc==="arm64"?"8":SF.arm_version)||"",zg=(process.versions.uv||"").split(".")[0];r_.exports=qr;function qr(t){return Lg(qr.path(t))}qr.path=function(t){t=Ur.resolve(t||".");try{var e=Lg(Ur.join(t,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(t=process.env[e+"_PREBUILD"])}catch(f){}if(!CF){var r=Kg(Ur.join(t,"build/Release"),Qg);if(r)return r;var n=Kg(Ur.join(t,"build/Debug"),Qg);if(n)return n}var a=o(t);if(a)return a;var s=o(Ur.dirname(process.execPath));if(s)return s;var i=["platform="+uc,"arch="+fc,"runtime="+pc,"abi="+Vg,"uv="+zg,dc?"armv="+dc:"","libc="+Hg,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"",typeof __webpack_require__=="function"?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+i+`
|
|
2
2
|
loaded from: `+t+`
|
|
3
|
-
`);function o(f){var u=lc(Ur.join(f,"prebuilds")).map(Jg),l=u.filter(Xg(uc,fc)).sort(Yg)[0];if(!!l){var _=Ur.join(f,"prebuilds",l.name),b=lc(_).map(Zg),w=b.filter(e_(pc,Vg)),y=w.sort(t_(pc))[0];if(y)return Ur.join(_,y.file)}}};function lc(t){try{return Ng.readdirSync(t)}catch(e){return[]}}function Kg(t,e){var r=lc(t).filter(e);return r[0]&&Ur.join(t,r[0])}function Qg(t){return/\.node$/.test(t)}function Jg(t){var e=t.split("-");if(e.length===2){var r=e[0],n=e[1].split("+");if(!!r&&!!n.length&&!!n.every(Boolean))return{name:t,platform:r,architectures:n}}}function Xg(t,e){return function(r){return r==null||r.platform!==t?!1:r.architectures.includes(e)}}function Yg(t,e){return t.architectures.length-e.architectures.length}function Zg(t){var e=t.split("."),r=e.pop(),n={file:t,specificity:0};if(r==="node"){for(var a=0;a<e.length;a++){var s=e[a];if(s==="node"||s==="electron"||s==="node-webkit")n.runtime=s;else if(s==="napi")n.napi=!0;else if(s.slice(0,3)==="abi")n.abi=s.slice(3);else if(s.slice(0,2)==="uv")n.uv=s.slice(2);else if(s.slice(0,4)==="armv")n.armv=s.slice(4);else if(s==="glibc"||s==="musl")n.libc=s;else continue;n.specificity++}return n}}function e_(t,e){return function(r){return!(r==null||r.runtime!==t&&!PF(r)||r.abi!==e&&!r.napi||r.uv&&r.uv!==zg||r.armv&&r.armv!==dc||r.libc&&r.libc!==Hg)}}function PF(t){return t.runtime==="node"&&t.napi}function t_(t){return function(e,r){return e.runtime!==r.runtime?e.runtime===t?-1:1:e.abi!==r.abi?e.abi?-1:1:e.specificity!==r.specificity?e.specificity>r.specificity?-1:1:0}}function GF(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window!="undefined"&&window.process&&window.process.type==="renderer"}function DF(t){return t==="linux"&&Ng.existsSync("/etc/alpine-release")}qr.parseTags=Zg;qr.matchTags=e_;qr.compareTags=t_;qr.parseTuple=Jg;qr.matchTuple=Xg;qr.compareTuples=Yg});var a_=C((C4,n_)=>{"use strict";var MF=(t,e,r,n,a)=>{for(var s=0;s<a;s++)r[n+s]=t[s]^e[s&3]},WF=(t,e)=>{let r=t.length;for(var n=0;n<r;n++)t[n]^=e[n&3]};n_.exports={mask:MF,unmask:WF}});var s_=C((P4,mc)=>{"use strict";try{mc.exports=cc()(__dirname)}catch(t){mc.exports=a_()}});var Li=C((G4,hc)=>{"use strict";var{EMPTY_BUFFER:EF}=es();function i_(t,e){if(t.length===0)return EF;if(t.length===1)return t[0];let r=Buffer.allocUnsafe(e),n=0;for(let a=0;a<t.length;a++){let s=t[a];r.set(s,n),n+=s.length}return n<e?r.slice(0,n):r}function o_(t,e,r,n,a){for(let s=0;s<a;s++)r[n+s]=t[s]^e[s&3]}function p_(t,e){let r=t.length;for(let n=0;n<r;n++)t[n]^=e[n&3]}function f_(t){return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}function fd(t){if(fd.readOnly=!0,Buffer.isBuffer(t))return t;let e;return t instanceof ArrayBuffer?e=Buffer.from(t):ArrayBuffer.isView(t)?e=Buffer.from(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),fd.readOnly=!1),e}try{let t=s_(),e=t.BufferUtil||t;hc.exports={concat:i_,mask(r,n,a,s,i){i<48?o_(r,n,a,s,i):e.mask(r,n,a,s,i)},toArrayBuffer:f_,toBuffer:fd,unmask(r,n){r.length<32?p_(r,n):e.unmask(r,n)}}}catch(t){hc.exports={concat:i_,mask:o_,toArrayBuffer:f_,toBuffer:fd,unmask:p_}}});var c_=C((D4,l_)=>{"use strict";var u_=Symbol("kDone"),gc=Symbol("kRun"),d_=class{constructor(e){this[u_]=()=>{this.pending--,this[gc]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[gc]()}[gc](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[u_])}}};l_.exports=d_});var zi=C((M4,T_)=>{"use strict";var Vi=require("zlib"),m_=Li(),RF=c_(),{kStatusCode:h_,NOOP:AF}=es(),UF=Buffer.from([0,0,255,255]),ud=Symbol("permessage-deflate"),Nr=Symbol("total-length"),Hi=Symbol("callback"),pa=Symbol("buffers"),dd=Symbol("error"),ld,g_=class{constructor(e,r,n){if(this._maxPayload=n|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!ld){let a=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;ld=new RF(a)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[Hi];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let r=this._options,n=e.find(a=>!(r.serverNoContextTakeover===!1&&a.server_no_context_takeover||a.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>a.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!a.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(n.server_no_context_takeover=!0),r.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(n.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?n.client_max_window_bits=r.clientMaxWindowBits:(n.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let r=e[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(e){return e.forEach(r=>{Object.keys(r).forEach(n=>{let a=r[n];if(a.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(a=a[0],n==="client_max_window_bits"){if(a!==!0){let s=+a;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${a}`);a=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${a}`)}else if(n==="server_max_window_bits"){let s=+a;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${a}`);a=s}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(a!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${a}`)}else throw new Error(`Unknown parameter "${n}"`);r[n]=a})}),e}decompress(e,r,n){ld.add(a=>{this._decompress(e,r,(s,i)=>{a(),n(s,i)})})}compress(e,r,n){ld.add(a=>{this._compress(e,r,(s,i)=>{a(),n(s,i)})})}_decompress(e,r,n){let a=this._isServer?"client":"server";if(!this._inflate){let s=`${a}_max_window_bits`,i=typeof this.params[s]!="number"?Vi.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=Vi.createInflateRaw(q(P({},this._options.zlibInflateOptions),{windowBits:i})),this._inflate[ud]=this,this._inflate[Nr]=0,this._inflate[pa]=[],this._inflate.on("error",NF),this._inflate.on("data",__)}this._inflate[Hi]=n,this._inflate.write(e),r&&this._inflate.write(UF),this._inflate.flush(()=>{let s=this._inflate[dd];if(s){this._inflate.close(),this._inflate=null,n(s);return}let i=m_.concat(this._inflate[pa],this._inflate[Nr]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Nr]=0,this._inflate[pa]=[],r&&this.params[`${a}_no_context_takeover`]&&this._inflate.reset()),n(null,i)})}_compress(e,r,n){let a=this._isServer?"server":"client";if(!this._deflate){let s=`${a}_max_window_bits`,i=typeof this.params[s]!="number"?Vi.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=Vi.createDeflateRaw(q(P({},this._options.zlibDeflateOptions),{windowBits:i})),this._deflate[Nr]=0,this._deflate[pa]=[],this._deflate.on("error",AF),this._deflate.on("data",qF)}this._deflate[Hi]=n,this._deflate.write(e),this._deflate.flush(Vi.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=m_.concat(this._deflate[pa],this._deflate[Nr]);r&&(s=s.slice(0,s.length-4)),this._deflate[Hi]=null,this._deflate[Nr]=0,this._deflate[pa]=[],r&&this.params[`${a}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};T_.exports=g_;function qF(t){this[pa].push(t),this[Nr]+=t.length}function __(t){if(this[Nr]+=t.length,this[ud]._maxPayload<1||this[Nr]<=this[ud]._maxPayload){this[pa].push(t);return}this[dd]=new RangeError("Max payload size exceeded"),this[dd].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[dd][h_]=1009,this.removeListener("data",__),this.reset()}function NF(t){this[ud]._inflate=null,t[h_]=1007,this[Hi](t)}});var b_=C((W4,y_)=>{"use strict";function BF(t){let e=t.length,r=0;for(;r<e;)if((t[r]&128)==0)r++;else if((t[r]&224)==192){if(r+1===e||(t[r+1]&192)!=128||(t[r]&254)==192)return!1;r+=2}else if((t[r]&240)==224){if(r+2>=e||(t[r+1]&192)!=128||(t[r+2]&192)!=128||t[r]===224&&(t[r+1]&224)==128||t[r]===237&&(t[r+1]&224)==160)return!1;r+=3}else if((t[r]&248)==240){if(r+3>=e||(t[r+1]&192)!=128||(t[r+2]&192)!=128||(t[r+3]&192)!=128||t[r]===240&&(t[r+1]&240)==128||t[r]===244&&t[r+1]>143||t[r]>244)return!1;r+=4}else return!1;return!0}y_.exports=BF});var x_=C((E4,_c)=>{"use strict";try{_c.exports=cc()(__dirname)}catch(t){_c.exports=b_()}});var yc=C((R4,Tc)=>{"use strict";function F_(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function w_(t){let e=t.length,r=0;for(;r<e;)if((t[r]&128)==0)r++;else if((t[r]&224)==192){if(r+1===e||(t[r+1]&192)!=128||(t[r]&254)==192)return!1;r+=2}else if((t[r]&240)==224){if(r+2>=e||(t[r+1]&192)!=128||(t[r+2]&192)!=128||t[r]===224&&(t[r+1]&224)==128||t[r]===237&&(t[r+1]&224)==160)return!1;r+=3}else if((t[r]&248)==240){if(r+3>=e||(t[r+1]&192)!=128||(t[r+2]&192)!=128||(t[r+3]&192)!=128||t[r]===240&&(t[r+1]&240)==128||t[r]===244&&t[r+1]>143||t[r]>244)return!1;r+=4}else return!1;return!0}try{let t=x_();typeof t=="object"&&(t=t.Validation.isValidUTF8),Tc.exports={isValidStatusCode:F_,isValidUTF8(e){return e.length<150?w_(e):t(e)}}}catch(t){Tc.exports={isValidStatusCode:F_,isValidUTF8:w_}}});var Fc=C((A4,S_)=>{"use strict";var{Writable:LF}=require("stream"),$_=zi(),{BINARY_TYPES:VF,EMPTY_BUFFER:HF,kStatusCode:zF,kWebSocket:KF}=es(),{concat:bc,toArrayBuffer:QF,unmask:JF}=Li(),{isValidStatusCode:XF,isValidUTF8:O_}=yc(),Ki=0,v_=1,j_=2,I_=3,xc=4,YF=5,k_=class extends LF{constructor(e,r,n,a){super();this._binaryType=e||VF[0],this[KF]=void 0,this._extensions=r||{},this._isServer=!!n,this._maxPayload=a|0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=Ki,this._loop=!1}_write(e,r,n){if(this._opcode===8&&this._state==Ki)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=n.slice(e),n.slice(0,e)}let r=Buffer.allocUnsafe(e);do{let n=this._buffers[0],a=r.length-e;e>=n.length?r.set(this._buffers.shift(),a):(r.set(new Uint8Array(n.buffer,n.byteOffset,e),a),this._buffers[0]=n.slice(e)),e-=n.length}while(e>0);return r}startLoop(e){let r;this._loop=!0;do switch(this._state){case Ki:r=this.getInfo();break;case v_:r=this.getPayloadLength16();break;case j_:r=this.getPayloadLength64();break;case I_:this.getMask();break;case xc:r=this.getData(e);break;default:this._loop=!1;return}while(this._loop);e(r)}getInfo(){if(this._bufferedBytes<2){this._loop=!1;return}let e=this.consume(2);if((e[0]&48)!=0)return this._loop=!1,Oe(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");let r=(e[0]&64)==64;if(r&&!this._extensions[$_.extensionName])return this._loop=!1,Oe(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._fin=(e[0]&128)==128,this._opcode=e[0]&15,this._payloadLength=e[1]&127,this._opcode===0){if(r)return this._loop=!1,Oe(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,Oe(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented)return this._loop=!1,Oe(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin)return this._loop=!1,Oe(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(r)return this._loop=!1,Oe(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125)return this._loop=!1,Oe(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}else return this._loop=!1,Oe(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(e[1]&128)==128,this._isServer){if(!this._masked)return this._loop=!1,Oe(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,Oe(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(this._payloadLength===126)this._state=v_;else if(this._payloadLength===127)this._state=j_;else return this.haveLength()}getPayloadLength16(){if(this._bufferedBytes<2){this._loop=!1;return}return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength()}getPayloadLength64(){if(this._bufferedBytes<8){this._loop=!1;return}let e=this.consume(8),r=e.readUInt32BE(0);return r>Math.pow(2,53-32)-1?(this._loop=!1,Oe(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=r*Math.pow(2,32)+e.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,Oe(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=I_:this._state=xc}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=xc}getData(e){let r=HF;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&JF(r,this._mask)}if(this._opcode>7)return this.controlMessage(r);if(this._compressed){this._state=YF,this.decompress(r,e);return}return r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage()}decompress(e,r){this._extensions[$_.extensionName].decompress(e,this._fin,(a,s)=>{if(a)return r(a);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return r(Oe(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));this._fragments.push(s)}let i=this.dataMessage();if(i)return r(i);this.startLoop(r)})}dataMessage(){if(this._fin){let e=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=bc(r,e):this._binaryType==="arraybuffer"?n=QF(bc(r,e)):n=r,this.emit("message",n)}else{let n=bc(r,e);if(!O_(n))return this._loop=!1,Oe(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",n.toString())}}this._state=Ki}controlMessage(e){if(this._opcode===8)if(this._loop=!1,e.length===0)this.emit("conclude",1005,""),this.end();else{if(e.length===1)return Oe(RangeError,"invalid payload length 1",!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");{let r=e.readUInt16BE(0);if(!XF(r))return Oe(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");let n=e.slice(2);if(!O_(n))return Oe(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("conclude",r,n.toString()),this.end()}}else this._opcode===9?this.emit("ping",e):this.emit("pong",e);this._state=Ki}};S_.exports=k_;function Oe(t,e,r,n,a){let s=new t(r?`Invalid WebSocket frame: ${e}`:e);return Error.captureStackTrace(s,Oe),s.code=a,s[zF]=n,s}});var wc=C((N4,G_)=>{"use strict";var U4=require("net"),q4=require("tls"),{randomFillSync:ZF}=require("crypto"),C_=zi(),{EMPTY_BUFFER:ew}=es(),{isValidStatusCode:tw}=yc(),{mask:P_,toBuffer:Br}=Li(),ts=Buffer.alloc(4),Lr=class{constructor(e,r){this._extensions=r||{},this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,r){let n=r.mask&&r.readOnly,a=r.mask?6:2,s=e.length;e.length>=65536?(a+=8,s=127):e.length>125&&(a+=2,s=126);let i=Buffer.allocUnsafe(n?e.length+a:a);return i[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(i[0]|=64),i[1]=s,s===126?i.writeUInt16BE(e.length,2):s===127&&(i.writeUInt32BE(0,2),i.writeUInt32BE(e.length,6)),r.mask?(ZF(ts,0,4),i[1]|=128,i[a-4]=ts[0],i[a-3]=ts[1],i[a-2]=ts[2],i[a-1]=ts[3],n?(P_(e,ts,i,a,e.length),[i]):(P_(e,ts,e,0,e.length),[i,e])):[i,e]}close(e,r,n,a){let s;if(e===void 0)s=ew;else{if(typeof e!="number"||!tw(e))throw new TypeError("First argument must be a valid error code number");if(r===void 0||r==="")s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let i=Buffer.byteLength(r);if(i>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+i),s.writeUInt16BE(e,0),s.write(r,2)}}this._deflating?this.enqueue([this.doClose,s,n,a]):this.doClose(s,n,a)}doClose(e,r,n){this.sendFrame(Lr.frame(e,{fin:!0,rsv1:!1,opcode:8,mask:r,readOnly:!1}),n)}ping(e,r,n){let a=Br(e);if(a.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPing,a,r,Br.readOnly,n]):this.doPing(a,r,Br.readOnly,n)}doPing(e,r,n,a){this.sendFrame(Lr.frame(e,{fin:!0,rsv1:!1,opcode:9,mask:r,readOnly:n}),a)}pong(e,r,n){let a=Br(e);if(a.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPong,a,r,Br.readOnly,n]):this.doPong(a,r,Br.readOnly,n)}doPong(e,r,n,a){this.sendFrame(Lr.frame(e,{fin:!0,rsv1:!1,opcode:10,mask:r,readOnly:n}),a)}send(e,r,n){let a=Br(e),s=this._extensions[C_.extensionName],i=r.binary?2:1,o=r.compress;if(this._firstFragment?(this._firstFragment=!1,o&&s&&(o=a.length>=s._threshold),this._compress=o):(o=!1,i=0),r.fin&&(this._firstFragment=!0),s){let f={fin:r.fin,rsv1:o,opcode:i,mask:r.mask,readOnly:Br.readOnly};this._deflating?this.enqueue([this.dispatch,a,this._compress,f,n]):this.dispatch(a,this._compress,f,n)}else this.sendFrame(Lr.frame(a,{fin:r.fin,rsv1:!1,opcode:i,mask:r.mask,readOnly:Br.readOnly}),n)}dispatch(e,r,n,a){if(!r){this.sendFrame(Lr.frame(e,n),a);return}let s=this._extensions[C_.extensionName];this._bufferedBytes+=e.length,this._deflating=!0,s.compress(e,n.fin,(i,o)=>{if(this._socket.destroyed){let f=new Error("The socket was closed while data was being compressed");typeof a=="function"&&a(f);for(let u=0;u<this._queue.length;u++){let l=this._queue[u][4];typeof l=="function"&&l(f)}return}this._bufferedBytes-=e.length,this._deflating=!1,n.readOnly=!1,this.sendFrame(Lr.frame(o,n),a),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[1].length,Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[1].length,this._queue.push(e)}sendFrame(e,r){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],r),this._socket.uncork()):this._socket.write(e[0],r)}};G_.exports=Lr});var A_=C((B4,R_)=>{"use strict";var Qi=class{constructor(e,r){this.target=r,this.type=e}},D_=class extends Qi{constructor(e,r){super("message",r);this.data=e}},M_=class extends Qi{constructor(e,r,n){super("close",n);this.wasClean=n._closeFrameReceived&&n._closeFrameSent,this.reason=r,this.code=e}},W_=class extends Qi{constructor(e){super("open",e)}},E_=class extends Qi{constructor(e,r){super("error",r);this.message=e.message,this.error=e}},rw={addEventListener(t,e,r){if(typeof e!="function")return;function n(f){e.call(this,new D_(f,this))}function a(f,u){e.call(this,new M_(f,u,this))}function s(f){e.call(this,new E_(f,this))}function i(){e.call(this,new W_(this))}let o=r&&r.once?"once":"on";t==="message"?(n._listener=e,this[o](t,n)):t==="close"?(a._listener=e,this[o](t,a)):t==="error"?(s._listener=e,this[o](t,s)):t==="open"?(i._listener=e,this[o](t,i)):this[o](t,e)},removeEventListener(t,e){let r=this.listeners(t);for(let n=0;n<r.length;n++)(r[n]===e||r[n]._listener===e)&&this.removeListener(t,r[n])}};R_.exports=rw});var $c=C((L4,U_)=>{"use strict";var Ji=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Tt(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}function nw(t){let e=Object.create(null);if(t===void 0||t==="")return e;let r=Object.create(null),n=!1,a=!1,s=!1,i,o,f=-1,u=-1,l=0;for(;l<t.length;l++){let b=t.charCodeAt(l);if(i===void 0)if(u===-1&&Ji[b]===1)f===-1&&(f=l);else if(b===32||b===9)u===-1&&f!==-1&&(u=l);else if(b===59||b===44){if(f===-1)throw new SyntaxError(`Unexpected character at index ${l}`);u===-1&&(u=l);let w=t.slice(f,u);b===44?(Tt(e,w,r),r=Object.create(null)):i=w,f=u=-1}else throw new SyntaxError(`Unexpected character at index ${l}`);else if(o===void 0)if(u===-1&&Ji[b]===1)f===-1&&(f=l);else if(b===32||b===9)u===-1&&f!==-1&&(u=l);else if(b===59||b===44){if(f===-1)throw new SyntaxError(`Unexpected character at index ${l}`);u===-1&&(u=l),Tt(r,t.slice(f,u),!0),b===44&&(Tt(e,i,r),r=Object.create(null),i=void 0),f=u=-1}else if(b===61&&f!==-1&&u===-1)o=t.slice(f,l),f=u=-1;else throw new SyntaxError(`Unexpected character at index ${l}`);else if(a){if(Ji[b]!==1)throw new SyntaxError(`Unexpected character at index ${l}`);f===-1?f=l:n||(n=!0),a=!1}else if(s)if(Ji[b]===1)f===-1&&(f=l);else if(b===34&&f!==-1)s=!1,u=l;else if(b===92)a=!0;else throw new SyntaxError(`Unexpected character at index ${l}`);else if(b===34&&t.charCodeAt(l-1)===61)s=!0;else if(u===-1&&Ji[b]===1)f===-1&&(f=l);else if(f!==-1&&(b===32||b===9))u===-1&&(u=l);else if(b===59||b===44){if(f===-1)throw new SyntaxError(`Unexpected character at index ${l}`);u===-1&&(u=l);let w=t.slice(f,u);n&&(w=w.replace(/\\/g,""),n=!1),Tt(r,o,w),b===44&&(Tt(e,i,r),r=Object.create(null),i=void 0),o=void 0,f=u=-1}else throw new SyntaxError(`Unexpected character at index ${l}`)}if(f===-1||s)throw new SyntaxError("Unexpected end of input");u===-1&&(u=l);let _=t.slice(f,u);return i===void 0?Tt(e,_,r):(o===void 0?Tt(r,_,!0):n?Tt(r,o,_.replace(/\\/g,"")):Tt(r,o,_),Tt(e,i,r)),e}function aw(t){return Object.keys(t).map(e=>{let r=t[e];return Array.isArray(r)||(r=[r]),r.map(n=>[e].concat(Object.keys(n).map(a=>{let s=n[a];return Array.isArray(s)||(s=[s]),s.map(i=>i===!0?a:`${a}=${i}`).join("; ")})).join("; ")).join(", ")}).join(", ")}U_.exports={format:aw,parse:nw}});var Sc=C((H4,J_)=>{"use strict";var sw=require("events"),iw=require("https"),ow=require("http"),q_=require("net"),pw=require("tls"),{randomBytes:fw,createHash:uw}=require("crypto"),{Readable:V4}=require("stream"),{URL:Oc}=require("url"),fa=zi(),dw=Fc(),lw=wc(),{BINARY_TYPES:N_,EMPTY_BUFFER:vc,GUID:cw,kStatusCode:mw,kWebSocket:De,NOOP:B_}=es(),{addEventListener:hw,removeEventListener:gw}=A_(),{format:_w,parse:Tw}=$c(),{toBuffer:yw}=Li(),Vr=["CONNECTING","OPEN","CLOSING","CLOSED"],jc=[8,13],bw=30*1e3,K=class extends sw{constructor(e,r,n){super();this._binaryType=N_[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage="",this._closeTimer=null,this._extensions={},this._protocol="",this._readyState=K.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,Array.isArray(r)?r=r.join(", "):typeof r=="object"&&r!==null&&(n=r,r=void 0),L_(this,e,r,n)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(e){!N_.includes(e)||(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get onclose(){}set onclose(e){}get onerror(){}set onerror(e){}get onopen(){}set onopen(e){}get onmessage(){}set onmessage(e){}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,r,n){let a=new dw(this.binaryType,this._extensions,this._isServer,n);this._sender=new lw(e,this._extensions),this._receiver=a,this._socket=e,a[De]=this,e[De]=this,a.on("conclude",ww),a.on("drain",$w),a.on("error",Ow),a.on("message",vw),a.on("ping",jw),a.on("pong",Iw),e.setTimeout(0),e.setNoDelay(),r.length>0&&e.unshift(r),e.on("close",z_),e.on("data",cd),e.on("end",K_),e.on("error",Q_),this._readyState=K.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=K.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[fa.extensionName]&&this._extensions[fa.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=K.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,r){if(this.readyState!==K.CLOSED){if(this.readyState===K.CONNECTING){let n="WebSocket was closed before the connection was established";return Ze(this,this._req,n)}if(this.readyState===K.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=K.CLOSING,this._sender.close(e,r,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),bw)}}ping(e,r,n){if(this.readyState===K.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==K.OPEN){kc(this,e,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(e||vc,r,n)}pong(e,r,n){if(this.readyState===K.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==K.OPEN){kc(this,e,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(e||vc,r,n)}send(e,r,n){if(this.readyState===K.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(n=r,r={}),typeof e=="number"&&(e=e.toString()),this.readyState!==K.OPEN){kc(this,e,n);return}let a=P({binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0},r);this._extensions[fa.extensionName]||(a.compress=!1),this._sender.send(e||vc,a,n)}terminate(){if(this.readyState!==K.CLOSED){if(this.readyState===K.CONNECTING){let e="WebSocket was closed before the connection was established";return Ze(this,this._req,e)}this._socket&&(this._readyState=K.CLOSING,this._socket.destroy())}}};Object.defineProperty(K,"CONNECTING",{enumerable:!0,value:Vr.indexOf("CONNECTING")});Object.defineProperty(K.prototype,"CONNECTING",{enumerable:!0,value:Vr.indexOf("CONNECTING")});Object.defineProperty(K,"OPEN",{enumerable:!0,value:Vr.indexOf("OPEN")});Object.defineProperty(K.prototype,"OPEN",{enumerable:!0,value:Vr.indexOf("OPEN")});Object.defineProperty(K,"CLOSING",{enumerable:!0,value:Vr.indexOf("CLOSING")});Object.defineProperty(K.prototype,"CLOSING",{enumerable:!0,value:Vr.indexOf("CLOSING")});Object.defineProperty(K,"CLOSED",{enumerable:!0,value:Vr.indexOf("CLOSED")});Object.defineProperty(K.prototype,"CLOSED",{enumerable:!0,value:Vr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","protocol","readyState","url"].forEach(t=>{Object.defineProperty(K.prototype,t,{enumerable:!0})});["open","error","close","message"].forEach(t=>{Object.defineProperty(K.prototype,`on${t}`,{enumerable:!0,get(){let e=this.listeners(t);for(let r=0;r<e.length;r++)if(e[r]._listener)return e[r]._listener},set(e){let r=this.listeners(t);for(let n=0;n<r.length;n++)r[n]._listener&&this.removeListener(t,r[n]);this.addEventListener(t,e)}})});K.prototype.addEventListener=hw;K.prototype.removeEventListener=gw;J_.exports=K;function L_(t,e,r,n){let a=q(P({protocolVersion:jc[1],maxPayload:100*1024*1024,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10},n),{createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:void 0,host:void 0,path:void 0,port:void 0});if(!jc.includes(a.protocolVersion))throw new RangeError(`Unsupported protocol version: ${a.protocolVersion} (supported versions: ${jc.join(", ")})`);let s;e instanceof Oc?(s=e,t._url=e.href):(s=new Oc(e),t._url=e);let i=s.protocol==="ws+unix:";if(!s.host&&(!i||!s.pathname)){let w=new Error(`Invalid URL: ${t.url}`);if(t._redirects===0)throw w;Ic(t,w);return}let o=s.protocol==="wss:"||s.protocol==="https:",f=o?443:80,u=fw(16).toString("base64"),l=o?iw.get:ow.get,_;if(a.createConnection=o?Fw:xw,a.defaultPort=a.defaultPort||f,a.port=s.port||f,a.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,a.headers=P({"Sec-WebSocket-Version":a.protocolVersion,"Sec-WebSocket-Key":u,Connection:"Upgrade",Upgrade:"websocket"},a.headers),a.path=s.pathname+s.search,a.timeout=a.handshakeTimeout,a.perMessageDeflate&&(_=new fa(a.perMessageDeflate!==!0?a.perMessageDeflate:{},!1,a.maxPayload),a.headers["Sec-WebSocket-Extensions"]=_w({[fa.extensionName]:_.offer()})),r&&(a.headers["Sec-WebSocket-Protocol"]=r),a.origin&&(a.protocolVersion<13?a.headers["Sec-WebSocket-Origin"]=a.origin:a.headers.Origin=a.origin),(s.username||s.password)&&(a.auth=`${s.username}:${s.password}`),i){let w=a.path.split(":");a.socketPath=w[0],a.path=w[1]}let b=t._req=l(a);a.timeout&&b.on("timeout",()=>{Ze(t,b,"Opening handshake has timed out")}),b.on("error",w=>{b===null||b.aborted||(b=t._req=null,Ic(t,w))}),b.on("response",w=>{let y=w.headers.location,j=w.statusCode;if(y&&a.followRedirects&&j>=300&&j<400){if(++t._redirects>a.maxRedirects){Ze(t,b,"Maximum redirects exceeded");return}b.abort();let I;try{I=new Oc(y,e)}catch(k){Ic(t,k);return}L_(t,I,r,n)}else t.emit("unexpected-response",b,w)||Ze(t,b,`Unexpected server response: ${w.statusCode}`)}),b.on("upgrade",(w,y,j)=>{if(t.emit("upgrade",w),t.readyState!==K.CONNECTING)return;b=t._req=null;let I=uw("sha1").update(u+cw).digest("base64");if(w.headers["sec-websocket-accept"]!==I){Ze(t,y,"Invalid Sec-WebSocket-Accept header");return}let k=w.headers["sec-websocket-protocol"],A=(r||"").split(/, */),ce;if(!r&&k?ce="Server sent a subprotocol but none was requested":r&&!k?ce="Server sent no subprotocol":k&&!A.includes(k)&&(ce="Server sent an invalid subprotocol"),ce){Ze(t,y,ce);return}k&&(t._protocol=k);let Y=w.headers["sec-websocket-extensions"];if(Y!==void 0){if(!_){Ze(t,y,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let z;try{z=Tw(Y)}catch(Ge){Ze(t,y,"Invalid Sec-WebSocket-Extensions header");return}let be=Object.keys(z);if(be.length){if(be.length!==1||be[0]!==fa.extensionName){Ze(t,y,"Server indicated an extension that was not requested");return}try{_.accept(z[fa.extensionName])}catch(Ge){Ze(t,y,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[fa.extensionName]=_}}t.setSocket(y,j,a.maxPayload)})}function Ic(t,e){t._readyState=K.CLOSING,t.emit("error",e),t.emitClose()}function xw(t){return t.path=t.socketPath,q_.connect(t)}function Fw(t){return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=q_.isIP(t.host)?"":t.host),pw.connect(t)}function Ze(t,e,r){t._readyState=K.CLOSING;let n=new Error(r);Error.captureStackTrace(n,Ze),e.setHeader?(e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),e.once("abort",t.emitClose.bind(t)),t.emit("error",n)):(e.destroy(n),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)))}function kc(t,e,r){if(e){let n=yw(e).length;t._socket?t._sender._bufferedBytes+=n:t._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${t.readyState} (${Vr[t.readyState]})`);r(n)}}function ww(t,e){let r=this[De];r._closeFrameReceived=!0,r._closeMessage=e,r._closeCode=t,r._socket[De]!==void 0&&(r._socket.removeListener("data",cd),process.nextTick(H_,r._socket),t===1005?r.close():r.close(t,e))}function $w(){this[De]._socket.resume()}function Ow(t){let e=this[De];e._socket[De]!==void 0&&(e._socket.removeListener("data",cd),process.nextTick(H_,e._socket),e.close(t[mw])),e.emit("error",t)}function V_(){this[De].emitClose()}function vw(t){this[De].emit("message",t)}function jw(t){let e=this[De];e.pong(t,!e._isServer,B_),e.emit("ping",t)}function Iw(t){this[De].emit("pong",t)}function H_(t){t.resume()}function z_(){let t=this[De];this.removeListener("close",z_),this.removeListener("data",cd),this.removeListener("end",K_),t._readyState=K.CLOSING;let e;!this._readableState.endEmitted&&!t._closeFrameReceived&&!t._receiver._writableState.errorEmitted&&(e=t._socket.read())!==null&&t._receiver.write(e),t._receiver.end(),this[De]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",V_),t._receiver.on("finish",V_))}function cd(t){this[De]._receiver.write(t)||this.pause()}function K_(){let t=this[De];t._readyState=K.CLOSING,t._receiver.end(),this.end()}function Q_(){let t=this[De];this.removeListener("error",Q_),this.on("error",B_),t&&(t._readyState=K.CLOSING,this.destroy())}});var eT=C((z4,Z_)=>{"use strict";var{Duplex:kw}=require("stream");function X_(t){t.emit("close")}function Sw(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Y_(t){this.removeListener("error",Y_),this.destroy(),this.listenerCount("error")===0&&this.emit("error",t)}function Cw(t,e){let r=!0,n=!0;function a(){r&&t._socket.resume()}t.readyState===t.CONNECTING?t.once("open",function(){t._receiver.removeAllListeners("drain"),t._receiver.on("drain",a)}):(t._receiver.removeAllListeners("drain"),t._receiver.on("drain",a));let s=new kw(q(P({},e),{autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1}));return t.on("message",function(o){s.push(o)||(r=!1,t._socket.pause())}),t.once("error",function(o){s.destroyed||(n=!1,s.destroy(o))}),t.once("close",function(){s.destroyed||s.push(null)}),s._destroy=function(i,o){if(t.readyState===t.CLOSED){o(i),process.nextTick(X_,s);return}let f=!1;t.once("error",function(l){f=!0,o(l)}),t.once("close",function(){f||o(i),process.nextTick(X_,s)}),n&&t.terminate()},s._final=function(i){if(t.readyState===t.CONNECTING){t.once("open",function(){s._final(i)});return}t._socket!==null&&(t._socket._writableState.finished?(i(),s._readableState.endEmitted&&s.destroy()):(t._socket.once("finish",function(){i()}),t.close()))},s._read=function(){(t.readyState===t.OPEN||t.readyState===t.CLOSING)&&!r&&(r=!0,t._receiver._writableState.needDrain||t._socket.resume())},s._write=function(i,o,f){if(t.readyState===t.CONNECTING){t.once("open",function(){s._write(i,o,f)});return}t.send(i,f)},s.on("end",Sw),s.on("error",Y_),s}Z_.exports=Cw});var iT=C((X4,sT)=>{"use strict";var Pw=require("events"),md=require("http"),K4=require("https"),Q4=require("net"),J4=require("tls"),{createHash:Gw}=require("crypto"),rs=zi(),Dw=Sc(),{format:Mw,parse:Ww}=$c(),{GUID:Ew,kWebSocket:Rw}=es(),Aw=/^[+/0-9A-Za-z]{22}==$/,tT=0,rT=1,nT=2,aT=class extends Pw{constructor(e,r){super();if(e=P({maxPayload:100*1024*1024,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null},e),e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=md.createServer((n,a)=>{let s=md.STATUS_CODES[426];a.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),a.end(s)}),this._server.listen(e.port,e.host,e.backlog,r)):e.server&&(this._server=e.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=Uw(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(a,s,i)=>{this.handleUpgrade(a,s,i,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set),this.options=e,this._state=tT}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(e&&this.once("close",e),this._state===nT){process.nextTick(Cc,this);return}if(this._state===rT)return;if(this._state=rT,this.clients)for(let n of this.clients)n.terminate();let r=this._server;if(r&&(this._removeListeners(),this._removeListeners=this._server=null,this.options.port!=null)){r.close(Cc.bind(void 0,this));return}process.nextTick(Cc,this)}shouldHandle(e){if(this.options.path){let r=e.url.indexOf("?");if((r!==-1?e.url.slice(0,r):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,r,n,a){r.on("error",Pc);let s=e.headers["sec-websocket-key"]!==void 0?e.headers["sec-websocket-key"].trim():!1,i=+e.headers["sec-websocket-version"],o={};if(e.method!=="GET"||e.headers.upgrade.toLowerCase()!=="websocket"||!s||!Aw.test(s)||i!==8&&i!==13||!this.shouldHandle(e))return Xi(r,400);if(this.options.perMessageDeflate){let f=new rs(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let u=Ww(e.headers["sec-websocket-extensions"]);u[rs.extensionName]&&(f.accept(u[rs.extensionName]),o[rs.extensionName]=f)}catch(u){return Xi(r,400)}}if(this.options.verifyClient){let f={origin:e.headers[`${i===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(f,(u,l,_,b)=>{if(!u)return Xi(r,l||401,_,b);this.completeUpgrade(s,o,e,r,n,a)});return}if(!this.options.verifyClient(f))return Xi(r,401)}this.completeUpgrade(s,o,e,r,n,a)}completeUpgrade(e,r,n,a,s,i){if(!a.readable||!a.writable)return a.destroy();if(a[Rw])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>tT)return Xi(a,503);let o=Gw("sha1").update(e+Ew).digest("base64"),f=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${o}`],u=new Dw(null),l=n.headers["sec-websocket-protocol"];if(l&&(l=l.split(",").map(qw),this.options.handleProtocols?l=this.options.handleProtocols(l,n):l=l[0],l&&(f.push(`Sec-WebSocket-Protocol: ${l}`),u._protocol=l)),r[rs.extensionName]){let _=r[rs.extensionName].params,b=Mw({[rs.extensionName]:[_]});f.push(`Sec-WebSocket-Extensions: ${b}`),u._extensions=r}this.emit("headers",f,n),a.write(f.concat(`\r
|
|
3
|
+
`);function o(f){var u=lc(Ur.join(f,"prebuilds")).map(Jg),l=u.filter(Xg(uc,fc)).sort(Yg)[0];if(!!l){var _=Ur.join(f,"prebuilds",l.name),b=lc(_).map(Zg),w=b.filter(e_(pc,Vg)),y=w.sort(t_(pc))[0];if(y)return Ur.join(_,y.file)}}};function lc(t){try{return Ng.readdirSync(t)}catch(e){return[]}}function Kg(t,e){var r=lc(t).filter(e);return r[0]&&Ur.join(t,r[0])}function Qg(t){return/\.node$/.test(t)}function Jg(t){var e=t.split("-");if(e.length===2){var r=e[0],n=e[1].split("+");if(!!r&&!!n.length&&!!n.every(Boolean))return{name:t,platform:r,architectures:n}}}function Xg(t,e){return function(r){return r==null||r.platform!==t?!1:r.architectures.includes(e)}}function Yg(t,e){return t.architectures.length-e.architectures.length}function Zg(t){var e=t.split("."),r=e.pop(),n={file:t,specificity:0};if(r==="node"){for(var a=0;a<e.length;a++){var s=e[a];if(s==="node"||s==="electron"||s==="node-webkit")n.runtime=s;else if(s==="napi")n.napi=!0;else if(s.slice(0,3)==="abi")n.abi=s.slice(3);else if(s.slice(0,2)==="uv")n.uv=s.slice(2);else if(s.slice(0,4)==="armv")n.armv=s.slice(4);else if(s==="glibc"||s==="musl")n.libc=s;else continue;n.specificity++}return n}}function e_(t,e){return function(r){return!(r==null||r.runtime!==t&&!PF(r)||r.abi!==e&&!r.napi||r.uv&&r.uv!==zg||r.armv&&r.armv!==dc||r.libc&&r.libc!==Hg)}}function PF(t){return t.runtime==="node"&&t.napi}function t_(t){return function(e,r){return e.runtime!==r.runtime?e.runtime===t?-1:1:e.abi!==r.abi?e.abi?-1:1:e.specificity!==r.specificity?e.specificity>r.specificity?-1:1:0}}function GF(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window!="undefined"&&window.process&&window.process.type==="renderer"}function DF(t){return t==="linux"&&Ng.existsSync("/etc/alpine-release")}qr.parseTags=Zg;qr.matchTags=e_;qr.compareTags=t_;qr.parseTuple=Jg;qr.matchTuple=Xg;qr.compareTuples=Yg});var a_=C((P4,n_)=>{"use strict";var MF=(t,e,r,n,a)=>{for(var s=0;s<a;s++)r[n+s]=t[s]^e[s&3]},WF=(t,e)=>{let r=t.length;for(var n=0;n<r;n++)t[n]^=e[n&3]};n_.exports={mask:MF,unmask:WF}});var s_=C((G4,mc)=>{"use strict";try{mc.exports=cc()(__dirname)}catch(t){mc.exports=a_()}});var Li=C((D4,hc)=>{"use strict";var{EMPTY_BUFFER:EF}=es();function i_(t,e){if(t.length===0)return EF;if(t.length===1)return t[0];let r=Buffer.allocUnsafe(e),n=0;for(let a=0;a<t.length;a++){let s=t[a];r.set(s,n),n+=s.length}return n<e?r.slice(0,n):r}function o_(t,e,r,n,a){for(let s=0;s<a;s++)r[n+s]=t[s]^e[s&3]}function p_(t,e){let r=t.length;for(let n=0;n<r;n++)t[n]^=e[n&3]}function f_(t){return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}function fd(t){if(fd.readOnly=!0,Buffer.isBuffer(t))return t;let e;return t instanceof ArrayBuffer?e=Buffer.from(t):ArrayBuffer.isView(t)?e=Buffer.from(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),fd.readOnly=!1),e}try{let t=s_(),e=t.BufferUtil||t;hc.exports={concat:i_,mask(r,n,a,s,i){i<48?o_(r,n,a,s,i):e.mask(r,n,a,s,i)},toArrayBuffer:f_,toBuffer:fd,unmask(r,n){r.length<32?p_(r,n):e.unmask(r,n)}}}catch(t){hc.exports={concat:i_,mask:o_,toArrayBuffer:f_,toBuffer:fd,unmask:p_}}});var c_=C((M4,l_)=>{"use strict";var u_=Symbol("kDone"),gc=Symbol("kRun"),d_=class{constructor(e){this[u_]=()=>{this.pending--,this[gc]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[gc]()}[gc](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[u_])}}};l_.exports=d_});var zi=C((W4,T_)=>{"use strict";var Vi=require("zlib"),m_=Li(),RF=c_(),{kStatusCode:h_,NOOP:AF}=es(),UF=Buffer.from([0,0,255,255]),ud=Symbol("permessage-deflate"),Nr=Symbol("total-length"),Hi=Symbol("callback"),fa=Symbol("buffers"),dd=Symbol("error"),ld,g_=class{constructor(e,r,n){if(this._maxPayload=n|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!ld){let a=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;ld=new RF(a)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[Hi];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let r=this._options,n=e.find(a=>!(r.serverNoContextTakeover===!1&&a.server_no_context_takeover||a.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>a.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!a.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(n.server_no_context_takeover=!0),r.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(n.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?n.client_max_window_bits=r.clientMaxWindowBits:(n.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let r=e[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(e){return e.forEach(r=>{Object.keys(r).forEach(n=>{let a=r[n];if(a.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(a=a[0],n==="client_max_window_bits"){if(a!==!0){let s=+a;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${a}`);a=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${a}`)}else if(n==="server_max_window_bits"){let s=+a;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${a}`);a=s}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(a!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${a}`)}else throw new Error(`Unknown parameter "${n}"`);r[n]=a})}),e}decompress(e,r,n){ld.add(a=>{this._decompress(e,r,(s,i)=>{a(),n(s,i)})})}compress(e,r,n){ld.add(a=>{this._compress(e,r,(s,i)=>{a(),n(s,i)})})}_decompress(e,r,n){let a=this._isServer?"client":"server";if(!this._inflate){let s=`${a}_max_window_bits`,i=typeof this.params[s]!="number"?Vi.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=Vi.createInflateRaw(q(P({},this._options.zlibInflateOptions),{windowBits:i})),this._inflate[ud]=this,this._inflate[Nr]=0,this._inflate[fa]=[],this._inflate.on("error",NF),this._inflate.on("data",__)}this._inflate[Hi]=n,this._inflate.write(e),r&&this._inflate.write(UF),this._inflate.flush(()=>{let s=this._inflate[dd];if(s){this._inflate.close(),this._inflate=null,n(s);return}let i=m_.concat(this._inflate[fa],this._inflate[Nr]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Nr]=0,this._inflate[fa]=[],r&&this.params[`${a}_no_context_takeover`]&&this._inflate.reset()),n(null,i)})}_compress(e,r,n){let a=this._isServer?"server":"client";if(!this._deflate){let s=`${a}_max_window_bits`,i=typeof this.params[s]!="number"?Vi.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=Vi.createDeflateRaw(q(P({},this._options.zlibDeflateOptions),{windowBits:i})),this._deflate[Nr]=0,this._deflate[fa]=[],this._deflate.on("error",AF),this._deflate.on("data",qF)}this._deflate[Hi]=n,this._deflate.write(e),this._deflate.flush(Vi.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=m_.concat(this._deflate[fa],this._deflate[Nr]);r&&(s=s.slice(0,s.length-4)),this._deflate[Hi]=null,this._deflate[Nr]=0,this._deflate[fa]=[],r&&this.params[`${a}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};T_.exports=g_;function qF(t){this[fa].push(t),this[Nr]+=t.length}function __(t){if(this[Nr]+=t.length,this[ud]._maxPayload<1||this[Nr]<=this[ud]._maxPayload){this[fa].push(t);return}this[dd]=new RangeError("Max payload size exceeded"),this[dd].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[dd][h_]=1009,this.removeListener("data",__),this.reset()}function NF(t){this[ud]._inflate=null,t[h_]=1007,this[Hi](t)}});var b_=C((E4,y_)=>{"use strict";function BF(t){let e=t.length,r=0;for(;r<e;)if((t[r]&128)==0)r++;else if((t[r]&224)==192){if(r+1===e||(t[r+1]&192)!=128||(t[r]&254)==192)return!1;r+=2}else if((t[r]&240)==224){if(r+2>=e||(t[r+1]&192)!=128||(t[r+2]&192)!=128||t[r]===224&&(t[r+1]&224)==128||t[r]===237&&(t[r+1]&224)==160)return!1;r+=3}else if((t[r]&248)==240){if(r+3>=e||(t[r+1]&192)!=128||(t[r+2]&192)!=128||(t[r+3]&192)!=128||t[r]===240&&(t[r+1]&240)==128||t[r]===244&&t[r+1]>143||t[r]>244)return!1;r+=4}else return!1;return!0}y_.exports=BF});var x_=C((R4,_c)=>{"use strict";try{_c.exports=cc()(__dirname)}catch(t){_c.exports=b_()}});var yc=C((A4,Tc)=>{"use strict";function F_(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function w_(t){let e=t.length,r=0;for(;r<e;)if((t[r]&128)==0)r++;else if((t[r]&224)==192){if(r+1===e||(t[r+1]&192)!=128||(t[r]&254)==192)return!1;r+=2}else if((t[r]&240)==224){if(r+2>=e||(t[r+1]&192)!=128||(t[r+2]&192)!=128||t[r]===224&&(t[r+1]&224)==128||t[r]===237&&(t[r+1]&224)==160)return!1;r+=3}else if((t[r]&248)==240){if(r+3>=e||(t[r+1]&192)!=128||(t[r+2]&192)!=128||(t[r+3]&192)!=128||t[r]===240&&(t[r+1]&240)==128||t[r]===244&&t[r+1]>143||t[r]>244)return!1;r+=4}else return!1;return!0}try{let t=x_();typeof t=="object"&&(t=t.Validation.isValidUTF8),Tc.exports={isValidStatusCode:F_,isValidUTF8(e){return e.length<150?w_(e):t(e)}}}catch(t){Tc.exports={isValidStatusCode:F_,isValidUTF8:w_}}});var Fc=C((U4,S_)=>{"use strict";var{Writable:LF}=require("stream"),$_=zi(),{BINARY_TYPES:VF,EMPTY_BUFFER:HF,kStatusCode:zF,kWebSocket:KF}=es(),{concat:bc,toArrayBuffer:QF,unmask:JF}=Li(),{isValidStatusCode:XF,isValidUTF8:O_}=yc(),Ki=0,v_=1,j_=2,I_=3,xc=4,YF=5,k_=class extends LF{constructor(e,r,n,a){super();this._binaryType=e||VF[0],this[KF]=void 0,this._extensions=r||{},this._isServer=!!n,this._maxPayload=a|0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=Ki,this._loop=!1}_write(e,r,n){if(this._opcode===8&&this._state==Ki)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=n.slice(e),n.slice(0,e)}let r=Buffer.allocUnsafe(e);do{let n=this._buffers[0],a=r.length-e;e>=n.length?r.set(this._buffers.shift(),a):(r.set(new Uint8Array(n.buffer,n.byteOffset,e),a),this._buffers[0]=n.slice(e)),e-=n.length}while(e>0);return r}startLoop(e){let r;this._loop=!0;do switch(this._state){case Ki:r=this.getInfo();break;case v_:r=this.getPayloadLength16();break;case j_:r=this.getPayloadLength64();break;case I_:this.getMask();break;case xc:r=this.getData(e);break;default:this._loop=!1;return}while(this._loop);e(r)}getInfo(){if(this._bufferedBytes<2){this._loop=!1;return}let e=this.consume(2);if((e[0]&48)!=0)return this._loop=!1,Oe(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");let r=(e[0]&64)==64;if(r&&!this._extensions[$_.extensionName])return this._loop=!1,Oe(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._fin=(e[0]&128)==128,this._opcode=e[0]&15,this._payloadLength=e[1]&127,this._opcode===0){if(r)return this._loop=!1,Oe(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,Oe(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented)return this._loop=!1,Oe(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin)return this._loop=!1,Oe(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(r)return this._loop=!1,Oe(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125)return this._loop=!1,Oe(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}else return this._loop=!1,Oe(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(e[1]&128)==128,this._isServer){if(!this._masked)return this._loop=!1,Oe(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,Oe(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(this._payloadLength===126)this._state=v_;else if(this._payloadLength===127)this._state=j_;else return this.haveLength()}getPayloadLength16(){if(this._bufferedBytes<2){this._loop=!1;return}return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength()}getPayloadLength64(){if(this._bufferedBytes<8){this._loop=!1;return}let e=this.consume(8),r=e.readUInt32BE(0);return r>Math.pow(2,53-32)-1?(this._loop=!1,Oe(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=r*Math.pow(2,32)+e.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,Oe(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=I_:this._state=xc}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=xc}getData(e){let r=HF;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&JF(r,this._mask)}if(this._opcode>7)return this.controlMessage(r);if(this._compressed){this._state=YF,this.decompress(r,e);return}return r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage()}decompress(e,r){this._extensions[$_.extensionName].decompress(e,this._fin,(a,s)=>{if(a)return r(a);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return r(Oe(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));this._fragments.push(s)}let i=this.dataMessage();if(i)return r(i);this.startLoop(r)})}dataMessage(){if(this._fin){let e=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=bc(r,e):this._binaryType==="arraybuffer"?n=QF(bc(r,e)):n=r,this.emit("message",n)}else{let n=bc(r,e);if(!O_(n))return this._loop=!1,Oe(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",n.toString())}}this._state=Ki}controlMessage(e){if(this._opcode===8)if(this._loop=!1,e.length===0)this.emit("conclude",1005,""),this.end();else{if(e.length===1)return Oe(RangeError,"invalid payload length 1",!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");{let r=e.readUInt16BE(0);if(!XF(r))return Oe(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");let n=e.slice(2);if(!O_(n))return Oe(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("conclude",r,n.toString()),this.end()}}else this._opcode===9?this.emit("ping",e):this.emit("pong",e);this._state=Ki}};S_.exports=k_;function Oe(t,e,r,n,a){let s=new t(r?`Invalid WebSocket frame: ${e}`:e);return Error.captureStackTrace(s,Oe),s.code=a,s[zF]=n,s}});var wc=C((B4,G_)=>{"use strict";var q4=require("net"),N4=require("tls"),{randomFillSync:ZF}=require("crypto"),C_=zi(),{EMPTY_BUFFER:ew}=es(),{isValidStatusCode:tw}=yc(),{mask:P_,toBuffer:Br}=Li(),ts=Buffer.alloc(4),Lr=class{constructor(e,r){this._extensions=r||{},this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,r){let n=r.mask&&r.readOnly,a=r.mask?6:2,s=e.length;e.length>=65536?(a+=8,s=127):e.length>125&&(a+=2,s=126);let i=Buffer.allocUnsafe(n?e.length+a:a);return i[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(i[0]|=64),i[1]=s,s===126?i.writeUInt16BE(e.length,2):s===127&&(i.writeUInt32BE(0,2),i.writeUInt32BE(e.length,6)),r.mask?(ZF(ts,0,4),i[1]|=128,i[a-4]=ts[0],i[a-3]=ts[1],i[a-2]=ts[2],i[a-1]=ts[3],n?(P_(e,ts,i,a,e.length),[i]):(P_(e,ts,e,0,e.length),[i,e])):[i,e]}close(e,r,n,a){let s;if(e===void 0)s=ew;else{if(typeof e!="number"||!tw(e))throw new TypeError("First argument must be a valid error code number");if(r===void 0||r==="")s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let i=Buffer.byteLength(r);if(i>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+i),s.writeUInt16BE(e,0),s.write(r,2)}}this._deflating?this.enqueue([this.doClose,s,n,a]):this.doClose(s,n,a)}doClose(e,r,n){this.sendFrame(Lr.frame(e,{fin:!0,rsv1:!1,opcode:8,mask:r,readOnly:!1}),n)}ping(e,r,n){let a=Br(e);if(a.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPing,a,r,Br.readOnly,n]):this.doPing(a,r,Br.readOnly,n)}doPing(e,r,n,a){this.sendFrame(Lr.frame(e,{fin:!0,rsv1:!1,opcode:9,mask:r,readOnly:n}),a)}pong(e,r,n){let a=Br(e);if(a.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPong,a,r,Br.readOnly,n]):this.doPong(a,r,Br.readOnly,n)}doPong(e,r,n,a){this.sendFrame(Lr.frame(e,{fin:!0,rsv1:!1,opcode:10,mask:r,readOnly:n}),a)}send(e,r,n){let a=Br(e),s=this._extensions[C_.extensionName],i=r.binary?2:1,o=r.compress;if(this._firstFragment?(this._firstFragment=!1,o&&s&&(o=a.length>=s._threshold),this._compress=o):(o=!1,i=0),r.fin&&(this._firstFragment=!0),s){let f={fin:r.fin,rsv1:o,opcode:i,mask:r.mask,readOnly:Br.readOnly};this._deflating?this.enqueue([this.dispatch,a,this._compress,f,n]):this.dispatch(a,this._compress,f,n)}else this.sendFrame(Lr.frame(a,{fin:r.fin,rsv1:!1,opcode:i,mask:r.mask,readOnly:Br.readOnly}),n)}dispatch(e,r,n,a){if(!r){this.sendFrame(Lr.frame(e,n),a);return}let s=this._extensions[C_.extensionName];this._bufferedBytes+=e.length,this._deflating=!0,s.compress(e,n.fin,(i,o)=>{if(this._socket.destroyed){let f=new Error("The socket was closed while data was being compressed");typeof a=="function"&&a(f);for(let u=0;u<this._queue.length;u++){let l=this._queue[u][4];typeof l=="function"&&l(f)}return}this._bufferedBytes-=e.length,this._deflating=!1,n.readOnly=!1,this.sendFrame(Lr.frame(o,n),a),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[1].length,Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[1].length,this._queue.push(e)}sendFrame(e,r){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],r),this._socket.uncork()):this._socket.write(e[0],r)}};G_.exports=Lr});var A_=C((L4,R_)=>{"use strict";var Qi=class{constructor(e,r){this.target=r,this.type=e}},D_=class extends Qi{constructor(e,r){super("message",r);this.data=e}},M_=class extends Qi{constructor(e,r,n){super("close",n);this.wasClean=n._closeFrameReceived&&n._closeFrameSent,this.reason=r,this.code=e}},W_=class extends Qi{constructor(e){super("open",e)}},E_=class extends Qi{constructor(e,r){super("error",r);this.message=e.message,this.error=e}},rw={addEventListener(t,e,r){if(typeof e!="function")return;function n(f){e.call(this,new D_(f,this))}function a(f,u){e.call(this,new M_(f,u,this))}function s(f){e.call(this,new E_(f,this))}function i(){e.call(this,new W_(this))}let o=r&&r.once?"once":"on";t==="message"?(n._listener=e,this[o](t,n)):t==="close"?(a._listener=e,this[o](t,a)):t==="error"?(s._listener=e,this[o](t,s)):t==="open"?(i._listener=e,this[o](t,i)):this[o](t,e)},removeEventListener(t,e){let r=this.listeners(t);for(let n=0;n<r.length;n++)(r[n]===e||r[n]._listener===e)&&this.removeListener(t,r[n])}};R_.exports=rw});var $c=C((V4,U_)=>{"use strict";var Ji=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Tt(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}function nw(t){let e=Object.create(null);if(t===void 0||t==="")return e;let r=Object.create(null),n=!1,a=!1,s=!1,i,o,f=-1,u=-1,l=0;for(;l<t.length;l++){let b=t.charCodeAt(l);if(i===void 0)if(u===-1&&Ji[b]===1)f===-1&&(f=l);else if(b===32||b===9)u===-1&&f!==-1&&(u=l);else if(b===59||b===44){if(f===-1)throw new SyntaxError(`Unexpected character at index ${l}`);u===-1&&(u=l);let w=t.slice(f,u);b===44?(Tt(e,w,r),r=Object.create(null)):i=w,f=u=-1}else throw new SyntaxError(`Unexpected character at index ${l}`);else if(o===void 0)if(u===-1&&Ji[b]===1)f===-1&&(f=l);else if(b===32||b===9)u===-1&&f!==-1&&(u=l);else if(b===59||b===44){if(f===-1)throw new SyntaxError(`Unexpected character at index ${l}`);u===-1&&(u=l),Tt(r,t.slice(f,u),!0),b===44&&(Tt(e,i,r),r=Object.create(null),i=void 0),f=u=-1}else if(b===61&&f!==-1&&u===-1)o=t.slice(f,l),f=u=-1;else throw new SyntaxError(`Unexpected character at index ${l}`);else if(a){if(Ji[b]!==1)throw new SyntaxError(`Unexpected character at index ${l}`);f===-1?f=l:n||(n=!0),a=!1}else if(s)if(Ji[b]===1)f===-1&&(f=l);else if(b===34&&f!==-1)s=!1,u=l;else if(b===92)a=!0;else throw new SyntaxError(`Unexpected character at index ${l}`);else if(b===34&&t.charCodeAt(l-1)===61)s=!0;else if(u===-1&&Ji[b]===1)f===-1&&(f=l);else if(f!==-1&&(b===32||b===9))u===-1&&(u=l);else if(b===59||b===44){if(f===-1)throw new SyntaxError(`Unexpected character at index ${l}`);u===-1&&(u=l);let w=t.slice(f,u);n&&(w=w.replace(/\\/g,""),n=!1),Tt(r,o,w),b===44&&(Tt(e,i,r),r=Object.create(null),i=void 0),o=void 0,f=u=-1}else throw new SyntaxError(`Unexpected character at index ${l}`)}if(f===-1||s)throw new SyntaxError("Unexpected end of input");u===-1&&(u=l);let _=t.slice(f,u);return i===void 0?Tt(e,_,r):(o===void 0?Tt(r,_,!0):n?Tt(r,o,_.replace(/\\/g,"")):Tt(r,o,_),Tt(e,i,r)),e}function aw(t){return Object.keys(t).map(e=>{let r=t[e];return Array.isArray(r)||(r=[r]),r.map(n=>[e].concat(Object.keys(n).map(a=>{let s=n[a];return Array.isArray(s)||(s=[s]),s.map(i=>i===!0?a:`${a}=${i}`).join("; ")})).join("; ")).join(", ")}).join(", ")}U_.exports={format:aw,parse:nw}});var Sc=C((z4,J_)=>{"use strict";var sw=require("events"),iw=require("https"),ow=require("http"),q_=require("net"),pw=require("tls"),{randomBytes:fw,createHash:uw}=require("crypto"),{Readable:H4}=require("stream"),{URL:Oc}=require("url"),ua=zi(),dw=Fc(),lw=wc(),{BINARY_TYPES:N_,EMPTY_BUFFER:vc,GUID:cw,kStatusCode:mw,kWebSocket:De,NOOP:B_}=es(),{addEventListener:hw,removeEventListener:gw}=A_(),{format:_w,parse:Tw}=$c(),{toBuffer:yw}=Li(),Vr=["CONNECTING","OPEN","CLOSING","CLOSED"],jc=[8,13],bw=30*1e3,K=class extends sw{constructor(e,r,n){super();this._binaryType=N_[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage="",this._closeTimer=null,this._extensions={},this._protocol="",this._readyState=K.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,Array.isArray(r)?r=r.join(", "):typeof r=="object"&&r!==null&&(n=r,r=void 0),L_(this,e,r,n)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(e){!N_.includes(e)||(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get onclose(){}set onclose(e){}get onerror(){}set onerror(e){}get onopen(){}set onopen(e){}get onmessage(){}set onmessage(e){}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,r,n){let a=new dw(this.binaryType,this._extensions,this._isServer,n);this._sender=new lw(e,this._extensions),this._receiver=a,this._socket=e,a[De]=this,e[De]=this,a.on("conclude",ww),a.on("drain",$w),a.on("error",Ow),a.on("message",vw),a.on("ping",jw),a.on("pong",Iw),e.setTimeout(0),e.setNoDelay(),r.length>0&&e.unshift(r),e.on("close",z_),e.on("data",cd),e.on("end",K_),e.on("error",Q_),this._readyState=K.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=K.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[ua.extensionName]&&this._extensions[ua.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=K.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,r){if(this.readyState!==K.CLOSED){if(this.readyState===K.CONNECTING){let n="WebSocket was closed before the connection was established";return Ze(this,this._req,n)}if(this.readyState===K.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=K.CLOSING,this._sender.close(e,r,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),bw)}}ping(e,r,n){if(this.readyState===K.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==K.OPEN){kc(this,e,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(e||vc,r,n)}pong(e,r,n){if(this.readyState===K.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==K.OPEN){kc(this,e,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(e||vc,r,n)}send(e,r,n){if(this.readyState===K.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(n=r,r={}),typeof e=="number"&&(e=e.toString()),this.readyState!==K.OPEN){kc(this,e,n);return}let a=P({binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0},r);this._extensions[ua.extensionName]||(a.compress=!1),this._sender.send(e||vc,a,n)}terminate(){if(this.readyState!==K.CLOSED){if(this.readyState===K.CONNECTING){let e="WebSocket was closed before the connection was established";return Ze(this,this._req,e)}this._socket&&(this._readyState=K.CLOSING,this._socket.destroy())}}};Object.defineProperty(K,"CONNECTING",{enumerable:!0,value:Vr.indexOf("CONNECTING")});Object.defineProperty(K.prototype,"CONNECTING",{enumerable:!0,value:Vr.indexOf("CONNECTING")});Object.defineProperty(K,"OPEN",{enumerable:!0,value:Vr.indexOf("OPEN")});Object.defineProperty(K.prototype,"OPEN",{enumerable:!0,value:Vr.indexOf("OPEN")});Object.defineProperty(K,"CLOSING",{enumerable:!0,value:Vr.indexOf("CLOSING")});Object.defineProperty(K.prototype,"CLOSING",{enumerable:!0,value:Vr.indexOf("CLOSING")});Object.defineProperty(K,"CLOSED",{enumerable:!0,value:Vr.indexOf("CLOSED")});Object.defineProperty(K.prototype,"CLOSED",{enumerable:!0,value:Vr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","protocol","readyState","url"].forEach(t=>{Object.defineProperty(K.prototype,t,{enumerable:!0})});["open","error","close","message"].forEach(t=>{Object.defineProperty(K.prototype,`on${t}`,{enumerable:!0,get(){let e=this.listeners(t);for(let r=0;r<e.length;r++)if(e[r]._listener)return e[r]._listener},set(e){let r=this.listeners(t);for(let n=0;n<r.length;n++)r[n]._listener&&this.removeListener(t,r[n]);this.addEventListener(t,e)}})});K.prototype.addEventListener=hw;K.prototype.removeEventListener=gw;J_.exports=K;function L_(t,e,r,n){let a=q(P({protocolVersion:jc[1],maxPayload:100*1024*1024,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10},n),{createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:void 0,host:void 0,path:void 0,port:void 0});if(!jc.includes(a.protocolVersion))throw new RangeError(`Unsupported protocol version: ${a.protocolVersion} (supported versions: ${jc.join(", ")})`);let s;e instanceof Oc?(s=e,t._url=e.href):(s=new Oc(e),t._url=e);let i=s.protocol==="ws+unix:";if(!s.host&&(!i||!s.pathname)){let w=new Error(`Invalid URL: ${t.url}`);if(t._redirects===0)throw w;Ic(t,w);return}let o=s.protocol==="wss:"||s.protocol==="https:",f=o?443:80,u=fw(16).toString("base64"),l=o?iw.get:ow.get,_;if(a.createConnection=o?Fw:xw,a.defaultPort=a.defaultPort||f,a.port=s.port||f,a.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,a.headers=P({"Sec-WebSocket-Version":a.protocolVersion,"Sec-WebSocket-Key":u,Connection:"Upgrade",Upgrade:"websocket"},a.headers),a.path=s.pathname+s.search,a.timeout=a.handshakeTimeout,a.perMessageDeflate&&(_=new ua(a.perMessageDeflate!==!0?a.perMessageDeflate:{},!1,a.maxPayload),a.headers["Sec-WebSocket-Extensions"]=_w({[ua.extensionName]:_.offer()})),r&&(a.headers["Sec-WebSocket-Protocol"]=r),a.origin&&(a.protocolVersion<13?a.headers["Sec-WebSocket-Origin"]=a.origin:a.headers.Origin=a.origin),(s.username||s.password)&&(a.auth=`${s.username}:${s.password}`),i){let w=a.path.split(":");a.socketPath=w[0],a.path=w[1]}let b=t._req=l(a);a.timeout&&b.on("timeout",()=>{Ze(t,b,"Opening handshake has timed out")}),b.on("error",w=>{b===null||b.aborted||(b=t._req=null,Ic(t,w))}),b.on("response",w=>{let y=w.headers.location,j=w.statusCode;if(y&&a.followRedirects&&j>=300&&j<400){if(++t._redirects>a.maxRedirects){Ze(t,b,"Maximum redirects exceeded");return}b.abort();let I;try{I=new Oc(y,e)}catch(k){Ic(t,k);return}L_(t,I,r,n)}else t.emit("unexpected-response",b,w)||Ze(t,b,`Unexpected server response: ${w.statusCode}`)}),b.on("upgrade",(w,y,j)=>{if(t.emit("upgrade",w),t.readyState!==K.CONNECTING)return;b=t._req=null;let I=uw("sha1").update(u+cw).digest("base64");if(w.headers["sec-websocket-accept"]!==I){Ze(t,y,"Invalid Sec-WebSocket-Accept header");return}let k=w.headers["sec-websocket-protocol"],A=(r||"").split(/, */),ce;if(!r&&k?ce="Server sent a subprotocol but none was requested":r&&!k?ce="Server sent no subprotocol":k&&!A.includes(k)&&(ce="Server sent an invalid subprotocol"),ce){Ze(t,y,ce);return}k&&(t._protocol=k);let Y=w.headers["sec-websocket-extensions"];if(Y!==void 0){if(!_){Ze(t,y,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let z;try{z=Tw(Y)}catch(Ge){Ze(t,y,"Invalid Sec-WebSocket-Extensions header");return}let be=Object.keys(z);if(be.length){if(be.length!==1||be[0]!==ua.extensionName){Ze(t,y,"Server indicated an extension that was not requested");return}try{_.accept(z[ua.extensionName])}catch(Ge){Ze(t,y,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[ua.extensionName]=_}}t.setSocket(y,j,a.maxPayload)})}function Ic(t,e){t._readyState=K.CLOSING,t.emit("error",e),t.emitClose()}function xw(t){return t.path=t.socketPath,q_.connect(t)}function Fw(t){return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=q_.isIP(t.host)?"":t.host),pw.connect(t)}function Ze(t,e,r){t._readyState=K.CLOSING;let n=new Error(r);Error.captureStackTrace(n,Ze),e.setHeader?(e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),e.once("abort",t.emitClose.bind(t)),t.emit("error",n)):(e.destroy(n),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)))}function kc(t,e,r){if(e){let n=yw(e).length;t._socket?t._sender._bufferedBytes+=n:t._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${t.readyState} (${Vr[t.readyState]})`);r(n)}}function ww(t,e){let r=this[De];r._closeFrameReceived=!0,r._closeMessage=e,r._closeCode=t,r._socket[De]!==void 0&&(r._socket.removeListener("data",cd),process.nextTick(H_,r._socket),t===1005?r.close():r.close(t,e))}function $w(){this[De]._socket.resume()}function Ow(t){let e=this[De];e._socket[De]!==void 0&&(e._socket.removeListener("data",cd),process.nextTick(H_,e._socket),e.close(t[mw])),e.emit("error",t)}function V_(){this[De].emitClose()}function vw(t){this[De].emit("message",t)}function jw(t){let e=this[De];e.pong(t,!e._isServer,B_),e.emit("ping",t)}function Iw(t){this[De].emit("pong",t)}function H_(t){t.resume()}function z_(){let t=this[De];this.removeListener("close",z_),this.removeListener("data",cd),this.removeListener("end",K_),t._readyState=K.CLOSING;let e;!this._readableState.endEmitted&&!t._closeFrameReceived&&!t._receiver._writableState.errorEmitted&&(e=t._socket.read())!==null&&t._receiver.write(e),t._receiver.end(),this[De]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",V_),t._receiver.on("finish",V_))}function cd(t){this[De]._receiver.write(t)||this.pause()}function K_(){let t=this[De];t._readyState=K.CLOSING,t._receiver.end(),this.end()}function Q_(){let t=this[De];this.removeListener("error",Q_),this.on("error",B_),t&&(t._readyState=K.CLOSING,this.destroy())}});var eT=C((K4,Z_)=>{"use strict";var{Duplex:kw}=require("stream");function X_(t){t.emit("close")}function Sw(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Y_(t){this.removeListener("error",Y_),this.destroy(),this.listenerCount("error")===0&&this.emit("error",t)}function Cw(t,e){let r=!0,n=!0;function a(){r&&t._socket.resume()}t.readyState===t.CONNECTING?t.once("open",function(){t._receiver.removeAllListeners("drain"),t._receiver.on("drain",a)}):(t._receiver.removeAllListeners("drain"),t._receiver.on("drain",a));let s=new kw(q(P({},e),{autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1}));return t.on("message",function(o){s.push(o)||(r=!1,t._socket.pause())}),t.once("error",function(o){s.destroyed||(n=!1,s.destroy(o))}),t.once("close",function(){s.destroyed||s.push(null)}),s._destroy=function(i,o){if(t.readyState===t.CLOSED){o(i),process.nextTick(X_,s);return}let f=!1;t.once("error",function(l){f=!0,o(l)}),t.once("close",function(){f||o(i),process.nextTick(X_,s)}),n&&t.terminate()},s._final=function(i){if(t.readyState===t.CONNECTING){t.once("open",function(){s._final(i)});return}t._socket!==null&&(t._socket._writableState.finished?(i(),s._readableState.endEmitted&&s.destroy()):(t._socket.once("finish",function(){i()}),t.close()))},s._read=function(){(t.readyState===t.OPEN||t.readyState===t.CLOSING)&&!r&&(r=!0,t._receiver._writableState.needDrain||t._socket.resume())},s._write=function(i,o,f){if(t.readyState===t.CONNECTING){t.once("open",function(){s._write(i,o,f)});return}t.send(i,f)},s.on("end",Sw),s.on("error",Y_),s}Z_.exports=Cw});var iT=C((Y4,sT)=>{"use strict";var Pw=require("events"),md=require("http"),Q4=require("https"),J4=require("net"),X4=require("tls"),{createHash:Gw}=require("crypto"),rs=zi(),Dw=Sc(),{format:Mw,parse:Ww}=$c(),{GUID:Ew,kWebSocket:Rw}=es(),Aw=/^[+/0-9A-Za-z]{22}==$/,tT=0,rT=1,nT=2,aT=class extends Pw{constructor(e,r){super();if(e=P({maxPayload:100*1024*1024,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null},e),e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=md.createServer((n,a)=>{let s=md.STATUS_CODES[426];a.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),a.end(s)}),this._server.listen(e.port,e.host,e.backlog,r)):e.server&&(this._server=e.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=Uw(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(a,s,i)=>{this.handleUpgrade(a,s,i,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set),this.options=e,this._state=tT}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(e&&this.once("close",e),this._state===nT){process.nextTick(Cc,this);return}if(this._state===rT)return;if(this._state=rT,this.clients)for(let n of this.clients)n.terminate();let r=this._server;if(r&&(this._removeListeners(),this._removeListeners=this._server=null,this.options.port!=null)){r.close(Cc.bind(void 0,this));return}process.nextTick(Cc,this)}shouldHandle(e){if(this.options.path){let r=e.url.indexOf("?");if((r!==-1?e.url.slice(0,r):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,r,n,a){r.on("error",Pc);let s=e.headers["sec-websocket-key"]!==void 0?e.headers["sec-websocket-key"].trim():!1,i=+e.headers["sec-websocket-version"],o={};if(e.method!=="GET"||e.headers.upgrade.toLowerCase()!=="websocket"||!s||!Aw.test(s)||i!==8&&i!==13||!this.shouldHandle(e))return Xi(r,400);if(this.options.perMessageDeflate){let f=new rs(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let u=Ww(e.headers["sec-websocket-extensions"]);u[rs.extensionName]&&(f.accept(u[rs.extensionName]),o[rs.extensionName]=f)}catch(u){return Xi(r,400)}}if(this.options.verifyClient){let f={origin:e.headers[`${i===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(f,(u,l,_,b)=>{if(!u)return Xi(r,l||401,_,b);this.completeUpgrade(s,o,e,r,n,a)});return}if(!this.options.verifyClient(f))return Xi(r,401)}this.completeUpgrade(s,o,e,r,n,a)}completeUpgrade(e,r,n,a,s,i){if(!a.readable||!a.writable)return a.destroy();if(a[Rw])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>tT)return Xi(a,503);let o=Gw("sha1").update(e+Ew).digest("base64"),f=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${o}`],u=new Dw(null),l=n.headers["sec-websocket-protocol"];if(l&&(l=l.split(",").map(qw),this.options.handleProtocols?l=this.options.handleProtocols(l,n):l=l[0],l&&(f.push(`Sec-WebSocket-Protocol: ${l}`),u._protocol=l)),r[rs.extensionName]){let _=r[rs.extensionName].params,b=Mw({[rs.extensionName]:[_]});f.push(`Sec-WebSocket-Extensions: ${b}`),u._extensions=r}this.emit("headers",f,n),a.write(f.concat(`\r
|
|
4
4
|
`).join(`\r
|
|
5
5
|
`)),a.removeListener("error",Pc),u.setSocket(a,s,this.options.maxPayload),this.clients&&(this.clients.add(u),u.on("close",()=>this.clients.delete(u))),i(u,n)}};sT.exports=aT;function Uw(t,e){for(let r of Object.keys(e))t.on(r,e[r]);return function(){for(let n of Object.keys(e))t.removeListener(n,e[n])}}function Cc(t){t._state=nT,t.emit("close")}function Pc(){this.destroy()}function Xi(t,e,r,n){t.writable&&(r=r||md.STATUS_CODES[e],n=P({Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r)},n),t.write(`HTTP/1.1 ${e} ${md.STATUS_CODES[e]}\r
|
|
6
6
|
`+Object.keys(n).map(a=>`${a}: ${n[a]}`).join(`\r
|
|
7
7
|
`)+`\r
|
|
8
8
|
\r
|
|
9
|
-
`+r)),t.removeListener("error",Pc),t.destroy()}function qw(t){return t.trim()}});var Gc=C((Y4,oT)=>{"use strict";var Yi=Sc();Yi.createWebSocketStream=eT();Yi.Server=iT();Yi.Receiver=Fc();Yi.Sender=wc();oT.exports=Yi});var Ec=C(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});Wc.default=Vw;var Bw=Lw(require("crypto"));function Lw(t){return t&&t.__esModule?t:{default:t}}var Td=new Uint8Array(256),yd=Td.length;function Vw(){return yd>Td.length-16&&(Bw.default.randomFillSync(Td),yd=0),Td.slice(yd,yd+=16)}});var lT=C(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.default=void 0;var Hw=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;bd.default=Hw});var Zi=C(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.default=void 0;var zw=Kw(lT());function Kw(t){return t&&t.__esModule?t:{default:t}}function Qw(t){return typeof t=="string"&&zw.default.test(t)}var Jw=Qw;xd.default=Jw});var eo=C(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});Fd.default=void 0;var Xw=Yw(Zi());function Yw(t){return t&&t.__esModule?t:{default:t}}var ke=[];for(let t=0;t<256;++t)ke.push((t+256).toString(16).substr(1));function Zw(t,e=0){let r=(ke[t[e+0]]+ke[t[e+1]]+ke[t[e+2]]+ke[t[e+3]]+"-"+ke[t[e+4]]+ke[t[e+5]]+"-"+ke[t[e+6]]+ke[t[e+7]]+"-"+ke[t[e+8]]+ke[t[e+9]]+"-"+ke[t[e+10]]+ke[t[e+11]]+ke[t[e+12]]+ke[t[e+13]]+ke[t[e+14]]+ke[t[e+15]]).toLowerCase();if(!(0,Xw.default)(r))throw TypeError("Stringified UUID is invalid");return r}var e$=Zw;Fd.default=e$});var hT=C(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});wd.default=void 0;var t$=cT(Ec()),r$=cT(eo());function cT(t){return t&&t.__esModule?t:{default:t}}var mT,Rc,Ac=0,Uc=0;function n$(t,e,r){let n=e&&r||0,a=e||new Array(16);t=t||{};let s=t.node||mT,i=t.clockseq!==void 0?t.clockseq:Rc;if(s==null||i==null){let b=t.random||(t.rng||t$.default)();s==null&&(s=mT=[b[0]|1,b[1],b[2],b[3],b[4],b[5]]),i==null&&(i=Rc=(b[6]<<8|b[7])&16383)}let o=t.msecs!==void 0?t.msecs:Date.now(),f=t.nsecs!==void 0?t.nsecs:Uc+1,u=o-Ac+(f-Uc)/1e4;if(u<0&&t.clockseq===void 0&&(i=i+1&16383),(u<0||o>Ac)&&t.nsecs===void 0&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Ac=o,Uc=f,Rc=i,o+=122192928e5;let l=((o&268435455)*1e4+f)%4294967296;a[n++]=l>>>24&255,a[n++]=l>>>16&255,a[n++]=l>>>8&255,a[n++]=l&255;let _=o/4294967296*1e4&268435455;a[n++]=_>>>8&255,a[n++]=_&255,a[n++]=_>>>24&15|16,a[n++]=_>>>16&255,a[n++]=i>>>8|128,a[n++]=i&255;for(let b=0;b<6;++b)a[n+b]=s[b];return e||(0,r$.default)(a)}var a$=n$;wd.default=a$});var qc=C($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.default=void 0;var s$=i$(Zi());function i$(t){return t&&t.__esModule?t:{default:t}}function o$(t){if(!(0,s$.default)(t))throw TypeError("Invalid UUID");let e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=e&255,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=e&255,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=e&255,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=e&255,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=e&255,r}var p$=o$;$d.default=p$});var Nc=C(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.default=l$;ns.URL=ns.DNS=void 0;var f$=gT(eo()),u$=gT(qc());function gT(t){return t&&t.__esModule?t:{default:t}}function d$(t){t=unescape(encodeURIComponent(t));let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}var _T="6ba7b810-9dad-11d1-80b4-00c04fd430c8";ns.DNS=_T;var TT="6ba7b811-9dad-11d1-80b4-00c04fd430c8";ns.URL=TT;function l$(t,e,r){function n(a,s,i,o){if(typeof a=="string"&&(a=d$(a)),typeof s=="string"&&(s=(0,u$.default)(s)),s.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let f=new Uint8Array(16+a.length);if(f.set(s),f.set(a,s.length),f=r(f),f[6]=f[6]&15|e,f[8]=f[8]&63|128,i){o=o||0;for(let u=0;u<16;++u)i[o+u]=f[u];return i}return(0,f$.default)(f)}try{n.name=t}catch(a){}return n.DNS=_T,n.URL=TT,n}});var yT=C(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.default=void 0;var c$=m$(require("crypto"));function m$(t){return t&&t.__esModule?t:{default:t}}function h$(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),c$.default.createHash("md5").update(t).digest()}var g$=h$;Od.default=g$});var xT=C(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.default=void 0;var _$=bT(Nc()),T$=bT(yT());function bT(t){return t&&t.__esModule?t:{default:t}}var y$=(0,_$.default)("v3",48,T$.default),b$=y$;vd.default=b$});var wT=C(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.default=void 0;var x$=FT(Ec()),F$=FT(eo());function FT(t){return t&&t.__esModule?t:{default:t}}function w$(t,e,r){t=t||{};let n=t.random||(t.rng||x$.default)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let a=0;a<16;++a)e[r+a]=n[a];return e}return(0,F$.default)(n)}var $$=w$;jd.default=$$});var $T=C(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.default=void 0;var O$=v$(require("crypto"));function v$(t){return t&&t.__esModule?t:{default:t}}function j$(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),O$.default.createHash("sha1").update(t).digest()}var I$=j$;Id.default=I$});var vT=C(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.default=void 0;var k$=OT(Nc()),S$=OT($T());function OT(t){return t&&t.__esModule?t:{default:t}}var C$=(0,k$.default)("v5",80,S$.default),P$=C$;kd.default=P$});var jT=C(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.default=void 0;var G$="00000000-0000-0000-0000-000000000000";Sd.default=G$});var IT=C(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.default=void 0;var D$=M$(Zi());function M$(t){return t&&t.__esModule?t:{default:t}}function W$(t){if(!(0,D$.default)(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}var E$=W$;Cd.default=E$});var kT=C(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});Object.defineProperty(nt,"v1",{enumerable:!0,get:function(){return R$.default}});Object.defineProperty(nt,"v3",{enumerable:!0,get:function(){return A$.default}});Object.defineProperty(nt,"v4",{enumerable:!0,get:function(){return U$.default}});Object.defineProperty(nt,"v5",{enumerable:!0,get:function(){return q$.default}});Object.defineProperty(nt,"NIL",{enumerable:!0,get:function(){return N$.default}});Object.defineProperty(nt,"version",{enumerable:!0,get:function(){return B$.default}});Object.defineProperty(nt,"validate",{enumerable:!0,get:function(){return L$.default}});Object.defineProperty(nt,"stringify",{enumerable:!0,get:function(){return V$.default}});Object.defineProperty(nt,"parse",{enumerable:!0,get:function(){return H$.default}});var R$=zr(hT()),A$=zr(xT()),U$=zr(wT()),q$=zr(vT()),N$=zr(jT()),B$=zr(IT()),L$=zr(Zi()),V$=zr(eo()),H$=zr(qc());function zr(t){return t&&t.__esModule?t:{default:t}}});var ro=C(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.regexpCode=ie.getProperty=ie.safeStringify=ie.stringify=ie.strConcat=ie.addCodeArg=ie.str=ie._=ie.nil=ie._Code=ie.Name=ie.IDENTIFIER=ie._CodeOrName=void 0;var Wd=class{};ie._CodeOrName=Wd;ie.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var ni=class extends Wd{constructor(e){super();if(!ie.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ie.Name=ni;var xt=class extends Wd{constructor(e){super();this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof ni&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ie._Code=xt;ie.nil=new xt("");function AT(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Kc(r,e[n]),r.push(t[++n]);return new xt(r)}ie._=AT;var zc=new xt("+");function UT(t,...e){let r=[to(t[0])],n=0;for(;n<e.length;)r.push(zc),Kc(r,e[n]),r.push(zc,to(t[++n]));return eO(r),new xt(r)}ie.str=UT;function Kc(t,e){e instanceof xt?t.push(...e._items):e instanceof ni?t.push(e):t.push(nO(e))}ie.addCodeArg=Kc;function eO(t){let e=1;for(;e<t.length-1;){if(t[e]===zc){let r=tO(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function tO(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof ni||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof ni))return`"${t}${e.slice(1)}`}function rO(t,e){return e.emptyStr()?t:t.emptyStr()?e:UT`${t}${e}`}ie.strConcat=rO;function nO(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:to(Array.isArray(t)?t.join(","):t)}function aO(t){return new xt(to(t))}ie.stringify=aO;function to(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ie.safeStringify=to;function sO(t){return typeof t=="string"&&ie.IDENTIFIER.test(t)?new xt(`.${t}`):AT`[${t}]`}ie.getProperty=sO;function iO(t){return new xt(t.toString())}ie.regexpCode=iO});var Yc=C(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.ValueScope=Ae.ValueScopeName=Ae.Scope=Ae.varKinds=Ae.UsedValueState=void 0;var Be=ro(),qT=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}},Qc;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Qc=Ae.UsedValueState||(Ae.UsedValueState={}));Ae.varKinds={const:new Be.Name("const"),let:new Be.Name("let"),var:new Be.Name("var")};var Jc=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Be.Name?e:this.name(e)}name(e){return new Be.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Ae.Scope=Jc;var Xc=class extends Be.Name{constructor(e,r){super(r);this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=Be._`.${new Be.Name(r)}[${n}]`}};Ae.ValueScopeName=Xc;var oO=Be._`\n`,NT=class extends Jc{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts=q(P({},e),{_n:e.lines?oO:Be.nil})}get(){return this._scope}name(e){return new Xc(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let a=this.toName(e),{prefix:s}=a,i=(n=r.key)!==null&&n!==void 0?n:r.ref,o=this._values[s];if(o){let l=o.get(i);if(l)return l}else o=this._values[s]=new Map;o.set(i,a);let f=this._scope[s]||(this._scope[s]=[]),u=f.length;return f[u]=r.ref,a.setValue(r,{property:s,itemIndex:u}),a}getValue(e,r){let n=this._values[e];if(!!n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return Be._`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,a=>{if(a.value===void 0)throw new Error(`CodeGen: name "${a}" has no value`);return a.value.code},r,n)}_reduceValues(e,r,n={},a){let s=Be.nil;for(let i in e){let o=e[i];if(!o)continue;let f=n[i]=n[i]||new Map;o.forEach(u=>{if(f.has(u))return;f.set(u,Qc.Started);let l=r(u);if(l){let _=this.opts.es5?Ae.varKinds.var:Ae.varKinds.const;s=Be._`${s}${_} ${u} = ${l};${this.opts._n}`}else if(l=a==null?void 0:a(u))s=Be._`${s}${l}${this.opts._n}`;else throw new qT(u);f.set(u,Qc.Completed)})}return s}};Ae.ValueScope=NT});var Q=C(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.or=V.and=V.not=V.CodeGen=V.operators=V.varKinds=V.ValueScopeName=V.ValueScope=V.Scope=V.Name=V.regexpCode=V.stringify=V.getProperty=V.nil=V.strConcat=V.str=V._=void 0;var X=ro(),at=Yc(),da=ro();Object.defineProperty(V,"_",{enumerable:!0,get:function(){return da._}});Object.defineProperty(V,"str",{enumerable:!0,get:function(){return da.str}});Object.defineProperty(V,"strConcat",{enumerable:!0,get:function(){return da.strConcat}});Object.defineProperty(V,"nil",{enumerable:!0,get:function(){return da.nil}});Object.defineProperty(V,"getProperty",{enumerable:!0,get:function(){return da.getProperty}});Object.defineProperty(V,"stringify",{enumerable:!0,get:function(){return da.stringify}});Object.defineProperty(V,"regexpCode",{enumerable:!0,get:function(){return da.regexpCode}});Object.defineProperty(V,"Name",{enumerable:!0,get:function(){return da.Name}});var Ed=Yc();Object.defineProperty(V,"Scope",{enumerable:!0,get:function(){return Ed.Scope}});Object.defineProperty(V,"ValueScope",{enumerable:!0,get:function(){return Ed.ValueScope}});Object.defineProperty(V,"ValueScopeName",{enumerable:!0,get:function(){return Ed.ValueScopeName}});Object.defineProperty(V,"varKinds",{enumerable:!0,get:function(){return Ed.varKinds}});V.operators={GT:new X._Code(">"),GTE:new X._Code(">="),LT:new X._Code("<"),LTE:new X._Code("<="),EQ:new X._Code("==="),NEQ:new X._Code("!=="),NOT:new X._Code("!"),OR:new X._Code("||"),AND:new X._Code("&&"),ADD:new X._Code("+")};var la=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},BT=class extends la{constructor(e,r,n){super();this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?at.varKinds.var:this.varKind,a=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${a};`+r}optimizeNames(e,r){if(!!e[this.name.str])return this.rhs&&(this.rhs=si(this.rhs,e,r)),this}get names(){return this.rhs instanceof X._CodeOrName?this.rhs.names:{}}},Zc=class extends la{constructor(e,r,n){super();this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof X.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=si(this.rhs,e,r),this}get names(){let e=this.lhs instanceof X.Name?{}:P({},this.lhs.names);return Bd(e,this.rhs)}},LT=class extends Zc{constructor(e,r,n,a){super(e,n,a);this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},VT=class extends la{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},HT=class extends la{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},zT=class extends la{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},KT=class extends la{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=si(this.code,e,r),this}get names(){return this.code instanceof X._CodeOrName?this.code.names:{}}},Rd=class extends la{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,a=n.length;for(;a--;){let s=n[a];s.optimizeNames(e,r)||(pO(e,s.names),n.splice(a,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>is(e,r.names),{})}},ca=class extends Rd{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},QT=class extends Rd{},no=class extends ca{};no.kind="else";var Ft=class extends ca{constructor(e,r){super(r);this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new no(n):n}if(r)return e===!1?r instanceof Ft?r:r.nodes:this.nodes.length?this:new Ft(ey(e),r instanceof Ft?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=si(this.condition,e,r),this}get names(){let e=super.names;return Bd(e,this.condition),this.else&&is(e,this.else.names),e}};Ft.kind="if";var ai=class extends ca{};ai.kind="for";var JT=class extends ai{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(!!super.optimizeNames(e,r))return this.iteration=si(this.iteration,e,r),this}get names(){return is(super.names,this.iteration.names)}},XT=class extends ai{constructor(e,r,n,a){super();this.varKind=e,this.name=r,this.from=n,this.to=a}render(e){let r=e.es5?at.varKinds.var:this.varKind,{name:n,from:a,to:s}=this;return`for(${r} ${n}=${a}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Bd(super.names,this.from);return Bd(e,this.to)}},em=class extends ai{constructor(e,r,n,a){super();this.loop=e,this.varKind=r,this.name=n,this.iterable=a}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(!!super.optimizeNames(e,r))return this.iterable=si(this.iterable,e,r),this}get names(){return is(super.names,this.iterable.names)}},Ad=class extends ca{constructor(e,r,n){super();this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Ad.kind="func";var Ud=class extends Rd{render(e){return"return "+super.render(e)}};Ud.kind="return";var YT=class extends ca{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,a;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(a=this.finally)===null||a===void 0||a.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&is(e,this.catch.names),this.finally&&is(e,this.finally.names),e}},qd=class extends ca{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};qd.kind="catch";var Nd=class extends ca{render(e){return"finally"+super.render(e)}};Nd.kind="finally";var ZT=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts=q(P({},r),{_n:r.lines?`
|
|
10
|
-
`:""}),this._extScope=e,this._scope=new at.Scope({parent:e}),this._nodes=[new QT]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,a){let s=this._scope.toName(r);return n!==void 0&&a&&(this._constants[s.str]=n),this._leafNode(new BT(e,s,n)),s}const(e,r,n){return this._def(at.varKinds.const,e,r,n)}let(e,r,n){return this._def(at.varKinds.let,e,r,n)}var(e,r,n){return this._def(at.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Zc(e,r,n))}add(e,r){return this._leafNode(new LT(e,V.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==X.nil&&this._leafNode(new KT(e)),this}object(...e){let r=["{"];for(let[n,a]of e)r.length>1&&r.push(","),r.push(n),(n!==a||this.opts.es5)&&(r.push(":"),X.addCodeArg(r,a));return r.push("}"),new X._Code(r)}if(e,r,n){if(this._blockNode(new Ft(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Ft(e))}else(){return this._elseNode(new no)}endIf(){return this._endBlockNode(Ft,no)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new JT(e),r)}forRange(e,r,n,a,s=this.opts.es5?at.varKinds.var:at.varKinds.let){let i=this._scope.toName(e);return this._for(new XT(s,i,r,n),()=>a(i))}forOf(e,r,n,a=at.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let i=r instanceof X.Name?r:this.var("_arr",r);return this.forRange("_i",0,X._`${i}.length`,o=>{this.var(s,X._`${i}[${o}]`),n(s)})}return this._for(new em("of",a,s,r),()=>n(s))}forIn(e,r,n,a=this.opts.es5?at.varKinds.var:at.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,X._`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new em("in",a,s,r),()=>n(s))}endFor(){return this._endBlockNode(ai)}label(e){return this._leafNode(new VT(e))}break(e){return this._leafNode(new HT(e))}return(e){let r=new Ud;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ud)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let a=new YT;if(this._blockNode(a),this.code(e),r){let s=this.name("e");this._currNode=a.catch=new qd(s),r(s)}return n&&(this._currNode=a.finally=new Nd,this.code(n)),this._endBlockNode(qd,Nd)}throw(e){return this._leafNode(new zT(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=X.nil,n,a){return this._blockNode(new Ad(e,r,n)),a&&this.code(a).endFunc(),this}endFunc(){return this._endBlockNode(Ad)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Ft))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};V.CodeGen=ZT;function is(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Bd(t,e){return e instanceof X._CodeOrName?is(t,e.names):t}function si(t,e,r){if(t instanceof X.Name)return n(t);if(!a(t))return t;return new X._Code(t._items.reduce((s,i)=>(i instanceof X.Name&&(i=n(i)),i instanceof X._Code?s.push(...i._items):s.push(i),s),[]));function n(s){let i=r[s.str];return i===void 0||e[s.str]!==1?s:(delete e[s.str],i)}function a(s){return s instanceof X._Code&&s._items.some(i=>i instanceof X.Name&&e[i.str]===1&&r[i.str]!==void 0)}}function pO(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function ey(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:X._`!${tm(t)}`}V.not=ey;var fO=ty(V.operators.AND);function uO(...t){return t.reduce(fO)}V.and=uO;var dO=ty(V.operators.OR);function lO(...t){return t.reduce(dO)}V.or=lO;function ty(t){return(e,r)=>e===X.nil?r:r===X.nil?e:X._`${tm(e)} ${t} ${tm(r)}`}function tm(t){return t instanceof X.Name?t:X._`(${t})`}});var ae=C(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.checkStrictMode=H.getErrorPath=H.Type=H.useFunc=H.setEvaluated=H.evaluatedPropsToName=H.mergeEvaluated=H.eachItem=H.unescapeJsonPointer=H.escapeJsonPointer=H.escapeFragment=H.unescapeFragment=H.schemaRefOrVal=H.schemaHasRulesButRef=H.schemaHasRules=H.checkUnknownRules=H.alwaysValidSchema=H.toHash=void 0;var le=Q(),cO=ro();function mO(t){let e={};for(let r of t)e[r]=!0;return e}H.toHash=mO;function hO(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(ry(t,e),!ny(e,t.self.RULES.all))}H.alwaysValidSchema=hO;function ry(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let a=n.RULES.keywords;for(let s in e)a[s]||fy(t,`unknown keyword: "${s}"`)}H.checkUnknownRules=ry;function ny(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}H.schemaHasRules=ny;function gO(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}H.schemaHasRulesButRef=gO;function _O({topSchemaRef:t,schemaPath:e},r,n,a){if(!a){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return le._`${r}`}return le._`${t}${e}${le.getProperty(n)}`}H.schemaRefOrVal=_O;function TO(t){return ay(decodeURIComponent(t))}H.unescapeFragment=TO;function yO(t){return encodeURIComponent(rm(t))}H.escapeFragment=yO;function rm(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}H.escapeJsonPointer=rm;function ay(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}H.unescapeJsonPointer=ay;function bO(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}H.eachItem=bO;function sy({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(a,s,i,o)=>{let f=i===void 0?s:i instanceof le.Name?(s instanceof le.Name?t(a,s,i):e(a,s,i),i):s instanceof le.Name?(e(a,i,s),s):r(s,i);return o===le.Name&&!(f instanceof le.Name)?n(a,f):f}}H.mergeEvaluated={props:sy({mergeNames:(t,e,r)=>t.if(le._`${r} !== true && ${e} !== undefined`,()=>{t.if(le._`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,le._`${r} || {}`).code(le._`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if(le._`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,le._`${r} || {}`),nm(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:P(P({},t),e),resultToName:iy}),items:sy({mergeNames:(t,e,r)=>t.if(le._`${r} !== true && ${e} !== undefined`,()=>t.assign(r,le._`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if(le._`${r} !== true`,()=>t.assign(r,e===!0?!0:le._`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function iy(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",le._`{}`);return e!==void 0&&nm(t,r,e),r}H.evaluatedPropsToName=iy;function nm(t,e,r){Object.keys(r).forEach(n=>t.assign(le._`${e}${le.getProperty(n)}`,!0))}H.setEvaluated=nm;var oy={};function xO(t,e){return t.scopeValue("func",{ref:e,code:oy[e.code]||(oy[e.code]=new cO._Code(e.code))})}H.useFunc=xO;var py;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(py=H.Type||(H.Type={}));function FO(t,e,r){if(t instanceof le.Name){let n=e===py.Num;return r?n?le._`"[" + ${t} + "]"`:le._`"['" + ${t} + "']"`:n?le._`"/" + ${t}`:le._`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?le.getProperty(t).toString():"/"+rm(t)}H.getErrorPath=FO;function fy(t,e,r=t.opts.strictSchema){if(!!r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}H.checkStrictMode=fy});var Kr=C(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});var Me=Q(),wO={data:new Me.Name("data"),valCxt:new Me.Name("valCxt"),instancePath:new Me.Name("instancePath"),parentData:new Me.Name("parentData"),parentDataProperty:new Me.Name("parentDataProperty"),rootData:new Me.Name("rootData"),dynamicAnchors:new Me.Name("dynamicAnchors"),vErrors:new Me.Name("vErrors"),errors:new Me.Name("errors"),this:new Me.Name("this"),self:new Me.Name("self"),scope:new Me.Name("scope"),json:new Me.Name("json"),jsonPos:new Me.Name("jsonPos"),jsonLen:new Me.Name("jsonLen"),jsonPart:new Me.Name("jsonPart")};am.default=wO});var ao=C(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.extendErrors=We.resetErrorsCount=We.reportExtraError=We.reportError=We.keyword$DataError=We.keywordError=void 0;var ee=Q(),Ld=ae(),Ue=Kr();We.keywordError={message:({keyword:t})=>ee.str`should pass "${t}" keyword validation`};We.keyword$DataError={message:({keyword:t,schemaType:e})=>e?ee.str`"${t}" keyword must be ${e} ($data)`:ee.str`"${t}" keyword is invalid ($data)`};function $O(t,e=We.keywordError,r,n){let{it:a}=t,{gen:s,compositeRule:i,allErrors:o}=a,f=ly(t,e,r);(n!=null?n:i||o)?uy(s,f):dy(a,ee._`[${f}]`)}We.reportError=$O;function OO(t,e=We.keywordError,r){let{it:n}=t,{gen:a,compositeRule:s,allErrors:i}=n,o=ly(t,e,r);uy(a,o),s||i||dy(n,Ue.default.vErrors)}We.reportExtraError=OO;function vO(t,e){t.assign(Ue.default.errors,e),t.if(ee._`${Ue.default.vErrors} !== null`,()=>t.if(e,()=>t.assign(ee._`${Ue.default.vErrors}.length`,e),()=>t.assign(Ue.default.vErrors,null)))}We.resetErrorsCount=vO;function jO({gen:t,keyword:e,schemaValue:r,data:n,errsCount:a,it:s}){if(a===void 0)throw new Error("ajv implementation error");let i=t.name("err");t.forRange("i",a,Ue.default.errors,o=>{t.const(i,ee._`${Ue.default.vErrors}[${o}]`),t.if(ee._`${i}.instancePath === undefined`,()=>t.assign(ee._`${i}.instancePath`,ee.strConcat(Ue.default.instancePath,s.errorPath))),t.assign(ee._`${i}.schemaPath`,ee.str`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign(ee._`${i}.schema`,r),t.assign(ee._`${i}.data`,n))})}We.extendErrors=jO;function uy(t,e){let r=t.const("err",e);t.if(ee._`${Ue.default.vErrors} === null`,()=>t.assign(Ue.default.vErrors,ee._`[${r}]`),ee._`${Ue.default.vErrors}.push(${r})`),t.code(ee._`${Ue.default.errors}++`)}function dy(t,e){let{gen:r,validateName:n,schemaEnv:a}=t;a.$async?r.throw(ee._`new ${t.ValidationError}(${e})`):(r.assign(ee._`${n}.errors`,e),r.return(!1))}var os={keyword:new ee.Name("keyword"),schemaPath:new ee.Name("schemaPath"),params:new ee.Name("params"),propertyName:new ee.Name("propertyName"),message:new ee.Name("message"),schema:new ee.Name("schema"),parentSchema:new ee.Name("parentSchema")};function ly(t,e,r){let{createErrors:n}=t.it;return n===!1?ee._`{}`:IO(t,e,r)}function IO(t,e,r={}){let{gen:n,it:a}=t,s=[kO(a,r),SO(t,r)];return CO(t,e,s),n.object(...s)}function kO({errorPath:t},{instancePath:e}){let r=e?ee.str`${t}${Ld.getErrorPath(e,Ld.Type.Str)}`:t;return[Ue.default.instancePath,ee.strConcat(Ue.default.instancePath,r)]}function SO({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let a=n?e:ee.str`${e}/${t}`;return r&&(a=ee.str`${a}${Ld.getErrorPath(r,Ld.Type.Str)}`),[os.schemaPath,a]}function CO(t,{params:e,message:r},n){let{keyword:a,data:s,schemaValue:i,it:o}=t,{opts:f,propertyName:u,topSchemaRef:l,schemaPath:_}=o;n.push([os.keyword,a],[os.params,typeof e=="function"?e(t):e||ee._`{}`]),f.messages&&n.push([os.message,typeof r=="function"?r(t):r]),f.verbose&&n.push([os.schema,i],[os.parentSchema,ee._`${l}${_}`],[Ue.default.data,s]),u&&n.push([os.propertyName,u])}});var my=C(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.boolOrEmptySchema=ii.topBoolOrEmptySchema=void 0;var PO=ao(),GO=Q(),DO=Kr(),MO={message:"boolean schema is false"};function WO(t){let{gen:e,schema:r,validateName:n}=t;r===!1?cy(t,!1):typeof r=="object"&&r.$async===!0?e.return(DO.default.data):(e.assign(GO._`${n}.errors`,null),e.return(!0))}ii.topBoolOrEmptySchema=WO;function EO(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),cy(t)):r.var(e,!0)}ii.boolOrEmptySchema=EO;function cy(t,e){let{gen:r,data:n}=t,a={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};PO.reportError(a,MO,void 0,e)}});var sm=C(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.getRules=oi.isJSONType=void 0;var RO=["string","number","integer","boolean","null","object","array"],AO=new Set(RO);function UO(t){return typeof t=="string"&&AO.has(t)}oi.isJSONType=UO;function qO(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:q(P({},t),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}oi.getRules=qO});var im=C(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.shouldUseRule=ma.shouldUseGroup=ma.schemaHasRulesForType=void 0;function NO({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&hy(t,n)}ma.schemaHasRulesForType=NO;function hy(t,e){return e.rules.some(r=>gy(t,r))}ma.shouldUseGroup=hy;function gy(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}ma.shouldUseRule=gy});var io=C(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.reportTypeError=Se.checkDataTypes=Se.checkDataType=Se.coerceAndCheckDataType=Se.getJSONTypes=Se.getSchemaTypes=Se.DataType=void 0;var BO=sm(),LO=im(),VO=ao(),L=Q(),_y=ae(),so;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(so=Se.DataType||(Se.DataType={}));function HO(t){let e=Ty(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}Se.getSchemaTypes=HO;function Ty(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(BO.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Se.getJSONTypes=Ty;function zO(t,e){let{gen:r,data:n,opts:a}=t,s=KO(e,a.coerceTypes),i=e.length>0&&!(s.length===0&&e.length===1&&LO.schemaHasRulesForType(t,e[0]));if(i){let o=pm(e,n,a.strictNumbers,so.Wrong);r.if(o,()=>{s.length?QO(t,e,s):fm(t)})}return i}Se.coerceAndCheckDataType=zO;var yy=new Set(["string","number","integer","boolean","null"]);function KO(t,e){return e?t.filter(r=>yy.has(r)||e==="array"&&r==="array"):[]}function QO(t,e,r){let{gen:n,data:a,opts:s}=t,i=n.let("dataType",L._`typeof ${a}`),o=n.let("coerced",L._`undefined`);s.coerceTypes==="array"&&n.if(L._`${i} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>n.assign(a,L._`${a}[0]`).assign(i,L._`typeof ${a}`).if(pm(e,a,s.strictNumbers),()=>n.assign(o,a))),n.if(L._`${o} !== undefined`);for(let u of r)(yy.has(u)||u==="array"&&s.coerceTypes==="array")&&f(u);n.else(),fm(t),n.endIf(),n.if(L._`${o} !== undefined`,()=>{n.assign(a,o),JO(t,o)});function f(u){switch(u){case"string":n.elseIf(L._`${i} == "number" || ${i} == "boolean"`).assign(o,L._`"" + ${a}`).elseIf(L._`${a} === null`).assign(o,L._`""`);return;case"number":n.elseIf(L._`${i} == "boolean" || ${a} === null
|
|
9
|
+
`+r)),t.removeListener("error",Pc),t.destroy()}function qw(t){return t.trim()}});var Gc=C((Z4,oT)=>{"use strict";var Yi=Sc();Yi.createWebSocketStream=eT();Yi.Server=iT();Yi.Receiver=Fc();Yi.Sender=wc();oT.exports=Yi});var Ec=C(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});Wc.default=Vw;var Bw=Lw(require("crypto"));function Lw(t){return t&&t.__esModule?t:{default:t}}var Td=new Uint8Array(256),yd=Td.length;function Vw(){return yd>Td.length-16&&(Bw.default.randomFillSync(Td),yd=0),Td.slice(yd,yd+=16)}});var lT=C(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.default=void 0;var Hw=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;bd.default=Hw});var Zi=C(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.default=void 0;var zw=Kw(lT());function Kw(t){return t&&t.__esModule?t:{default:t}}function Qw(t){return typeof t=="string"&&zw.default.test(t)}var Jw=Qw;xd.default=Jw});var eo=C(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});Fd.default=void 0;var Xw=Yw(Zi());function Yw(t){return t&&t.__esModule?t:{default:t}}var ke=[];for(let t=0;t<256;++t)ke.push((t+256).toString(16).substr(1));function Zw(t,e=0){let r=(ke[t[e+0]]+ke[t[e+1]]+ke[t[e+2]]+ke[t[e+3]]+"-"+ke[t[e+4]]+ke[t[e+5]]+"-"+ke[t[e+6]]+ke[t[e+7]]+"-"+ke[t[e+8]]+ke[t[e+9]]+"-"+ke[t[e+10]]+ke[t[e+11]]+ke[t[e+12]]+ke[t[e+13]]+ke[t[e+14]]+ke[t[e+15]]).toLowerCase();if(!(0,Xw.default)(r))throw TypeError("Stringified UUID is invalid");return r}var e$=Zw;Fd.default=e$});var hT=C(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});wd.default=void 0;var t$=cT(Ec()),r$=cT(eo());function cT(t){return t&&t.__esModule?t:{default:t}}var mT,Rc,Ac=0,Uc=0;function n$(t,e,r){let n=e&&r||0,a=e||new Array(16);t=t||{};let s=t.node||mT,i=t.clockseq!==void 0?t.clockseq:Rc;if(s==null||i==null){let b=t.random||(t.rng||t$.default)();s==null&&(s=mT=[b[0]|1,b[1],b[2],b[3],b[4],b[5]]),i==null&&(i=Rc=(b[6]<<8|b[7])&16383)}let o=t.msecs!==void 0?t.msecs:Date.now(),f=t.nsecs!==void 0?t.nsecs:Uc+1,u=o-Ac+(f-Uc)/1e4;if(u<0&&t.clockseq===void 0&&(i=i+1&16383),(u<0||o>Ac)&&t.nsecs===void 0&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Ac=o,Uc=f,Rc=i,o+=122192928e5;let l=((o&268435455)*1e4+f)%4294967296;a[n++]=l>>>24&255,a[n++]=l>>>16&255,a[n++]=l>>>8&255,a[n++]=l&255;let _=o/4294967296*1e4&268435455;a[n++]=_>>>8&255,a[n++]=_&255,a[n++]=_>>>24&15|16,a[n++]=_>>>16&255,a[n++]=i>>>8|128,a[n++]=i&255;for(let b=0;b<6;++b)a[n+b]=s[b];return e||(0,r$.default)(a)}var a$=n$;wd.default=a$});var qc=C($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.default=void 0;var s$=i$(Zi());function i$(t){return t&&t.__esModule?t:{default:t}}function o$(t){if(!(0,s$.default)(t))throw TypeError("Invalid UUID");let e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=e&255,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=e&255,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=e&255,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=e&255,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=e&255,r}var p$=o$;$d.default=p$});var Nc=C(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.default=l$;ns.URL=ns.DNS=void 0;var f$=gT(eo()),u$=gT(qc());function gT(t){return t&&t.__esModule?t:{default:t}}function d$(t){t=unescape(encodeURIComponent(t));let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}var _T="6ba7b810-9dad-11d1-80b4-00c04fd430c8";ns.DNS=_T;var TT="6ba7b811-9dad-11d1-80b4-00c04fd430c8";ns.URL=TT;function l$(t,e,r){function n(a,s,i,o){if(typeof a=="string"&&(a=d$(a)),typeof s=="string"&&(s=(0,u$.default)(s)),s.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let f=new Uint8Array(16+a.length);if(f.set(s),f.set(a,s.length),f=r(f),f[6]=f[6]&15|e,f[8]=f[8]&63|128,i){o=o||0;for(let u=0;u<16;++u)i[o+u]=f[u];return i}return(0,f$.default)(f)}try{n.name=t}catch(a){}return n.DNS=_T,n.URL=TT,n}});var yT=C(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.default=void 0;var c$=m$(require("crypto"));function m$(t){return t&&t.__esModule?t:{default:t}}function h$(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),c$.default.createHash("md5").update(t).digest()}var g$=h$;Od.default=g$});var xT=C(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.default=void 0;var _$=bT(Nc()),T$=bT(yT());function bT(t){return t&&t.__esModule?t:{default:t}}var y$=(0,_$.default)("v3",48,T$.default),b$=y$;vd.default=b$});var wT=C(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.default=void 0;var x$=FT(Ec()),F$=FT(eo());function FT(t){return t&&t.__esModule?t:{default:t}}function w$(t,e,r){t=t||{};let n=t.random||(t.rng||x$.default)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let a=0;a<16;++a)e[r+a]=n[a];return e}return(0,F$.default)(n)}var $$=w$;jd.default=$$});var $T=C(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.default=void 0;var O$=v$(require("crypto"));function v$(t){return t&&t.__esModule?t:{default:t}}function j$(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),O$.default.createHash("sha1").update(t).digest()}var I$=j$;Id.default=I$});var vT=C(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.default=void 0;var k$=OT(Nc()),S$=OT($T());function OT(t){return t&&t.__esModule?t:{default:t}}var C$=(0,k$.default)("v5",80,S$.default),P$=C$;kd.default=P$});var jT=C(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.default=void 0;var G$="00000000-0000-0000-0000-000000000000";Sd.default=G$});var IT=C(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.default=void 0;var D$=M$(Zi());function M$(t){return t&&t.__esModule?t:{default:t}}function W$(t){if(!(0,D$.default)(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}var E$=W$;Cd.default=E$});var kT=C(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});Object.defineProperty(nt,"v1",{enumerable:!0,get:function(){return R$.default}});Object.defineProperty(nt,"v3",{enumerable:!0,get:function(){return A$.default}});Object.defineProperty(nt,"v4",{enumerable:!0,get:function(){return U$.default}});Object.defineProperty(nt,"v5",{enumerable:!0,get:function(){return q$.default}});Object.defineProperty(nt,"NIL",{enumerable:!0,get:function(){return N$.default}});Object.defineProperty(nt,"version",{enumerable:!0,get:function(){return B$.default}});Object.defineProperty(nt,"validate",{enumerable:!0,get:function(){return L$.default}});Object.defineProperty(nt,"stringify",{enumerable:!0,get:function(){return V$.default}});Object.defineProperty(nt,"parse",{enumerable:!0,get:function(){return H$.default}});var R$=zr(hT()),A$=zr(xT()),U$=zr(wT()),q$=zr(vT()),N$=zr(jT()),B$=zr(IT()),L$=zr(Zi()),V$=zr(eo()),H$=zr(qc());function zr(t){return t&&t.__esModule?t:{default:t}}});var ro=C(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.regexpCode=ie.getProperty=ie.safeStringify=ie.stringify=ie.strConcat=ie.addCodeArg=ie.str=ie._=ie.nil=ie._Code=ie.Name=ie.IDENTIFIER=ie._CodeOrName=void 0;var Wd=class{};ie._CodeOrName=Wd;ie.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var ni=class extends Wd{constructor(e){super();if(!ie.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ie.Name=ni;var xt=class extends Wd{constructor(e){super();this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof ni&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ie._Code=xt;ie.nil=new xt("");function AT(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Kc(r,e[n]),r.push(t[++n]);return new xt(r)}ie._=AT;var zc=new xt("+");function UT(t,...e){let r=[to(t[0])],n=0;for(;n<e.length;)r.push(zc),Kc(r,e[n]),r.push(zc,to(t[++n]));return eO(r),new xt(r)}ie.str=UT;function Kc(t,e){e instanceof xt?t.push(...e._items):e instanceof ni?t.push(e):t.push(nO(e))}ie.addCodeArg=Kc;function eO(t){let e=1;for(;e<t.length-1;){if(t[e]===zc){let r=tO(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function tO(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof ni||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof ni))return`"${t}${e.slice(1)}`}function rO(t,e){return e.emptyStr()?t:t.emptyStr()?e:UT`${t}${e}`}ie.strConcat=rO;function nO(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:to(Array.isArray(t)?t.join(","):t)}function aO(t){return new xt(to(t))}ie.stringify=aO;function to(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ie.safeStringify=to;function sO(t){return typeof t=="string"&&ie.IDENTIFIER.test(t)?new xt(`.${t}`):AT`[${t}]`}ie.getProperty=sO;function iO(t){return new xt(t.toString())}ie.regexpCode=iO});var Yc=C(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.ValueScope=Ae.ValueScopeName=Ae.Scope=Ae.varKinds=Ae.UsedValueState=void 0;var Be=ro(),qT=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}},Qc;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Qc=Ae.UsedValueState||(Ae.UsedValueState={}));Ae.varKinds={const:new Be.Name("const"),let:new Be.Name("let"),var:new Be.Name("var")};var Jc=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Be.Name?e:this.name(e)}name(e){return new Be.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Ae.Scope=Jc;var Xc=class extends Be.Name{constructor(e,r){super(r);this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=Be._`.${new Be.Name(r)}[${n}]`}};Ae.ValueScopeName=Xc;var oO=Be._`\n`,NT=class extends Jc{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts=q(P({},e),{_n:e.lines?oO:Be.nil})}get(){return this._scope}name(e){return new Xc(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let a=this.toName(e),{prefix:s}=a,i=(n=r.key)!==null&&n!==void 0?n:r.ref,o=this._values[s];if(o){let l=o.get(i);if(l)return l}else o=this._values[s]=new Map;o.set(i,a);let f=this._scope[s]||(this._scope[s]=[]),u=f.length;return f[u]=r.ref,a.setValue(r,{property:s,itemIndex:u}),a}getValue(e,r){let n=this._values[e];if(!!n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return Be._`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,a=>{if(a.value===void 0)throw new Error(`CodeGen: name "${a}" has no value`);return a.value.code},r,n)}_reduceValues(e,r,n={},a){let s=Be.nil;for(let i in e){let o=e[i];if(!o)continue;let f=n[i]=n[i]||new Map;o.forEach(u=>{if(f.has(u))return;f.set(u,Qc.Started);let l=r(u);if(l){let _=this.opts.es5?Ae.varKinds.var:Ae.varKinds.const;s=Be._`${s}${_} ${u} = ${l};${this.opts._n}`}else if(l=a==null?void 0:a(u))s=Be._`${s}${l}${this.opts._n}`;else throw new qT(u);f.set(u,Qc.Completed)})}return s}};Ae.ValueScope=NT});var Q=C(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.or=V.and=V.not=V.CodeGen=V.operators=V.varKinds=V.ValueScopeName=V.ValueScope=V.Scope=V.Name=V.regexpCode=V.stringify=V.getProperty=V.nil=V.strConcat=V.str=V._=void 0;var X=ro(),at=Yc(),la=ro();Object.defineProperty(V,"_",{enumerable:!0,get:function(){return la._}});Object.defineProperty(V,"str",{enumerable:!0,get:function(){return la.str}});Object.defineProperty(V,"strConcat",{enumerable:!0,get:function(){return la.strConcat}});Object.defineProperty(V,"nil",{enumerable:!0,get:function(){return la.nil}});Object.defineProperty(V,"getProperty",{enumerable:!0,get:function(){return la.getProperty}});Object.defineProperty(V,"stringify",{enumerable:!0,get:function(){return la.stringify}});Object.defineProperty(V,"regexpCode",{enumerable:!0,get:function(){return la.regexpCode}});Object.defineProperty(V,"Name",{enumerable:!0,get:function(){return la.Name}});var Ed=Yc();Object.defineProperty(V,"Scope",{enumerable:!0,get:function(){return Ed.Scope}});Object.defineProperty(V,"ValueScope",{enumerable:!0,get:function(){return Ed.ValueScope}});Object.defineProperty(V,"ValueScopeName",{enumerable:!0,get:function(){return Ed.ValueScopeName}});Object.defineProperty(V,"varKinds",{enumerable:!0,get:function(){return Ed.varKinds}});V.operators={GT:new X._Code(">"),GTE:new X._Code(">="),LT:new X._Code("<"),LTE:new X._Code("<="),EQ:new X._Code("==="),NEQ:new X._Code("!=="),NOT:new X._Code("!"),OR:new X._Code("||"),AND:new X._Code("&&"),ADD:new X._Code("+")};var ca=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},BT=class extends ca{constructor(e,r,n){super();this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?at.varKinds.var:this.varKind,a=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${a};`+r}optimizeNames(e,r){if(!!e[this.name.str])return this.rhs&&(this.rhs=si(this.rhs,e,r)),this}get names(){return this.rhs instanceof X._CodeOrName?this.rhs.names:{}}},Zc=class extends ca{constructor(e,r,n){super();this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof X.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=si(this.rhs,e,r),this}get names(){let e=this.lhs instanceof X.Name?{}:P({},this.lhs.names);return Bd(e,this.rhs)}},LT=class extends Zc{constructor(e,r,n,a){super(e,n,a);this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},VT=class extends ca{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},HT=class extends ca{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},zT=class extends ca{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},KT=class extends ca{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=si(this.code,e,r),this}get names(){return this.code instanceof X._CodeOrName?this.code.names:{}}},Rd=class extends ca{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,a=n.length;for(;a--;){let s=n[a];s.optimizeNames(e,r)||(pO(e,s.names),n.splice(a,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>is(e,r.names),{})}},ma=class extends Rd{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},QT=class extends Rd{},no=class extends ma{};no.kind="else";var Ft=class extends ma{constructor(e,r){super(r);this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new no(n):n}if(r)return e===!1?r instanceof Ft?r:r.nodes:this.nodes.length?this:new Ft(ey(e),r instanceof Ft?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=si(this.condition,e,r),this}get names(){let e=super.names;return Bd(e,this.condition),this.else&&is(e,this.else.names),e}};Ft.kind="if";var ai=class extends ma{};ai.kind="for";var JT=class extends ai{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(!!super.optimizeNames(e,r))return this.iteration=si(this.iteration,e,r),this}get names(){return is(super.names,this.iteration.names)}},XT=class extends ai{constructor(e,r,n,a){super();this.varKind=e,this.name=r,this.from=n,this.to=a}render(e){let r=e.es5?at.varKinds.var:this.varKind,{name:n,from:a,to:s}=this;return`for(${r} ${n}=${a}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Bd(super.names,this.from);return Bd(e,this.to)}},em=class extends ai{constructor(e,r,n,a){super();this.loop=e,this.varKind=r,this.name=n,this.iterable=a}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(!!super.optimizeNames(e,r))return this.iterable=si(this.iterable,e,r),this}get names(){return is(super.names,this.iterable.names)}},Ad=class extends ma{constructor(e,r,n){super();this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Ad.kind="func";var Ud=class extends Rd{render(e){return"return "+super.render(e)}};Ud.kind="return";var YT=class extends ma{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,a;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(a=this.finally)===null||a===void 0||a.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&is(e,this.catch.names),this.finally&&is(e,this.finally.names),e}},qd=class extends ma{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};qd.kind="catch";var Nd=class extends ma{render(e){return"finally"+super.render(e)}};Nd.kind="finally";var ZT=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts=q(P({},r),{_n:r.lines?`
|
|
10
|
+
`:""}),this._extScope=e,this._scope=new at.Scope({parent:e}),this._nodes=[new QT]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,a){let s=this._scope.toName(r);return n!==void 0&&a&&(this._constants[s.str]=n),this._leafNode(new BT(e,s,n)),s}const(e,r,n){return this._def(at.varKinds.const,e,r,n)}let(e,r,n){return this._def(at.varKinds.let,e,r,n)}var(e,r,n){return this._def(at.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Zc(e,r,n))}add(e,r){return this._leafNode(new LT(e,V.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==X.nil&&this._leafNode(new KT(e)),this}object(...e){let r=["{"];for(let[n,a]of e)r.length>1&&r.push(","),r.push(n),(n!==a||this.opts.es5)&&(r.push(":"),X.addCodeArg(r,a));return r.push("}"),new X._Code(r)}if(e,r,n){if(this._blockNode(new Ft(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Ft(e))}else(){return this._elseNode(new no)}endIf(){return this._endBlockNode(Ft,no)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new JT(e),r)}forRange(e,r,n,a,s=this.opts.es5?at.varKinds.var:at.varKinds.let){let i=this._scope.toName(e);return this._for(new XT(s,i,r,n),()=>a(i))}forOf(e,r,n,a=at.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let i=r instanceof X.Name?r:this.var("_arr",r);return this.forRange("_i",0,X._`${i}.length`,o=>{this.var(s,X._`${i}[${o}]`),n(s)})}return this._for(new em("of",a,s,r),()=>n(s))}forIn(e,r,n,a=this.opts.es5?at.varKinds.var:at.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,X._`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new em("in",a,s,r),()=>n(s))}endFor(){return this._endBlockNode(ai)}label(e){return this._leafNode(new VT(e))}break(e){return this._leafNode(new HT(e))}return(e){let r=new Ud;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ud)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let a=new YT;if(this._blockNode(a),this.code(e),r){let s=this.name("e");this._currNode=a.catch=new qd(s),r(s)}return n&&(this._currNode=a.finally=new Nd,this.code(n)),this._endBlockNode(qd,Nd)}throw(e){return this._leafNode(new zT(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=X.nil,n,a){return this._blockNode(new Ad(e,r,n)),a&&this.code(a).endFunc(),this}endFunc(){return this._endBlockNode(Ad)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Ft))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};V.CodeGen=ZT;function is(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Bd(t,e){return e instanceof X._CodeOrName?is(t,e.names):t}function si(t,e,r){if(t instanceof X.Name)return n(t);if(!a(t))return t;return new X._Code(t._items.reduce((s,i)=>(i instanceof X.Name&&(i=n(i)),i instanceof X._Code?s.push(...i._items):s.push(i),s),[]));function n(s){let i=r[s.str];return i===void 0||e[s.str]!==1?s:(delete e[s.str],i)}function a(s){return s instanceof X._Code&&s._items.some(i=>i instanceof X.Name&&e[i.str]===1&&r[i.str]!==void 0)}}function pO(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function ey(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:X._`!${tm(t)}`}V.not=ey;var fO=ty(V.operators.AND);function uO(...t){return t.reduce(fO)}V.and=uO;var dO=ty(V.operators.OR);function lO(...t){return t.reduce(dO)}V.or=lO;function ty(t){return(e,r)=>e===X.nil?r:r===X.nil?e:X._`${tm(e)} ${t} ${tm(r)}`}function tm(t){return t instanceof X.Name?t:X._`(${t})`}});var ae=C(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.checkStrictMode=H.getErrorPath=H.Type=H.useFunc=H.setEvaluated=H.evaluatedPropsToName=H.mergeEvaluated=H.eachItem=H.unescapeJsonPointer=H.escapeJsonPointer=H.escapeFragment=H.unescapeFragment=H.schemaRefOrVal=H.schemaHasRulesButRef=H.schemaHasRules=H.checkUnknownRules=H.alwaysValidSchema=H.toHash=void 0;var le=Q(),cO=ro();function mO(t){let e={};for(let r of t)e[r]=!0;return e}H.toHash=mO;function hO(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(ry(t,e),!ny(e,t.self.RULES.all))}H.alwaysValidSchema=hO;function ry(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let a=n.RULES.keywords;for(let s in e)a[s]||fy(t,`unknown keyword: "${s}"`)}H.checkUnknownRules=ry;function ny(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}H.schemaHasRules=ny;function gO(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}H.schemaHasRulesButRef=gO;function _O({topSchemaRef:t,schemaPath:e},r,n,a){if(!a){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return le._`${r}`}return le._`${t}${e}${le.getProperty(n)}`}H.schemaRefOrVal=_O;function TO(t){return ay(decodeURIComponent(t))}H.unescapeFragment=TO;function yO(t){return encodeURIComponent(rm(t))}H.escapeFragment=yO;function rm(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}H.escapeJsonPointer=rm;function ay(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}H.unescapeJsonPointer=ay;function bO(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}H.eachItem=bO;function sy({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(a,s,i,o)=>{let f=i===void 0?s:i instanceof le.Name?(s instanceof le.Name?t(a,s,i):e(a,s,i),i):s instanceof le.Name?(e(a,i,s),s):r(s,i);return o===le.Name&&!(f instanceof le.Name)?n(a,f):f}}H.mergeEvaluated={props:sy({mergeNames:(t,e,r)=>t.if(le._`${r} !== true && ${e} !== undefined`,()=>{t.if(le._`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,le._`${r} || {}`).code(le._`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if(le._`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,le._`${r} || {}`),nm(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:P(P({},t),e),resultToName:iy}),items:sy({mergeNames:(t,e,r)=>t.if(le._`${r} !== true && ${e} !== undefined`,()=>t.assign(r,le._`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if(le._`${r} !== true`,()=>t.assign(r,e===!0?!0:le._`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function iy(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",le._`{}`);return e!==void 0&&nm(t,r,e),r}H.evaluatedPropsToName=iy;function nm(t,e,r){Object.keys(r).forEach(n=>t.assign(le._`${e}${le.getProperty(n)}`,!0))}H.setEvaluated=nm;var oy={};function xO(t,e){return t.scopeValue("func",{ref:e,code:oy[e.code]||(oy[e.code]=new cO._Code(e.code))})}H.useFunc=xO;var py;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(py=H.Type||(H.Type={}));function FO(t,e,r){if(t instanceof le.Name){let n=e===py.Num;return r?n?le._`"[" + ${t} + "]"`:le._`"['" + ${t} + "']"`:n?le._`"/" + ${t}`:le._`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?le.getProperty(t).toString():"/"+rm(t)}H.getErrorPath=FO;function fy(t,e,r=t.opts.strictSchema){if(!!r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}H.checkStrictMode=fy});var Kr=C(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});var Me=Q(),wO={data:new Me.Name("data"),valCxt:new Me.Name("valCxt"),instancePath:new Me.Name("instancePath"),parentData:new Me.Name("parentData"),parentDataProperty:new Me.Name("parentDataProperty"),rootData:new Me.Name("rootData"),dynamicAnchors:new Me.Name("dynamicAnchors"),vErrors:new Me.Name("vErrors"),errors:new Me.Name("errors"),this:new Me.Name("this"),self:new Me.Name("self"),scope:new Me.Name("scope"),json:new Me.Name("json"),jsonPos:new Me.Name("jsonPos"),jsonLen:new Me.Name("jsonLen"),jsonPart:new Me.Name("jsonPart")};am.default=wO});var ao=C(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.extendErrors=We.resetErrorsCount=We.reportExtraError=We.reportError=We.keyword$DataError=We.keywordError=void 0;var ee=Q(),Ld=ae(),Ue=Kr();We.keywordError={message:({keyword:t})=>ee.str`should pass "${t}" keyword validation`};We.keyword$DataError={message:({keyword:t,schemaType:e})=>e?ee.str`"${t}" keyword must be ${e} ($data)`:ee.str`"${t}" keyword is invalid ($data)`};function $O(t,e=We.keywordError,r,n){let{it:a}=t,{gen:s,compositeRule:i,allErrors:o}=a,f=ly(t,e,r);(n!=null?n:i||o)?uy(s,f):dy(a,ee._`[${f}]`)}We.reportError=$O;function OO(t,e=We.keywordError,r){let{it:n}=t,{gen:a,compositeRule:s,allErrors:i}=n,o=ly(t,e,r);uy(a,o),s||i||dy(n,Ue.default.vErrors)}We.reportExtraError=OO;function vO(t,e){t.assign(Ue.default.errors,e),t.if(ee._`${Ue.default.vErrors} !== null`,()=>t.if(e,()=>t.assign(ee._`${Ue.default.vErrors}.length`,e),()=>t.assign(Ue.default.vErrors,null)))}We.resetErrorsCount=vO;function jO({gen:t,keyword:e,schemaValue:r,data:n,errsCount:a,it:s}){if(a===void 0)throw new Error("ajv implementation error");let i=t.name("err");t.forRange("i",a,Ue.default.errors,o=>{t.const(i,ee._`${Ue.default.vErrors}[${o}]`),t.if(ee._`${i}.instancePath === undefined`,()=>t.assign(ee._`${i}.instancePath`,ee.strConcat(Ue.default.instancePath,s.errorPath))),t.assign(ee._`${i}.schemaPath`,ee.str`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign(ee._`${i}.schema`,r),t.assign(ee._`${i}.data`,n))})}We.extendErrors=jO;function uy(t,e){let r=t.const("err",e);t.if(ee._`${Ue.default.vErrors} === null`,()=>t.assign(Ue.default.vErrors,ee._`[${r}]`),ee._`${Ue.default.vErrors}.push(${r})`),t.code(ee._`${Ue.default.errors}++`)}function dy(t,e){let{gen:r,validateName:n,schemaEnv:a}=t;a.$async?r.throw(ee._`new ${t.ValidationError}(${e})`):(r.assign(ee._`${n}.errors`,e),r.return(!1))}var os={keyword:new ee.Name("keyword"),schemaPath:new ee.Name("schemaPath"),params:new ee.Name("params"),propertyName:new ee.Name("propertyName"),message:new ee.Name("message"),schema:new ee.Name("schema"),parentSchema:new ee.Name("parentSchema")};function ly(t,e,r){let{createErrors:n}=t.it;return n===!1?ee._`{}`:IO(t,e,r)}function IO(t,e,r={}){let{gen:n,it:a}=t,s=[kO(a,r),SO(t,r)];return CO(t,e,s),n.object(...s)}function kO({errorPath:t},{instancePath:e}){let r=e?ee.str`${t}${Ld.getErrorPath(e,Ld.Type.Str)}`:t;return[Ue.default.instancePath,ee.strConcat(Ue.default.instancePath,r)]}function SO({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let a=n?e:ee.str`${e}/${t}`;return r&&(a=ee.str`${a}${Ld.getErrorPath(r,Ld.Type.Str)}`),[os.schemaPath,a]}function CO(t,{params:e,message:r},n){let{keyword:a,data:s,schemaValue:i,it:o}=t,{opts:f,propertyName:u,topSchemaRef:l,schemaPath:_}=o;n.push([os.keyword,a],[os.params,typeof e=="function"?e(t):e||ee._`{}`]),f.messages&&n.push([os.message,typeof r=="function"?r(t):r]),f.verbose&&n.push([os.schema,i],[os.parentSchema,ee._`${l}${_}`],[Ue.default.data,s]),u&&n.push([os.propertyName,u])}});var my=C(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.boolOrEmptySchema=ii.topBoolOrEmptySchema=void 0;var PO=ao(),GO=Q(),DO=Kr(),MO={message:"boolean schema is false"};function WO(t){let{gen:e,schema:r,validateName:n}=t;r===!1?cy(t,!1):typeof r=="object"&&r.$async===!0?e.return(DO.default.data):(e.assign(GO._`${n}.errors`,null),e.return(!0))}ii.topBoolOrEmptySchema=WO;function EO(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),cy(t)):r.var(e,!0)}ii.boolOrEmptySchema=EO;function cy(t,e){let{gen:r,data:n}=t,a={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};PO.reportError(a,MO,void 0,e)}});var sm=C(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.getRules=oi.isJSONType=void 0;var RO=["string","number","integer","boolean","null","object","array"],AO=new Set(RO);function UO(t){return typeof t=="string"&&AO.has(t)}oi.isJSONType=UO;function qO(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:q(P({},t),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}oi.getRules=qO});var im=C(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.shouldUseRule=ha.shouldUseGroup=ha.schemaHasRulesForType=void 0;function NO({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&hy(t,n)}ha.schemaHasRulesForType=NO;function hy(t,e){return e.rules.some(r=>gy(t,r))}ha.shouldUseGroup=hy;function gy(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}ha.shouldUseRule=gy});var io=C(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.reportTypeError=Se.checkDataTypes=Se.checkDataType=Se.coerceAndCheckDataType=Se.getJSONTypes=Se.getSchemaTypes=Se.DataType=void 0;var BO=sm(),LO=im(),VO=ao(),L=Q(),_y=ae(),so;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(so=Se.DataType||(Se.DataType={}));function HO(t){let e=Ty(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}Se.getSchemaTypes=HO;function Ty(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(BO.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Se.getJSONTypes=Ty;function zO(t,e){let{gen:r,data:n,opts:a}=t,s=KO(e,a.coerceTypes),i=e.length>0&&!(s.length===0&&e.length===1&&LO.schemaHasRulesForType(t,e[0]));if(i){let o=pm(e,n,a.strictNumbers,so.Wrong);r.if(o,()=>{s.length?QO(t,e,s):fm(t)})}return i}Se.coerceAndCheckDataType=zO;var yy=new Set(["string","number","integer","boolean","null"]);function KO(t,e){return e?t.filter(r=>yy.has(r)||e==="array"&&r==="array"):[]}function QO(t,e,r){let{gen:n,data:a,opts:s}=t,i=n.let("dataType",L._`typeof ${a}`),o=n.let("coerced",L._`undefined`);s.coerceTypes==="array"&&n.if(L._`${i} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>n.assign(a,L._`${a}[0]`).assign(i,L._`typeof ${a}`).if(pm(e,a,s.strictNumbers),()=>n.assign(o,a))),n.if(L._`${o} !== undefined`);for(let u of r)(yy.has(u)||u==="array"&&s.coerceTypes==="array")&&f(u);n.else(),fm(t),n.endIf(),n.if(L._`${o} !== undefined`,()=>{n.assign(a,o),JO(t,o)});function f(u){switch(u){case"string":n.elseIf(L._`${i} == "number" || ${i} == "boolean"`).assign(o,L._`"" + ${a}`).elseIf(L._`${a} === null`).assign(o,L._`""`);return;case"number":n.elseIf(L._`${i} == "boolean" || ${a} === null
|
|
11
11
|
|| (${i} == "string" && ${a} && ${a} == +${a})`).assign(o,L._`+${a}`);return;case"integer":n.elseIf(L._`${i} === "boolean" || ${a} === null
|
|
12
12
|
|| (${i} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(o,L._`+${a}`);return;case"boolean":n.elseIf(L._`${a} === "false" || ${a} === 0 || ${a} === null`).assign(o,!1).elseIf(L._`${a} === "true" || ${a} === 1`).assign(o,!0);return;case"null":n.elseIf(L._`${a} === "" || ${a} === 0 || ${a} === false`),n.assign(o,null);return;case"array":n.elseIf(L._`${i} === "string" || ${i} === "number"
|
|
13
|
-
|| ${i} === "boolean" || ${a} === null`).assign(o,L._`[${a}]`)}}}function JO({gen:t,parentData:e,parentDataProperty:r},n){t.if(L._`${e} !== undefined`,()=>t.assign(L._`${e}[${r}]`,n))}function om(t,e,r,n=so.Correct){let a=n===so.Correct?L.operators.EQ:L.operators.NEQ,s;switch(t){case"null":return L._`${e} ${a} null`;case"array":s=L._`Array.isArray(${e})`;break;case"object":s=L._`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=i(L._`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=i();break;default:return L._`typeof ${e} ${a} ${t}`}return n===so.Correct?s:L.not(s);function i(o=L.nil){return L.and(L._`typeof ${e} == "number"`,o,r?L._`isFinite(${e})`:L.nil)}}Se.checkDataType=om;function pm(t,e,r,n){if(t.length===1)return om(t[0],e,r,n);let a,s=_y.toHash(t);if(s.array&&s.object){let i=L._`typeof ${e} != "object"`;a=s.null?i:L._`!${e} || ${i}`,delete s.null,delete s.array,delete s.object}else a=L.nil;s.number&&delete s.integer;for(let i in s)a=L.and(a,om(i,e,r,n));return a}Se.checkDataTypes=pm;var XO={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?L._`{type: ${t}}`:L._`{type: ${e}}`};function fm(t){let e=YO(t);VO.reportError(e,XO)}Se.reportTypeError=fm;function YO(t){let{gen:e,data:r,schema:n}=t,a=_y.schemaRefOrVal(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:a,schemaValue:a,parentSchema:n,params:{},it:t}}});var xy=C(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.assignDefaults=void 0;var pi=Q(),ZO=ae();function ev(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let a in r)by(t,a,r[a].default);else e==="array"&&Array.isArray(n)&&n.forEach((a,s)=>by(t,s,a.default))}Vd.assignDefaults=ev;function by(t,e,r){let{gen:n,compositeRule:a,data:s,opts:i}=t;if(r===void 0)return;let o=pi._`${s}${pi.getProperty(e)}`;if(a){ZO.checkStrictMode(t,`default is ignored for: ${o}`);return}let f=pi._`${o} === undefined`;i.useDefaults==="empty"&&(f=pi._`${f} || ${o} === null || ${o} === ""`),n.if(f,pi._`${o} = ${pi.stringify(r)}`)}});var et=C(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.validateUnion=fe.validateArray=fe.usePattern=fe.callValidateCode=fe.schemaProperties=fe.allSchemaProperties=fe.noPropertyInData=fe.propertyInData=fe.isOwnProperty=fe.hasPropFunc=fe.reportMissingProp=fe.checkMissingProp=fe.checkReportMissingProp=void 0;var ge=Q(),um=ae(),ha=Kr();function tv(t,e){let{gen:r,data:n,it:a}=t;r.if(lm(r,n,e,a.opts.ownProperties),()=>{t.setParams({missingProperty:ge._`${e}`},!0),t.error()})}fe.checkReportMissingProp=tv;function rv({gen:t,data:e,it:{opts:r}},n,a){return ge.or(...n.map(s=>ge.and(lm(t,e,s,r.ownProperties),ge._`${a} = ${s}`)))}fe.checkMissingProp=rv;function nv(t,e){t.setParams({missingProperty:e},!0),t.error()}fe.reportMissingProp=nv;function Fy(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:ge._`Object.prototype.hasOwnProperty`})}fe.hasPropFunc=Fy;function dm(t,e,r){return ge._`${Fy(t)}.call(${e}, ${r})`}fe.isOwnProperty=dm;function av(t,e,r,n){let a=ge._`${e}${ge.getProperty(r)} !== undefined`;return n?ge._`${a} && ${dm(t,e,r)}`:a}fe.propertyInData=av;function lm(t,e,r,n){let a=ge._`${e}${ge.getProperty(r)} === undefined`;return n?ge.or(a,ge.not(dm(t,e,r))):a}fe.noPropertyInData=lm;function wy(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}fe.allSchemaProperties=wy;function sv(t,e){return wy(e).filter(r=>!um.alwaysValidSchema(t,e[r]))}fe.schemaProperties=sv;function iv({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:a,errorPath:s},it:i},o,f,u){let l=u?ge._`${t}, ${e}, ${n}${a}`:e,_=[[ha.default.instancePath,ge.strConcat(ha.default.instancePath,s)],[ha.default.parentData,i.parentData],[ha.default.parentDataProperty,i.parentDataProperty],[ha.default.rootData,ha.default.rootData]];i.opts.dynamicRef&&_.push([ha.default.dynamicAnchors,ha.default.dynamicAnchors]);let b=ge._`${l}, ${r.object(..._)}`;return f!==ge.nil?ge._`${o}.call(${f}, ${b})`:ge._`${o}(${b})`}fe.callValidateCode=iv;function ov({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"";return t.scopeValue("pattern",{key:r,ref:new RegExp(r,n),code:ge._`new RegExp(${r}, ${n})`})}fe.usePattern=ov;function pv(t){let{gen:e,data:r,keyword:n,it:a}=t,s=e.name("valid");if(a.allErrors){let o=e.let("valid",!0);return i(()=>e.assign(o,!1)),o}return e.var(s,!0),i(()=>e.break()),s;function i(o){let f=e.const("len",ge._`${r}.length`);e.forRange("i",0,f,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:um.Type.Num},s),e.if(ge.not(s),o)})}}fe.validateArray=pv;function fv(t){let{gen:e,schema:r,keyword:n,it:a}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(f=>um.alwaysValidSchema(a,f))&&!a.opts.unevaluated)return;let i=e.let("valid",!1),o=e.name("_valid");e.block(()=>r.forEach((f,u)=>{let l=t.subschema({keyword:n,schemaProp:u,compositeRule:!0},o);e.assign(i,ge._`${i} || ${o}`),t.mergeValidEvaluated(l,o)||e.if(ge.not(i))})),t.result(i,()=>t.reset(),()=>t.error(!0))}fe.validateUnion=fv});var vy=C(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.validateKeywordUsage=wt.validSchemaType=wt.funcKeywordCode=wt.macroKeywordCode=void 0;var qe=Q(),ps=Kr(),uv=et(),dv=ao();function lv(t,e){let{gen:r,keyword:n,schema:a,parentSchema:s,it:i}=t,o=e.macro.call(i.self,a,s,i),f=Oy(r,n,o);i.opts.validateSchema!==!1&&i.self.validateSchema(o,!0);let u=r.name("valid");t.subschema({schema:o,schemaPath:qe.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}wt.macroKeywordCode=lv;function cv(t,e){var r;let{gen:n,keyword:a,schema:s,parentSchema:i,$data:o,it:f}=t;hv(f,e);let u=!o&&e.compile?e.compile.call(f.self,s,i,f):e.validate,l=Oy(n,a,u),_=n.let("valid");t.block$data(_,b),t.ok((r=e.valid)!==null&&r!==void 0?r:_);function b(){if(e.errors===!1)j(),e.modifying&&$y(t),I(()=>t.error());else{let k=e.async?w():y();e.modifying&&$y(t),I(()=>mv(t,k))}}function w(){let k=n.let("ruleErrs",null);return n.try(()=>j(qe._`await `),A=>n.assign(_,!1).if(qe._`${A} instanceof ${f.ValidationError}`,()=>n.assign(k,qe._`${A}.errors`),()=>n.throw(A))),k}function y(){let k=qe._`${l}.errors`;return n.assign(k,null),j(qe.nil),k}function j(k=e.async?qe._`await `:qe.nil){let A=f.opts.passContext?ps.default.this:ps.default.self,ce=!("compile"in e&&!o||e.schema===!1);n.assign(_,qe._`${k}${uv.callValidateCode(t,l,A,ce)}`,e.modifying)}function I(k){var A;n.if(qe.not((A=e.valid)!==null&&A!==void 0?A:_),k)}}wt.funcKeywordCode=cv;function $y(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,qe._`${n.parentData}[${n.parentDataProperty}]`))}function mv(t,e){let{gen:r}=t;r.if(qe._`Array.isArray(${e})`,()=>{r.assign(ps.default.vErrors,qe._`${ps.default.vErrors} === null ? ${e} : ${ps.default.vErrors}.concat(${e})`).assign(ps.default.errors,qe._`${ps.default.vErrors}.length`),dv.extendErrors(t)},()=>t.error())}function hv({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Oy(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:qe.stringify(r)})}function gv(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t=="undefined")}wt.validSchemaType=gv;function _v({schema:t,opts:e,self:r,errSchemaPath:n},a,s){if(Array.isArray(a.keyword)?!a.keyword.includes(s):a.keyword!==s)throw new Error("ajv implementation error");let i=a.dependencies;if(i==null?void 0:i.some(o=>!Object.prototype.hasOwnProperty.call(t,o)))throw new Error(`parent schema must have dependencies of ${s}: ${i.join(",")}`);if(a.validateSchema&&!a.validateSchema(t[s])){let f=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(a.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(f);else throw new Error(f)}}wt.validateKeywordUsage=_v});var Iy=C(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});ga.extendSubschemaMode=ga.extendSubschemaData=ga.getSubschema=void 0;var $t=Q(),jy=ae();function Tv(t,{keyword:e,schemaProp:r,schema:n,schemaPath:a,errSchemaPath:s,topSchemaRef:i}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let o=t.schema[e];return r===void 0?{schema:o,schemaPath:$t._`${t.schemaPath}${$t.getProperty(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:o[r],schemaPath:$t._`${t.schemaPath}${$t.getProperty(e)}${$t.getProperty(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${jy.escapeFragment(r)}`}}if(n!==void 0){if(a===void 0||s===void 0||i===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:a,topSchemaRef:i,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}ga.getSubschema=Tv;function yv(t,e,{dataProp:r,dataPropType:n,data:a,dataTypes:s,propertyName:i}){if(a!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:o}=e;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:_}=e,b=o.let("data",$t._`${e.data}${$t.getProperty(r)}`,!0);f(b),t.errorPath=$t.str`${u}${jy.getErrorPath(r,n,_.jsPropertySyntax)}`,t.parentDataProperty=$t._`${r}`,t.dataPathArr=[...l,t.parentDataProperty]}if(a!==void 0){let u=a instanceof $t.Name?a:o.let("data",a,!0);f(u),i!==void 0&&(t.propertyName=i)}s&&(t.dataTypes=s);function f(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}ga.extendSubschemaData=yv;function bv(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:a,allErrors:s}){n!==void 0&&(t.compositeRule=n),a!==void 0&&(t.createErrors=a),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}ga.extendSubschemaMode=bv});var cm=C((K9,ky)=>{"use strict";ky.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,a,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(a=n;a--!=0;)if(!t(e[a],r[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(a=n;a--!=0;)if(!Object.prototype.hasOwnProperty.call(r,s[a]))return!1;for(a=n;a--!=0;){var i=s[a];if(!t(e[i],r[i]))return!1}return!0}return e!==e&&r!==r}});var Cy=C((Q9,Sy)=>{"use strict";var _a=Sy.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},a=r.post||function(){};Hd(e,n,a,t,"",t)};_a.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};_a.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};_a.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};_a.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Hd(t,e,r,n,a,s,i,o,f,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,a,s,i,o,f,u);for(var l in n){var _=n[l];if(Array.isArray(_)){if(l in _a.arrayKeywords)for(var b=0;b<_.length;b++)Hd(t,e,r,_[b],a+"/"+l+"/"+b,s,a,l,n,b)}else if(l in _a.propsKeywords){if(_&&typeof _=="object")for(var w in _)Hd(t,e,r,_[w],a+"/"+l+"/"+xv(w),s,a,l,n,w)}else(l in _a.keywords||t.allKeys&&!(l in _a.skipKeywords))&&Hd(t,e,r,_,a+"/"+l,s,a,l,n)}r(n,a,s,i,o,f,u)}}function xv(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var mm=C((zd,Py)=>{(function(t,e){typeof zd=="object"&&typeof Py!="undefined"?e(zd):typeof define=="function"&&define.amd?define(["exports"],e):e(t.URI=t.URI||{})})(zd,function(t){"use strict";function e(){for(var c=arguments.length,d=Array(c),T=0;T<c;T++)d[T]=arguments[T];if(d.length>1){d[0]=d[0].slice(0,-1);for(var $=d.length-1,O=1;O<$;++O)d[O]=d[O].slice(1,-1);return d[$]=d[$].slice(1),d.join("")}else return d[0]}function r(c){return"(?:"+c+")"}function n(c){return c===void 0?"undefined":c===null?"null":Object.prototype.toString.call(c).split(" ").pop().split("]").shift().toLowerCase()}function a(c){return c.toUpperCase()}function s(c){return c!=null?c instanceof Array?c:typeof c.length!="number"||c.split||c.setInterval||c.call?[c]:Array.prototype.slice.call(c):[]}function i(c,d){var T=c;if(d)for(var $ in d)T[$]=d[$];return T}function o(c){var d="[A-Za-z]",T="[\\x0D]",$="[0-9]",O="[\\x22]",W=e($,"[A-Fa-f]"),B="[\\x0A]",te="[\\x20]",se=r(r("%[EFef]"+W+"%"+W+W+"%"+W+W)+"|"+r("%[89A-Fa-f]"+W+"%"+W+W)+"|"+r("%"+W+W)),we="[\\:\\/\\?\\#\\[\\]\\@]",Z="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",_e=e(we,Z),$e=c?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",he=c?"[\\uE000-\\uF8FF]":"[]",ne=e(d,$,"[\\-\\.\\_\\~]",$e),Te=r(d+e(d,$,"[\\+\\-\\.]")+"*"),oe=r(r(se+"|"+e(ne,Z,"[\\:]"))+"*"),Xa=r(r("25[0-5]")+"|"+r("2[0-4]"+$)+"|"+r("1"+$+$)+"|"+r("[1-9]"+$)+"|"+$),He=r(r("25[0-5]")+"|"+r("2[0-4]"+$)+"|"+r("1"+$+$)+"|"+r("0?[1-9]"+$)+"|0?0?"+$),Xe=r(He+"\\."+He+"\\."+He+"\\."+He),ue=r(W+"{1,4}"),ze=r(r(ue+"\\:"+ue)+"|"+Xe),Ye=r(r(ue+"\\:")+"{6}"+ze),_t=r("\\:\\:"+r(ue+"\\:")+"{5}"+ze),Ya=r(r(ue)+"?\\:\\:"+r(ue+"\\:")+"{4}"+ze),Er=r(r(r(ue+"\\:")+"{0,1}"+ue)+"?\\:\\:"+r(ue+"\\:")+"{3}"+ze),Ri=r(r(r(ue+"\\:")+"{0,2}"+ue)+"?\\:\\:"+r(ue+"\\:")+"{2}"+ze),id=r(r(r(ue+"\\:")+"{0,3}"+ue)+"?\\:\\:"+ue+"\\:"+ze),od=r(r(r(ue+"\\:")+"{0,4}"+ue)+"?\\:\\:"+ze),Js=r(r(r(ue+"\\:")+"{0,5}"+ue)+"?\\:\\:"+ue),Xs=r(r(r(ue+"\\:")+"{0,6}"+ue)+"?\\:\\:"),Rr=r([Ye,_t,Ya,Er,Ri,id,od,Js,Xs].join("|")),Ys=r(r(ne+"|"+se)+"+"),ic=r(Rr+"\\%25"+Ys),Za=r(Rr+r("\\%25|\\%(?!"+W+"{2})")+Ys),mF=r("[vV]"+W+"+\\."+e(ne,Z,"[\\:]")+"+"),hF=r("\\["+r(Za+"|"+Rr+"|"+mF)+"\\]"),Gg=r(r(se+"|"+e(ne,Z))+"*"),Ai=r(hF+"|"+Xe+"(?!"+Gg+")|"+Gg),Ui=r($+"*"),Dg=r(r(oe+"@")+"?"+Ai+r("\\:"+Ui)+"?"),qi=r(se+"|"+e(ne,Z,"[\\:\\@]")),gF=r(qi+"*"),Mg=r(qi+"+"),_F=r(r(se+"|"+e(ne,Z,"[\\@]"))+"+"),Ar=r(r("\\/"+gF)+"*"),Zs=r("\\/"+r(Mg+Ar)+"?"),oc=r(_F+Ar),pd=r(Mg+Ar),ei="(?!"+qi+")",b4=r(Ar+"|"+Zs+"|"+oc+"|"+pd+"|"+ei),ti=r(r(qi+"|"+e("[\\/\\?]",he))+"*"),Ni=r(r(qi+"|[\\/\\?]")+"*"),Wg=r(r("\\/\\/"+Dg+Ar)+"|"+Zs+"|"+pd+"|"+ei),TF=r(Te+"\\:"+Wg+r("\\?"+ti)+"?"+r("\\#"+Ni)+"?"),yF=r(r("\\/\\/"+Dg+Ar)+"|"+Zs+"|"+oc+"|"+ei),bF=r(yF+r("\\?"+ti)+"?"+r("\\#"+Ni)+"?"),x4=r(TF+"|"+bF),F4=r(Te+"\\:"+Wg+r("\\?"+ti)+"?"),w4="^("+Te+")\\:"+r(r("\\/\\/("+r("("+oe+")@")+"?("+Ai+")"+r("\\:("+Ui+")")+"?)")+"?("+Ar+"|"+Zs+"|"+pd+"|"+ei+")")+r("\\?("+ti+")")+"?"+r("\\#("+Ni+")")+"?$",$4="^(){0}"+r(r("\\/\\/("+r("("+oe+")@")+"?("+Ai+")"+r("\\:("+Ui+")")+"?)")+"?("+Ar+"|"+Zs+"|"+oc+"|"+ei+")")+r("\\?("+ti+")")+"?"+r("\\#("+Ni+")")+"?$",O4="^("+Te+")\\:"+r(r("\\/\\/("+r("("+oe+")@")+"?("+Ai+")"+r("\\:("+Ui+")")+"?)")+"?("+Ar+"|"+Zs+"|"+pd+"|"+ei+")")+r("\\?("+ti+")")+"?$",v4="^"+r("\\#("+Ni+")")+"?$",j4="^"+r("("+oe+")@")+"?("+Ai+")"+r("\\:("+Ui+")")+"?$";return{NOT_SCHEME:new RegExp(e("[^]",d,$,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(e("[^\\%\\:]",ne,Z),"g"),NOT_HOST:new RegExp(e("[^\\%\\[\\]\\:]",ne,Z),"g"),NOT_PATH:new RegExp(e("[^\\%\\/\\:\\@]",ne,Z),"g"),NOT_PATH_NOSCHEME:new RegExp(e("[^\\%\\/\\@]",ne,Z),"g"),NOT_QUERY:new RegExp(e("[^\\%]",ne,Z,"[\\:\\@\\/\\?]",he),"g"),NOT_FRAGMENT:new RegExp(e("[^\\%]",ne,Z,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(e("[^]",ne,Z),"g"),UNRESERVED:new RegExp(ne,"g"),OTHER_CHARS:new RegExp(e("[^\\%]",ne,_e),"g"),PCT_ENCODED:new RegExp(se,"g"),IPV4ADDRESS:new RegExp("^("+Xe+")$"),IPV6ADDRESS:new RegExp("^\\[?("+Rr+")"+r(r("\\%25|\\%(?!"+W+"{2})")+"("+Ys+")")+"?\\]?$")}}var f=o(!1),u=o(!0),l=function(){function c(d,T){var $=[],O=!0,W=!1,B=void 0;try{for(var te=d[Symbol.iterator](),se;!(O=(se=te.next()).done)&&($.push(se.value),!(T&&$.length===T));O=!0);}catch(we){W=!0,B=we}finally{try{!O&&te.return&&te.return()}finally{if(W)throw B}}return $}return function(d,T){if(Array.isArray(d))return d;if(Symbol.iterator in Object(d))return c(d,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=function(c){if(Array.isArray(c)){for(var d=0,T=Array(c.length);d<c.length;d++)T[d]=c[d];return T}else return Array.from(c)},b=2147483647,w=36,y=1,j=26,I=38,k=700,A=72,ce=128,Y="-",z=/^xn--/,be=/[^\0-\x7E]/,Ge=/[\x2E\u3002\uFF0E\uFF61]/g,Qa={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Vs=w-y,ct=Math.floor,tc=String.fromCharCode;function Ja(c){throw new RangeError(Qa[c])}function Lx(c,d){for(var T=[],$=c.length;$--;)T[$]=d(c[$]);return T}function gg(c,d){var T=c.split("@"),$="";T.length>1&&($=T[0]+"@",c=T[1]),c=c.replace(Ge,".");var O=c.split("."),W=Lx(O,d).join(".");return $+W}function _g(c){for(var d=[],T=0,$=c.length;T<$;){var O=c.charCodeAt(T++);if(O>=55296&&O<=56319&&T<$){var W=c.charCodeAt(T++);(W&64512)==56320?d.push(((O&1023)<<10)+(W&1023)+65536):(d.push(O),T--)}else d.push(O)}return d}var Vx=function(d){return String.fromCodePoint.apply(String,_(d))},Hx=function(d){return d-48<10?d-22:d-65<26?d-65:d-97<26?d-97:w},Tg=function(d,T){return d+22+75*(d<26)-((T!=0)<<5)},D=function(d,T,$){var O=0;for(d=$?ct(d/k):d>>1,d+=ct(d/T);d>Vs*j>>1;O+=w)d=ct(d/Vs);return ct(O+(Vs+1)*d/(d+I))},yg=function(d){var T=[],$=d.length,O=0,W=ce,B=A,te=d.lastIndexOf(Y);te<0&&(te=0);for(var se=0;se<te;++se)d.charCodeAt(se)>=128&&Ja("not-basic"),T.push(d.charCodeAt(se));for(var we=te>0?te+1:0;we<$;){for(var Z=O,_e=1,$e=w;;$e+=w){we>=$&&Ja("invalid-input");var he=Hx(d.charCodeAt(we++));(he>=w||he>ct((b-O)/_e))&&Ja("overflow"),O+=he*_e;var ne=$e<=B?y:$e>=B+j?j:$e-B;if(he<ne)break;var Te=w-ne;_e>ct(b/Te)&&Ja("overflow"),_e*=Te}var oe=T.length+1;B=D(O-Z,oe,Z==0),ct(O/oe)>b-W&&Ja("overflow"),W+=ct(O/oe),O%=oe,T.splice(O++,0,W)}return String.fromCodePoint.apply(String,T)},bg=function(d){var T=[];d=_g(d);var $=d.length,O=ce,W=0,B=A,te=!0,se=!1,we=void 0;try{for(var Z=d[Symbol.iterator](),_e;!(te=(_e=Z.next()).done);te=!0){var $e=_e.value;$e<128&&T.push(tc($e))}}catch(Za){se=!0,we=Za}finally{try{!te&&Z.return&&Z.return()}finally{if(se)throw we}}var he=T.length,ne=he;for(he&&T.push(Y);ne<$;){var Te=b,oe=!0,Xa=!1,He=void 0;try{for(var Xe=d[Symbol.iterator](),ue;!(oe=(ue=Xe.next()).done);oe=!0){var ze=ue.value;ze>=O&&ze<Te&&(Te=ze)}}catch(Za){Xa=!0,He=Za}finally{try{!oe&&Xe.return&&Xe.return()}finally{if(Xa)throw He}}var Ye=ne+1;Te-O>ct((b-W)/Ye)&&Ja("overflow"),W+=(Te-O)*Ye,O=Te;var _t=!0,Ya=!1,Er=void 0;try{for(var Ri=d[Symbol.iterator](),id;!(_t=(id=Ri.next()).done);_t=!0){var od=id.value;if(od<O&&++W>b&&Ja("overflow"),od==O){for(var Js=W,Xs=w;;Xs+=w){var Rr=Xs<=B?y:Xs>=B+j?j:Xs-B;if(Js<Rr)break;var Ys=Js-Rr,ic=w-Rr;T.push(tc(Tg(Rr+Ys%ic,0))),Js=ct(Ys/ic)}T.push(tc(Tg(Js,0))),B=D(W,Ye,ne==he),W=0,++ne}}}catch(Za){Ya=!0,Er=Za}finally{try{!_t&&Ri.return&&Ri.return()}finally{if(Ya)throw Er}}++W,++O}return T.join("")},zx=function(d){return gg(d,function(T){return z.test(T)?yg(T.slice(4).toLowerCase()):T})},Kx=function(d){return gg(d,function(T){return be.test(T)?"xn--"+bg(T):T})},Hs={version:"2.1.0",ucs2:{decode:_g,encode:Vx},decode:yg,encode:bg,toASCII:Kx,toUnicode:zx},Je={};function mt(c){var d=c.charCodeAt(0),T=void 0;return d<16?T="%0"+d.toString(16).toUpperCase():d<128?T="%"+d.toString(16).toUpperCase():d<2048?T="%"+(d>>6|192).toString(16).toUpperCase()+"%"+(d&63|128).toString(16).toUpperCase():T="%"+(d>>12|224).toString(16).toUpperCase()+"%"+(d>>6&63|128).toString(16).toUpperCase()+"%"+(d&63|128).toString(16).toUpperCase(),T}function zs(c){for(var d="",T=0,$=c.length;T<$;){var O=parseInt(c.substr(T+1,2),16);if(O<128)d+=String.fromCharCode(O),T+=3;else if(O>=194&&O<224){if($-T>=6){var W=parseInt(c.substr(T+4,2),16);d+=String.fromCharCode((O&31)<<6|W&63)}else d+=c.substr(T,6);T+=6}else if(O>=224){if($-T>=9){var B=parseInt(c.substr(T+4,2),16),te=parseInt(c.substr(T+7,2),16);d+=String.fromCharCode((O&15)<<12|(B&63)<<6|te&63)}else d+=c.substr(T,9);T+=9}else d+=c.substr(T,3),T+=3}return d}function rc(c,d){function T($){var O=zs($);return O.match(d.UNRESERVED)?O:$}return c.scheme&&(c.scheme=String(c.scheme).replace(d.PCT_ENCODED,T).toLowerCase().replace(d.NOT_SCHEME,"")),c.userinfo!==void 0&&(c.userinfo=String(c.userinfo).replace(d.PCT_ENCODED,T).replace(d.NOT_USERINFO,mt).replace(d.PCT_ENCODED,a)),c.host!==void 0&&(c.host=String(c.host).replace(d.PCT_ENCODED,T).toLowerCase().replace(d.NOT_HOST,mt).replace(d.PCT_ENCODED,a)),c.path!==void 0&&(c.path=String(c.path).replace(d.PCT_ENCODED,T).replace(c.scheme?d.NOT_PATH:d.NOT_PATH_NOSCHEME,mt).replace(d.PCT_ENCODED,a)),c.query!==void 0&&(c.query=String(c.query).replace(d.PCT_ENCODED,T).replace(d.NOT_QUERY,mt).replace(d.PCT_ENCODED,a)),c.fragment!==void 0&&(c.fragment=String(c.fragment).replace(d.PCT_ENCODED,T).replace(d.NOT_FRAGMENT,mt).replace(d.PCT_ENCODED,a)),c}function nc(c){return c.replace(/^0*(.*)/,"$1")||"0"}function ac(c,d){var T=c.match(d.IPV4ADDRESS)||[],$=l(T,2),O=$[1];return O?O.split(".").map(nc).join("."):c}function xg(c,d){var T=c.match(d.IPV6ADDRESS)||[],$=l(T,3),O=$[1],W=$[2];if(O){for(var B=O.toLowerCase().split("::").reverse(),te=l(B,2),se=te[0],we=te[1],Z=we?we.split(":").map(nc):[],_e=se.split(":").map(nc),$e=d.IPV4ADDRESS.test(_e[_e.length-1]),he=$e?7:8,ne=_e.length-he,Te=Array(he),oe=0;oe<he;++oe)Te[oe]=Z[oe]||_e[ne+oe]||"";$e&&(Te[he-1]=ac(Te[he-1],d));var Xa=Te.reduce(function(Ye,_t,Ya){if(!_t||_t==="0"){var Er=Ye[Ye.length-1];Er&&Er.index+Er.length===Ya?Er.length++:Ye.push({index:Ya,length:1})}return Ye},[]),He=Xa.sort(function(Ye,_t){return _t.length-Ye.length})[0],Xe=void 0;if(He&&He.length>1){var ue=Te.slice(0,He.index),ze=Te.slice(He.index+He.length);Xe=ue.join(":")+"::"+ze.join(":")}else Xe=Te.join(":");return W&&(Xe+="%"+W),Xe}else return c}var Qx=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,S="".match(/(){0}/)[1]===void 0;function Mr(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},T={},$=d.iri!==!1?u:f;d.reference==="suffix"&&(c=(d.scheme?d.scheme+":":"")+"//"+c);var O=c.match(Qx);if(O){S?(T.scheme=O[1],T.userinfo=O[3],T.host=O[4],T.port=parseInt(O[5],10),T.path=O[6]||"",T.query=O[7],T.fragment=O[8],isNaN(T.port)&&(T.port=O[5])):(T.scheme=O[1]||void 0,T.userinfo=c.indexOf("@")!==-1?O[3]:void 0,T.host=c.indexOf("//")!==-1?O[4]:void 0,T.port=parseInt(O[5],10),T.path=O[6]||"",T.query=c.indexOf("?")!==-1?O[7]:void 0,T.fragment=c.indexOf("#")!==-1?O[8]:void 0,isNaN(T.port)&&(T.port=c.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?O[4]:void 0)),T.host&&(T.host=xg(ac(T.host,$),$)),T.scheme===void 0&&T.userinfo===void 0&&T.host===void 0&&T.port===void 0&&!T.path&&T.query===void 0?T.reference="same-document":T.scheme===void 0?T.reference="relative":T.fragment===void 0?T.reference="absolute":T.reference="uri",d.reference&&d.reference!=="suffix"&&d.reference!==T.reference&&(T.error=T.error||"URI is not a "+d.reference+" reference.");var W=Je[(d.scheme||T.scheme||"").toLowerCase()];if(!d.unicodeSupport&&(!W||!W.unicodeSupport)){if(T.host&&(d.domainHost||W&&W.domainHost))try{T.host=Hs.toASCII(T.host.replace($.PCT_ENCODED,zs).toLowerCase())}catch(B){T.error=T.error||"Host's domain name can not be converted to ASCII via punycode: "+B}rc(T,f)}else rc(T,$);W&&W.parse&&W.parse(T,d)}else T.error=T.error||"URI can not be parsed.";return T}function Jx(c,d){var T=d.iri!==!1?u:f,$=[];return c.userinfo!==void 0&&($.push(c.userinfo),$.push("@")),c.host!==void 0&&$.push(xg(ac(String(c.host),T),T).replace(T.IPV6ADDRESS,function(O,W,B){return"["+W+(B?"%25"+B:"")+"]"})),(typeof c.port=="number"||typeof c.port=="string")&&($.push(":"),$.push(String(c.port))),$.length?$.join(""):void 0}var Fg=/^\.\.?\//,wg=/^\/\.(\/|$)/,$g=/^\/\.\.(\/|$)/,Xx=/^\/?(?:.|\n)*?(?=\/|$)/;function Ks(c){for(var d=[];c.length;)if(c.match(Fg))c=c.replace(Fg,"");else if(c.match(wg))c=c.replace(wg,"/");else if(c.match($g))c=c.replace($g,"/"),d.pop();else if(c==="."||c==="..")c="";else{var T=c.match(Xx);if(T){var $=T[0];c=c.slice($.length),d.push($)}else throw new Error("Unexpected dot segment condition")}return d.join("")}function ht(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},T=d.iri?u:f,$=[],O=Je[(d.scheme||c.scheme||"").toLowerCase()];if(O&&O.serialize&&O.serialize(c,d),c.host&&!T.IPV6ADDRESS.test(c.host)){if(d.domainHost||O&&O.domainHost)try{c.host=d.iri?Hs.toUnicode(c.host):Hs.toASCII(c.host.replace(T.PCT_ENCODED,zs).toLowerCase())}catch(te){c.error=c.error||"Host's domain name can not be converted to "+(d.iri?"Unicode":"ASCII")+" via punycode: "+te}}rc(c,T),d.reference!=="suffix"&&c.scheme&&($.push(c.scheme),$.push(":"));var W=Jx(c,d);if(W!==void 0&&(d.reference!=="suffix"&&$.push("//"),$.push(W),c.path&&c.path.charAt(0)!=="/"&&$.push("/")),c.path!==void 0){var B=c.path;!d.absolutePath&&(!O||!O.absolutePath)&&(B=Ks(B)),W===void 0&&(B=B.replace(/^\/\//,"/%2F")),$.push(B)}return c.query!==void 0&&($.push("?"),$.push(c.query)),c.fragment!==void 0&&($.push("#"),$.push(c.fragment)),$.join("")}function Og(c,d){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},$=arguments[3],O={};return $||(c=Mr(ht(c,T),T),d=Mr(ht(d,T),T)),T=T||{},!T.tolerant&&d.scheme?(O.scheme=d.scheme,O.userinfo=d.userinfo,O.host=d.host,O.port=d.port,O.path=Ks(d.path||""),O.query=d.query):(d.userinfo!==void 0||d.host!==void 0||d.port!==void 0?(O.userinfo=d.userinfo,O.host=d.host,O.port=d.port,O.path=Ks(d.path||""),O.query=d.query):(d.path?(d.path.charAt(0)==="/"?O.path=Ks(d.path):((c.userinfo!==void 0||c.host!==void 0||c.port!==void 0)&&!c.path?O.path="/"+d.path:c.path?O.path=c.path.slice(0,c.path.lastIndexOf("/")+1)+d.path:O.path=d.path,O.path=Ks(O.path)),O.query=d.query):(O.path=c.path,d.query!==void 0?O.query=d.query:O.query=c.query),O.userinfo=c.userinfo,O.host=c.host,O.port=c.port),O.scheme=c.scheme),O.fragment=d.fragment,O}function Yx(c,d,T){var $=i({scheme:"null"},T);return ht(Og(Mr(c,$),Mr(d,$),$,!0),$)}function Zx(c,d){return typeof c=="string"?c=ht(Mr(c,d),d):n(c)==="object"&&(c=Mr(ht(c,d),d)),c}function eF(c,d,T){return typeof c=="string"?c=ht(Mr(c,T),T):n(c)==="object"&&(c=ht(c,T)),typeof d=="string"?d=ht(Mr(d,T),T):n(d)==="object"&&(d=ht(d,T)),c===d}function tF(c,d){return c&&c.toString().replace(!d||!d.iri?f.ESCAPE:u.ESCAPE,mt)}function Wr(c,d){return c&&c.toString().replace(!d||!d.iri?f.PCT_ENCODED:u.PCT_ENCODED,zs)}var Wi={scheme:"http",domainHost:!0,parse:function(d,T){return d.host||(d.error=d.error||"HTTP URIs must have a host."),d},serialize:function(d,T){var $=String(d.scheme).toLowerCase()==="https";return(d.port===($?443:80)||d.port==="")&&(d.port=void 0),d.path||(d.path="/"),d}},vg={scheme:"https",domainHost:Wi.domainHost,parse:Wi.parse,serialize:Wi.serialize};function v(c){return typeof c.secure=="boolean"?c.secure:String(c.scheme).toLowerCase()==="wss"}var Ei={scheme:"ws",domainHost:!0,parse:function(d,T){var $=d;return $.secure=v($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$},serialize:function(d,T){if((d.port===(v(d)?443:80)||d.port==="")&&(d.port=void 0),typeof d.secure=="boolean"&&(d.scheme=d.secure?"wss":"ws",d.secure=void 0),d.resourceName){var $=d.resourceName.split("?"),O=l($,2),W=O[0],B=O[1];d.path=W&&W!=="/"?W:void 0,d.query=B,d.resourceName=void 0}return d.fragment=void 0,d}},jg={scheme:"wss",domainHost:Ei.domainHost,parse:Ei.parse,serialize:Ei.serialize},rF={},nF=!0,Ig="[A-Za-z0-9\\-\\.\\_\\~"+(nF?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",gt="[0-9A-Fa-f]",aF=r(r("%[EFef]"+gt+"%"+gt+gt+"%"+gt+gt)+"|"+r("%[89A-Fa-f]"+gt+"%"+gt+gt)+"|"+r("%"+gt+gt)),sF="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",iF="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",oF=e(iF,'[\\"\\\\]'),pF="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",fF=new RegExp(Ig,"g"),Qs=new RegExp(aF,"g"),uF=new RegExp(e("[^]",sF,"[\\.]",'[\\"]',oF),"g"),kg=new RegExp(e("[^]",Ig,pF),"g"),dF=kg;function sc(c){var d=zs(c);return d.match(fF)?d:c}var Sg={scheme:"mailto",parse:function(d,T){var $=d,O=$.to=$.path?$.path.split(","):[];if($.path=void 0,$.query){for(var W=!1,B={},te=$.query.split("&"),se=0,we=te.length;se<we;++se){var Z=te[se].split("=");switch(Z[0]){case"to":for(var _e=Z[1].split(","),$e=0,he=_e.length;$e<he;++$e)O.push(_e[$e]);break;case"subject":$.subject=Wr(Z[1],T);break;case"body":$.body=Wr(Z[1],T);break;default:W=!0,B[Wr(Z[0],T)]=Wr(Z[1],T);break}}W&&($.headers=B)}$.query=void 0;for(var ne=0,Te=O.length;ne<Te;++ne){var oe=O[ne].split("@");if(oe[0]=Wr(oe[0]),T.unicodeSupport)oe[1]=Wr(oe[1],T).toLowerCase();else try{oe[1]=Hs.toASCII(Wr(oe[1],T).toLowerCase())}catch(Xa){$.error=$.error||"Email address's domain name can not be converted to ASCII via punycode: "+Xa}O[ne]=oe.join("@")}return $},serialize:function(d,T){var $=d,O=s(d.to);if(O){for(var W=0,B=O.length;W<B;++W){var te=String(O[W]),se=te.lastIndexOf("@"),we=te.slice(0,se).replace(Qs,sc).replace(Qs,a).replace(uF,mt),Z=te.slice(se+1);try{Z=T.iri?Hs.toUnicode(Z):Hs.toASCII(Wr(Z,T).toLowerCase())}catch(ne){$.error=$.error||"Email address's domain name can not be converted to "+(T.iri?"Unicode":"ASCII")+" via punycode: "+ne}O[W]=we+"@"+Z}$.path=O.join(",")}var _e=d.headers=d.headers||{};d.subject&&(_e.subject=d.subject),d.body&&(_e.body=d.body);var $e=[];for(var he in _e)_e[he]!==rF[he]&&$e.push(he.replace(Qs,sc).replace(Qs,a).replace(kg,mt)+"="+_e[he].replace(Qs,sc).replace(Qs,a).replace(dF,mt));return $e.length&&($.query=$e.join("&")),$}},lF=/^([^\:]+)\:(.*)/,Cg={scheme:"urn",parse:function(d,T){var $=d.path&&d.path.match(lF),O=d;if($){var W=T.scheme||O.scheme||"urn",B=$[1].toLowerCase(),te=$[2],se=W+":"+(T.nid||B),we=Je[se];O.nid=B,O.nss=te,O.path=void 0,we&&(O=we.parse(O,T))}else O.error=O.error||"URN can not be parsed.";return O},serialize:function(d,T){var $=T.scheme||d.scheme||"urn",O=d.nid,W=$+":"+(T.nid||O),B=Je[W];B&&(d=B.serialize(d,T));var te=d,se=d.nss;return te.path=(O||T.nid)+":"+se,te}},cF=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Pg={scheme:"urn:uuid",parse:function(d,T){var $=d;return $.uuid=$.nss,$.nss=void 0,!T.tolerant&&(!$.uuid||!$.uuid.match(cF))&&($.error=$.error||"UUID is not valid."),$},serialize:function(d,T){var $=d;return $.nss=(d.uuid||"").toLowerCase(),$}};Je[Wi.scheme]=Wi,Je[vg.scheme]=vg,Je[Ei.scheme]=Ei,Je[jg.scheme]=jg,Je[Sg.scheme]=Sg,Je[Cg.scheme]=Cg,Je[Pg.scheme]=Pg,t.SCHEMES=Je,t.pctEncChar=mt,t.pctDecChars=zs,t.parse=Mr,t.removeDotSegments=Ks,t.serialize=ht,t.resolveComponents=Og,t.resolve=Yx,t.normalize=Zx,t.equal=eF,t.escapeComponent=tF,t.unescapeComponent=Wr,Object.defineProperty(t,"__esModule",{value:!0})})});var oo=C(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.getSchemaRefs=Le.resolveUrl=Le.normalizeId=Le._getFullPath=Le.getFullPath=Le.inlineRef=void 0;var Fv=ae(),wv=cm(),$v=Cy(),Kd=mm(),Ov=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function vv(t,e=!0){return typeof t=="boolean"?!0:e===!0?!hm(t):e?Gy(t)<=e:!1}Le.inlineRef=vv;var jv=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function hm(t){for(let e in t){if(jv.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(hm)||typeof r=="object"&&hm(r))return!0}return!1}function Gy(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!Ov.has(r)&&(typeof t[r]=="object"&&Fv.eachItem(t[r],n=>e+=Gy(n)),e===1/0))return 1/0}return e}function Dy(t="",e){e!==!1&&(t=fi(t));let r=Kd.parse(t);return My(r)}Le.getFullPath=Dy;function My(t){return Kd.serialize(t).split("#")[0]+"#"}Le._getFullPath=My;var Iv=/#\/?$/;function fi(t){return t?t.replace(Iv,""):""}Le.normalizeId=fi;function kv(t,e){return e=fi(e),Kd.resolve(t,e)}Le.resolveUrl=kv;var Sv=/^[a-z_][-a-z0-9._]*$/i;function Cv(t){if(typeof t=="boolean")return{};let{schemaId:e}=this.opts,r=fi(t[e]),n={"":r},a=Dy(r,!1),s={},i=new Set;return $v(t,{allKeys:!0},(u,l,_,b)=>{if(b===void 0)return;let w=a+l,y=n[b];typeof u[e]=="string"&&(y=j.call(this,u[e])),I.call(this,u.$anchor),I.call(this,u.$dynamicAnchor),n[l]=y;function j(k){if(k=fi(y?Kd.resolve(y,k):k),i.has(k))throw f(k);i.add(k);let A=this.refs[k];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?o(u,A.schema,k):k!==fi(w)&&(k[0]==="#"?(o(u,s[k],k),s[k]=u):this.refs[k]=w),k}function I(k){if(typeof k=="string"){if(!Sv.test(k))throw new Error(`invalid anchor "${k}"`);j.call(this,`#${k}`)}}}),s;function o(u,l,_){if(l!==void 0&&!wv(u,l))throw f(_)}function f(u){return new Error(`reference "${u}" resolves to more than one schema`)}}Le.getSchemaRefs=Cv});var uo=C(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.getData=Ta.KeywordCxt=Ta.validateFunctionCode=void 0;var Wy=my(),Ey=io(),gm=im(),Qd=io(),Pv=xy(),po=vy(),_m=Iy(),E=Q(),N=Kr(),Gv=oo(),Qr=ae(),fo=ao();function Dv(t){if(qy(t)&&(Ny(t),Uy(t))){Ev(t);return}Ry(t,()=>Wy.topBoolOrEmptySchema(t))}Ta.validateFunctionCode=Dv;function Ry({gen:t,validateName:e,schema:r,schemaEnv:n,opts:a},s){a.code.es5?t.func(e,E._`${N.default.data}, ${N.default.valCxt}`,n.$async,()=>{t.code(E._`"use strict"; ${Ay(r,a)}`),Wv(t,a),t.code(s)}):t.func(e,E._`${N.default.data}, ${Mv(a)}`,n.$async,()=>t.code(Ay(r,a)).code(s))}function Mv(t){return E._`{${N.default.instancePath}="", ${N.default.parentData}, ${N.default.parentDataProperty}, ${N.default.rootData}=${N.default.data}${t.dynamicRef?E._`, ${N.default.dynamicAnchors}={}`:E.nil}}={}`}function Wv(t,e){t.if(N.default.valCxt,()=>{t.var(N.default.instancePath,E._`${N.default.valCxt}.${N.default.instancePath}`),t.var(N.default.parentData,E._`${N.default.valCxt}.${N.default.parentData}`),t.var(N.default.parentDataProperty,E._`${N.default.valCxt}.${N.default.parentDataProperty}`),t.var(N.default.rootData,E._`${N.default.valCxt}.${N.default.rootData}`),e.dynamicRef&&t.var(N.default.dynamicAnchors,E._`${N.default.valCxt}.${N.default.dynamicAnchors}`)},()=>{t.var(N.default.instancePath,E._`""`),t.var(N.default.parentData,E._`undefined`),t.var(N.default.parentDataProperty,E._`undefined`),t.var(N.default.rootData,N.default.data),e.dynamicRef&&t.var(N.default.dynamicAnchors,E._`{}`)})}function Ev(t){let{schema:e,opts:r,gen:n}=t;Ry(t,()=>{r.$comment&&e.$comment&&Ly(t),Nv(t),n.let(N.default.vErrors,null),n.let(N.default.errors,0),r.unevaluated&&Rv(t),By(t),Vv(t)})}function Rv(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",E._`${r}.evaluated`),e.if(E._`${t.evaluated}.dynamicProps`,()=>e.assign(E._`${t.evaluated}.props`,E._`undefined`)),e.if(E._`${t.evaluated}.dynamicItems`,()=>e.assign(E._`${t.evaluated}.items`,E._`undefined`))}function Ay(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?E._`/*# sourceURL=${r} */`:E.nil}function Av(t,e){if(qy(t)&&(Ny(t),Uy(t))){Uv(t,e);return}Wy.boolOrEmptySchema(t,e)}function Uy({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function qy(t){return typeof t.schema!="boolean"}function Uv(t,e){let{schema:r,gen:n,opts:a}=t;a.$comment&&r.$comment&&Ly(t),Bv(t),Lv(t);let s=n.const("_errs",N.default.errors);By(t,s),n.var(e,E._`${s} === ${N.default.errors}`)}function Ny(t){Qr.checkUnknownRules(t),qv(t)}function By(t,e){if(t.opts.jtd)return Vy(t,[],!1,e);let r=Ey.getSchemaTypes(t.schema),n=Ey.coerceAndCheckDataType(t,r);Vy(t,r,!n,e)}function qv(t){let{schema:e,errSchemaPath:r,opts:n,self:a}=t;e.$ref&&n.ignoreKeywordsWithRef&&Qr.schemaHasRulesButRef(e,a.RULES)&&a.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Nv(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&Qr.checkStrictMode(t,"default is ignored in the schema root")}function Bv(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=Gv.resolveUrl(t.baseId,e))}function Lv(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function Ly({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:a}){let s=r.$comment;if(a.$comment===!0)t.code(E._`${N.default.self}.logger.log(${s})`);else if(typeof a.$comment=="function"){let i=E.str`${n}/$comment`,o=t.scopeValue("root",{ref:e.root});t.code(E._`${N.default.self}.opts.$comment(${s}, ${i}, ${o}.schema)`)}}function Vv(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:a,opts:s}=t;r.$async?e.if(E._`${N.default.errors} === 0`,()=>e.return(N.default.data),()=>e.throw(E._`new ${a}(${N.default.vErrors})`)):(e.assign(E._`${n}.errors`,N.default.vErrors),s.unevaluated&&Hv(t),e.return(E._`${N.default.errors} === 0`))}function Hv({gen:t,evaluated:e,props:r,items:n}){r instanceof E.Name&&t.assign(E._`${e}.props`,r),n instanceof E.Name&&t.assign(E._`${e}.items`,n)}function Vy(t,e,r,n){let{gen:a,schema:s,data:i,allErrors:o,opts:f,self:u}=t,{RULES:l}=u;if(s.$ref&&(f.ignoreKeywordsWithRef||!Qr.schemaHasRulesButRef(s,l))){a.block(()=>Ky(t,"$ref",l.all.$ref.definition));return}f.jtd||zv(t,e),a.block(()=>{for(let b of l.rules)_(b);_(l.post)});function _(b){!gm.shouldUseGroup(s,b)||(b.type?(a.if(Qd.checkDataType(b.type,i,f.strictNumbers)),Hy(t,b),e.length===1&&e[0]===b.type&&r&&(a.else(),Qd.reportTypeError(t)),a.endIf()):Hy(t,b),o||a.if(E._`${N.default.errors} === ${n||0}`))}}function Hy(t,e){let{gen:r,schema:n,opts:{useDefaults:a}}=t;a&&Pv.assignDefaults(t,e.type),r.block(()=>{for(let s of e.rules)gm.shouldUseRule(n,s)&&Ky(t,s.keyword,s.definition,e.type)})}function zv(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Kv(t,e),t.opts.allowUnionTypes||Qv(t,e),Jv(t,t.dataTypes))}function Kv(t,e){if(!!e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{zy(t.dataTypes,r)||Tm(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),t.dataTypes=t.dataTypes.filter(r=>zy(e,r))}}function Qv(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Tm(t,"use allowUnionTypes to allow union type keyword")}function Jv(t,e){let r=t.self.RULES.all;for(let n in r){let a=r[n];if(typeof a=="object"&&gm.shouldUseRule(t.schema,a)){let{type:s}=a.definition;s.length&&!s.some(i=>Xv(e,i))&&Tm(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function Xv(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function zy(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function Tm(t,e){e+=` at "${t.schemaEnv.baseId+t.errSchemaPath}" (strictTypes)`,Qr.checkStrictMode(t,e,t.opts.strictTypes)}var ym=class{constructor(e,r,n){if(po.validateKeywordUsage(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=Qr.schemaRefOrVal(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",Qy(this.$data,e));else if(this.schemaCode=this.schemaValue,!po.validSchemaType(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",N.default.errors))}result(e,r,n){this.failResult(E.not(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult(E.not(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail(E._`${r} !== undefined && (${E.or(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?fo.reportExtraError:fo.reportError)(this,this.def.error,r)}$dataError(){fo.reportError(this,this.def.$dataError||fo.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');fo.resetErrorsCount(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=E.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=E.nil,r=E.nil){if(!this.$data)return;let{gen:n,schemaCode:a,schemaType:s,def:i}=this;n.if(E.or(E._`${a} === undefined`,r)),e!==E.nil&&n.assign(e,!0),(s.length||i.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==E.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:a,it:s}=this;return E.or(i(),o());function i(){if(n.length){if(!(r instanceof E.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return E._`${Qd.checkDataTypes(f,r,s.opts.strictNumbers,Qd.DataType.Wrong)}`}return E.nil}function o(){if(a.validateSchema){let f=e.scopeValue("validate$data",{ref:a.validateSchema});return E._`!${f}(${r})`}return E.nil}}subschema(e,r){let n=_m.getSubschema(this.it,e);_m.extendSubschemaData(n,this.it,e),_m.extendSubschemaMode(n,e);let a=q(P(P({},this.it),n),{items:void 0,props:void 0});return Av(a,r),a}mergeEvaluated(e,r){let{it:n,gen:a}=this;!n.opts.unevaluated||(n.props!==!0&&e.props!==void 0&&(n.props=Qr.mergeEvaluated.props(a,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Qr.mergeEvaluated.items(a,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:a}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return a.if(r,()=>this.mergeEvaluated(e,E.Name)),!0}};Ta.KeywordCxt=ym;function Ky(t,e,r,n){let a=new ym(t,r,e);"code"in r?r.code(a,n):a.$data&&r.validate?po.funcKeywordCode(a,r):"macro"in r?po.macroKeywordCode(a,r):(r.compile||r.validate)&&po.funcKeywordCode(a,r)}var Yv=/^\/(?:[^~]|~0|~1)*$/,Zv=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Qy(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let a,s;if(t==="")return N.default.rootData;if(t[0]==="/"){if(!Yv.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);a=t,s=N.default.rootData}else{let u=Zv.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let l=+u[1];if(a=u[2],a==="#"){if(l>=e)throw new Error(f("property/index",l));return n[e-l]}if(l>e)throw new Error(f("data",l));if(s=r[e-l],!a)return s}let i=s,o=a.split("/");for(let u of o)u&&(s=E._`${s}${E.getProperty(Qr.unescapeJsonPointer(u))}`,i=E._`${i} && ${s}`);return i;function f(u,l){return`Cannot access ${u} ${l} levels up, current level is ${e}`}}Ta.getData=Qy});var xm=C(bm=>{"use strict";Object.defineProperty(bm,"__esModule",{value:!0});var Jy=class extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}};bm.default=Jy});var $m=C(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});var Fm=oo(),Xy=class extends Error{constructor(e,r,n){super(n||`can't resolve reference ${r} from id ${e}`);this.missingRef=Fm.resolveUrl(e,r),this.missingSchema=Fm.normalizeId(Fm.getFullPath(this.missingRef))}};wm.default=Xy});var jm=C(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.resolveSchema=tt.getCompilingSchema=tt.resolveRef=tt.compileSchema=tt.SchemaEnv=void 0;var st=Q(),ej=xm(),fs=Kr(),it=oo(),Yy=ae(),tj=uo(),rj=mm(),lo=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:it.normalizeId(n==null?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n==null?void 0:n.$async,this.refs={}}};tt.SchemaEnv=lo;function Om(t){let e=Zy.call(this,t);if(e)return e;let r=it.getFullPath(t.root.baseId),{es5:n,lines:a}=this.opts.code,{ownProperties:s}=this.opts,i=new st.CodeGen(this.scope,{es5:n,lines:a,ownProperties:s}),o;t.$async&&(o=i.scopeValue("Error",{ref:ej.default,code:st._`require("ajv/dist/runtime/validation_error").default`}));let f=i.scopeName("validate");t.validateName=f;let u={gen:i,allErrors:this.opts.allErrors,data:fs.default.data,parentData:fs.default.parentData,parentDataProperty:fs.default.parentDataProperty,dataNames:[fs.default.data],dataPathArr:[st.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:st.stringify(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:o,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:st.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:st._`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),tj.validateFunctionCode(u),i.optimize(this.opts.code.optimize);let _=i.toString();l=`${i.scopeRefs(fs.default.scope)}return ${_}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let w=new Function(`${fs.default.self}`,`${fs.default.scope}`,l)(this,this.scope.get());if(this.scope.value(f,{ref:w}),w.errors=null,w.schema=t.schema,w.schemaEnv=t,t.$async&&(w.$async=!0),this.opts.code.source===!0&&(w.source={validateName:f,validateCode:_,scopeValues:i._values}),this.opts.unevaluated){let{props:y,items:j}=u;w.evaluated={props:y instanceof st.Name?void 0:y,items:j instanceof st.Name?void 0:j,dynamicProps:y instanceof st.Name,dynamicItems:j instanceof st.Name},w.source&&(w.source.evaluated=st.stringify(w.evaluated))}return t.validate=w,t}catch(_){throw delete t.validate,delete t.validateName,l&&this.logger.error("Error compiling schema, function code:",l),_}finally{this._compilations.delete(t)}}tt.compileSchema=Om;function nj(t,e,r){var n;r=it.resolveUrl(e,r);let a=t.refs[r];if(a)return a;let s=ij.call(this,t,r);if(s===void 0){let i=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:o}=this.opts;i&&(s=new lo({schema:i,schemaId:o,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=aj.call(this,s)}tt.resolveRef=nj;function aj(t){return it.inlineRef(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Om.call(this,t)}function Zy(t){for(let e of this._compilations)if(sj(e,t))return e}tt.getCompilingSchema=Zy;function sj(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function ij(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Jd.call(this,t,e)}function Jd(t,e){let r=rj.parse(e),n=it._getFullPath(r),a=it.getFullPath(t.baseId);if(Object.keys(t.schema).length>0&&n===a)return vm.call(this,r,t);let s=it.normalizeId(n),i=this.refs[s]||this.schemas[s];if(typeof i=="string"){let o=Jd.call(this,t,i);return typeof(o==null?void 0:o.schema)!="object"?void 0:vm.call(this,r,o)}if(typeof(i==null?void 0:i.schema)=="object"){if(i.validate||Om.call(this,i),s===it.normalizeId(e)){let{schema:o}=i,{schemaId:f}=this.opts,u=o[f];return u&&(a=it.resolveUrl(a,u)),new lo({schema:o,schemaId:f,root:t,baseId:a})}return vm.call(this,r,i)}}tt.resolveSchema=Jd;var oj=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function vm(t,{baseId:e,schema:r,root:n}){var a;if(((a=t.fragment)===null||a===void 0?void 0:a[0])!=="/")return;for(let o of t.fragment.slice(1).split("/")){if(typeof r=="boolean"||(r=r[Yy.unescapeFragment(o)],r===void 0))return;let f=typeof r=="object"&&r[this.opts.schemaId];!oj.has(o)&&f&&(e=it.resolveUrl(e,f))}let s;if(typeof r!="boolean"&&r.$ref&&!Yy.schemaHasRulesButRef(r,this.RULES)){let o=it.resolveUrl(e,r.$ref);s=Jd.call(this,n,o)}let{schemaId:i}=this.opts;if(s=s||new lo({schema:r,schemaId:i,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var eb=C((tX,pj)=>{pj.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var ob=C(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.CodeGen=Ce.Name=Ce.nil=Ce.stringify=Ce.str=Ce._=Ce.KeywordCxt=void 0;var fj=uo();Object.defineProperty(Ce,"KeywordCxt",{enumerable:!0,get:function(){return fj.KeywordCxt}});var ui=Q();Object.defineProperty(Ce,"_",{enumerable:!0,get:function(){return ui._}});Object.defineProperty(Ce,"str",{enumerable:!0,get:function(){return ui.str}});Object.defineProperty(Ce,"stringify",{enumerable:!0,get:function(){return ui.stringify}});Object.defineProperty(Ce,"nil",{enumerable:!0,get:function(){return ui.nil}});Object.defineProperty(Ce,"Name",{enumerable:!0,get:function(){return ui.Name}});Object.defineProperty(Ce,"CodeGen",{enumerable:!0,get:function(){return ui.CodeGen}});var uj=xm(),tb=$m(),dj=sm(),co=jm(),lj=Q(),mo=oo(),Xd=io(),Im=ae(),rb=eb(),cj=["removeAdditional","useDefaults","coerceTypes"],mj=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),hj={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},gj={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},nb=200;function _j(t){var e,r,n,a,s,i,o,f,u,l,_,b,w,y,j,I,k,A,ce,Y,z,be;let Ge=t.strict,Qa=(e=t.code)===null||e===void 0?void 0:e.optimize,Vs=Qa===!0||Qa===void 0?1:Qa||0;return{strictSchema:(n=(r=t.strictSchema)!==null&&r!==void 0?r:Ge)!==null&&n!==void 0?n:!0,strictNumbers:(s=(a=t.strictNumbers)!==null&&a!==void 0?a:Ge)!==null&&s!==void 0?s:!0,strictTypes:(o=(i=t.strictTypes)!==null&&i!==void 0?i:Ge)!==null&&o!==void 0?o:"log",strictTuples:(u=(f=t.strictTuples)!==null&&f!==void 0?f:Ge)!==null&&u!==void 0?u:"log",strictRequired:(_=(l=t.strictRequired)!==null&&l!==void 0?l:Ge)!==null&&_!==void 0?_:!1,code:t.code?q(P({},t.code),{optimize:Vs}):{optimize:Vs},loopRequired:(b=t.loopRequired)!==null&&b!==void 0?b:nb,loopEnum:(w=t.loopEnum)!==null&&w!==void 0?w:nb,meta:(y=t.meta)!==null&&y!==void 0?y:!0,messages:(j=t.messages)!==null&&j!==void 0?j:!0,inlineRefs:(I=t.inlineRefs)!==null&&I!==void 0?I:!0,schemaId:(k=t.schemaId)!==null&&k!==void 0?k:"$id",addUsedSchema:(A=t.addUsedSchema)!==null&&A!==void 0?A:!0,validateSchema:(ce=t.validateSchema)!==null&&ce!==void 0?ce:!0,validateFormats:(Y=t.validateFormats)!==null&&Y!==void 0?Y:!0,unicodeRegExp:(z=t.unicodeRegExp)!==null&&z!==void 0?z:!0,int32range:(be=t.int32range)!==null&&be!==void 0?be:!0}}var Yd=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts=P(P({},e),_j(e));let{es5:r,lines:n}=this.opts.code;this.scope=new lj.ValueScope({scope:{},prefixes:mj,es5:r,lines:n}),this.logger=wj(e.logger);let a=e.validateFormats;e.validateFormats=!1,this.RULES=dj.getRules(),ab.call(this,hj,e,"NOT SUPPORTED"),ab.call(this,gj,e,"DEPRECATED","warn"),this._metaOpts=xj.call(this),e.formats&&yj.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&bj.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),Tj.call(this),e.validateFormats=a}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,a=rb;n==="id"&&(a=P({},rb),a.id=a.$id,delete a.$id),r&&e&&this.addMetaSchema(a,a[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let a=n(r);return"$async"in n||(this.errors=n.errors),a}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return a.call(this,e,r);function a(l,_){return ye(this,null,function*(){yield s.call(this,l.$schema);let b=this._addSchema(l,_);return b.validate||i.call(this,b)})}function s(l){return ye(this,null,function*(){l&&!this.getSchema(l)&&(yield a.call(this,{$ref:l},!0))})}function i(l){return ye(this,null,function*(){try{return this._compileSchemaEnv(l)}catch(_){if(!(_ instanceof tb.default))throw _;return o.call(this,_),yield f.call(this,_.missingSchema),i.call(this,l)}})}function o({missingSchema:l,missingRef:_}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${_} cannot be resolved`)}function f(l){return ye(this,null,function*(){let _=yield u.call(this,l);this.refs[l]||(yield s.call(this,_.$schema)),this.refs[l]||this.addSchema(_,l,r)})}function u(l){return ye(this,null,function*(){let _=this._loading[l];if(_)return _;try{return yield this._loading[l]=n(l)}finally{delete this._loading[l]}})}}addSchema(e,r,n,a=this.opts.validateSchema){if(Array.isArray(e)){for(let i of e)this.addSchema(i,void 0,n,a);return this}let s;if(typeof e=="object"){let{schemaId:i}=this.opts;if(s=e[i],s!==void 0&&typeof s!="string")throw new Error(`schema ${i} must be string`)}return r=mo.normalizeId(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,a,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let a=this.validate(n,e);if(!a&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return a}getSchema(e){let r;for(;typeof(r=sb.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,a=new co.SchemaEnv({schema:{},schemaId:n});if(r=co.resolveSchema.call(this,a,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=sb.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=mo.normalizeId(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Oj.call(this,n,r),!r)return Im.eachItem(n,s=>km.call(this,s)),this;jj.call(this,r);let a=q(P({},r),{type:Xd.getJSONTypes(r.type),schemaType:Xd.getJSONTypes(r.schemaType)});return Im.eachItem(n,a.type.length===0?s=>km.call(this,s,a):s=>a.type.forEach(i=>km.call(this,s,a,i))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let a=n.rules.findIndex(s=>s.keyword===e);a>=0&&n.rules.splice(a,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(a=>`${n}${a.instancePath} ${a.message}`).reduce((a,s)=>a+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let a of r){let s=a.split("/").slice(1),i=e;for(let o of s)i=i[o];for(let o in n){let f=n[o];if(typeof f!="object")continue;let{$data:u}=f.definition,l=i[o];u&&l&&(i[o]=ib(l))}}return e}_removeAllSchemas(e,r){for(let n in e){let a=e[n];(!r||r.test(n))&&(typeof a=="string"?delete e[n]:a&&!a.meta&&(this._cache.delete(a.schema),delete e[n]))}}_addSchema(e,r,n,a=this.opts.validateSchema,s=this.opts.addUsedSchema){let i,{schemaId:o}=this.opts;if(typeof e=="object")i=e[o];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let f=this._cache.get(e);if(f!==void 0)return f;let u=mo.getSchemaRefs.call(this,e);return n=mo.normalizeId(i||n),f=new co.SchemaEnv({schema:e,schemaId:o,meta:r,baseId:n,localRefs:u}),this._cache.set(f.schema,f),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=f),a&&this.validateSchema(e,!0),f}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):co.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{co.compileSchema.call(this,e)}finally{this.opts=r}}};Ce.default=Yd;Yd.ValidationError=uj.default;Yd.MissingRefError=tb.default;function ab(t,e,r,n="error"){for(let a in t){let s=a;s in e&&this.logger[n](`${r}: option ${a}. ${t[s]}`)}}function sb(t){return t=mo.normalizeId(t),this.schemas[t]||this.refs[t]}function Tj(){let t=this.opts.schemas;if(!!t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function yj(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function bj(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function xj(){let t=P({},this.opts);for(let e of cj)delete t[e];return t}var Fj={log(){},warn(){},error(){}};function wj(t){if(t===!1)return Fj;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var $j=/^[a-z_$][a-z0-9_$:-]*$/i;function Oj(t,e){let{RULES:r}=this;if(Im.eachItem(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!$j.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function km(t,e,r){var n;let a=e==null?void 0:e.post;if(r&&a)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,i=a?s.post:s.rules.find(({type:f})=>f===r);if(i||(i={type:r,rules:[]},s.rules.push(i)),s.keywords[t]=!0,!e)return;let o={keyword:t,definition:q(P({},e),{type:Xd.getJSONTypes(e.type),schemaType:Xd.getJSONTypes(e.schemaType)})};e.before?vj.call(this,i,o,e.before):i.rules.push(o),s.all[t]=o,(n=e.implements)===null||n===void 0||n.forEach(f=>this.addKeyword(f))}function vj(t,e,r){let n=t.rules.findIndex(a=>a.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function jj(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=ib(e)),t.validateSchema=this.compile(e,!0))}var Ij={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ib(t){return{anyOf:[t,Ij]}}});var pb=C(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});var kj={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Sm.default=kj});var lb=C(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.callRef=us.getValidate=void 0;var Sj=$m(),fb=et(),Ve=Q(),di=Kr(),ub=jm(),Zd=ae(),Cj={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:a,schemaEnv:s,validateName:i,opts:o,self:f}=n,{root:u}=s;if((r==="#"||r==="#/")&&a===u.baseId)return _();let l=ub.resolveRef.call(f,u,a,r);if(l===void 0)throw new Sj.default(a,r);if(l instanceof ub.SchemaEnv)return b(l);return w(l);function _(){if(s===u)return el(t,i,s,s.$async);let y=e.scopeValue("root",{ref:u});return el(t,Ve._`${y}.validate`,u,u.$async)}function b(y){let j=db(t,y);el(t,j,y,y.$async)}function w(y){let j=e.scopeValue("schema",o.code.source===!0?{ref:y,code:Ve.stringify(y)}:{ref:y}),I=e.name("valid"),k=t.subschema({schema:y,dataTypes:[],schemaPath:Ve.nil,topSchemaRef:j,errSchemaPath:r},I);t.mergeEvaluated(k),t.ok(I)}}};function db(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):Ve._`${r.scopeValue("wrapper",{ref:e})}.validate`}us.getValidate=db;function el(t,e,r,n){let{gen:a,it:s}=t,{allErrors:i,schemaEnv:o,opts:f}=s,u=f.passContext?di.default.this:Ve.nil;n?l():_();function l(){if(!o.$async)throw new Error("async schema referenced by sync schema");let y=a.let("valid");a.try(()=>{a.code(Ve._`await ${fb.callValidateCode(t,e,u)}`),w(e),i||a.assign(y,!0)},j=>{a.if(Ve._`!(${j} instanceof ${s.ValidationError})`,()=>a.throw(j)),b(j),i||a.assign(y,!1)}),t.ok(y)}function _(){t.result(fb.callValidateCode(t,e,u),()=>w(e),()=>b(e))}function b(y){let j=Ve._`${y}.errors`;a.assign(di.default.vErrors,Ve._`${di.default.vErrors} === null ? ${j} : ${di.default.vErrors}.concat(${j})`),a.assign(di.default.errors,Ve._`${di.default.vErrors}.length`)}function w(y){var j;if(!s.opts.unevaluated)return;let I=(j=r==null?void 0:r.validate)===null||j===void 0?void 0:j.evaluated;if(s.props!==!0)if(I&&!I.dynamicProps)I.props!==void 0&&(s.props=Zd.mergeEvaluated.props(a,I.props,s.props));else{let k=a.var("props",Ve._`${y}.evaluated.props`);s.props=Zd.mergeEvaluated.props(a,k,s.props,Ve.Name)}if(s.items!==!0)if(I&&!I.dynamicItems)I.items!==void 0&&(s.items=Zd.mergeEvaluated.items(a,I.items,s.items));else{let k=a.var("items",Ve._`${y}.evaluated.items`);s.items=Zd.mergeEvaluated.items(a,k,s.items,Ve.Name)}}}us.callRef=el;us.default=Cj});var cb=C(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});var Pj=pb(),Gj=lb(),Dj=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Pj.default,Gj.default];Cm.default=Dj});var mb=C(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});var tl=Q(),ya=tl.operators,rl={maximum:{okStr:"<=",ok:ya.LTE,fail:ya.GT},minimum:{okStr:">=",ok:ya.GTE,fail:ya.LT},exclusiveMaximum:{okStr:"<",ok:ya.LT,fail:ya.GTE},exclusiveMinimum:{okStr:">",ok:ya.GT,fail:ya.LTE}},Mj={message:({keyword:t,schemaCode:e})=>tl.str`must be ${rl[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>tl._`{comparison: ${rl[t].okStr}, limit: ${e}}`},Wj={keyword:Object.keys(rl),type:"number",schemaType:"number",$data:!0,error:Mj,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data(tl._`${r} ${rl[e].fail} ${n} || isNaN(${r})`)}};Pm.default=Wj});var hb=C(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});var ho=Q(),Ej={message:({schemaCode:t})=>ho.str`must be multiple of ${t}`,params:({schemaCode:t})=>ho._`{multipleOf: ${t}}`},Rj={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Ej,code(t){let{gen:e,data:r,schemaCode:n,it:a}=t,s=a.opts.multipleOfPrecision,i=e.let("res"),o=s?ho._`Math.abs(Math.round(${i}) - ${i}) > 1e-${s}`:ho._`${i} !== parseInt(${i})`;t.fail$data(ho._`(${n} === 0 || (${i} = ${r}/${n}, ${o}))`)}};Gm.default=Rj});var _b=C(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});function gb(t){let e=t.length,r=0,n=0,a;for(;n<e;)r++,a=t.charCodeAt(n++),a>=55296&&a<=56319&&n<e&&(a=t.charCodeAt(n),(a&64512)==56320&&n++);return r}Dm.default=gb;gb.code='require("ajv/dist/runtime/ucs2length").default'});var Tb=C(Mm=>{"use strict";Object.defineProperty(Mm,"__esModule",{value:!0});var ds=Q(),Aj=ae(),Uj=_b(),qj={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return ds.str`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>ds._`{limit: ${t}}`},Nj={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:qj,code(t){let{keyword:e,data:r,schemaCode:n,it:a}=t,s=e==="maxLength"?ds.operators.GT:ds.operators.LT,i=a.opts.unicode===!1?ds._`${r}.length`:ds._`${Aj.useFunc(t.gen,Uj.default)}(${r})`;t.fail$data(ds._`${i} ${s} ${n}`)}};Mm.default=Nj});var yb=C(Wm=>{"use strict";Object.defineProperty(Wm,"__esModule",{value:!0});var Bj=et(),nl=Q(),Lj={message:({schemaCode:t})=>nl.str`must match pattern "${t}"`,params:({schemaCode:t})=>nl._`{pattern: ${t}}`},Vj={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Lj,code(t){let{data:e,$data:r,schema:n,schemaCode:a,it:s}=t,i=s.opts.unicodeRegExp?"u":"",o=r?nl._`(new RegExp(${a}, ${i}))`:Bj.usePattern(t,n);t.fail$data(nl._`!${o}.test(${e})`)}};Wm.default=Vj});var bb=C(Em=>{"use strict";Object.defineProperty(Em,"__esModule",{value:!0});var go=Q(),Hj={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return go.str`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>go._`{limit: ${t}}`},zj={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Hj,code(t){let{keyword:e,data:r,schemaCode:n}=t,a=e==="maxProperties"?go.operators.GT:go.operators.LT;t.fail$data(go._`Object.keys(${r}).length ${a} ${n}`)}};Em.default=zj});var xb=C(Rm=>{"use strict";Object.defineProperty(Rm,"__esModule",{value:!0});var _o=et(),To=Q(),Kj=ae(),Qj={message:({params:{missingProperty:t}})=>To.str`must have required property '${t}'`,params:({params:{missingProperty:t}})=>To._`{missingProperty: ${t}}`},Jj={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Qj,code(t){let{gen:e,schema:r,schemaCode:n,data:a,$data:s,it:i}=t,{opts:o}=i;if(!s&&r.length===0)return;let f=r.length>=o.loopRequired;if(i.allErrors?u():l(),o.strictRequired){let w=t.parentSchema.properties,{definedProperties:y}=t.it;for(let j of r)if((w==null?void 0:w[j])===void 0&&!y.has(j)){let I=i.schemaEnv.baseId+i.errSchemaPath,k=`required property "${j}" is not defined at "${I}" (strictRequired)`;Kj.checkStrictMode(i,k,i.opts.strictRequired)}}function u(){if(f||s)t.block$data(To.nil,_);else for(let w of r)_o.checkReportMissingProp(t,w)}function l(){let w=e.let("missing");if(f||s){let y=e.let("valid",!0);t.block$data(y,()=>b(w,y)),t.ok(y)}else e.if(_o.checkMissingProp(t,r,w)),_o.reportMissingProp(t,w),e.else()}function _(){e.forOf("prop",n,w=>{t.setParams({missingProperty:w}),e.if(_o.noPropertyInData(e,a,w,o.ownProperties),()=>t.error())})}function b(w,y){t.setParams({missingProperty:w}),e.forOf(w,n,()=>{e.assign(y,_o.propertyInData(e,a,w,o.ownProperties)),e.if(To.not(y),()=>{t.error(),e.break()})},To.nil)}}};Rm.default=Jj});var Fb=C(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});var yo=Q(),Xj={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return yo.str`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>yo._`{limit: ${t}}`},Yj={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Xj,code(t){let{keyword:e,data:r,schemaCode:n}=t,a=e==="maxItems"?yo.operators.GT:yo.operators.LT;t.fail$data(yo._`${r}.length ${a} ${n}`)}};Am.default=Yj});var al=C(Um=>{"use strict";Object.defineProperty(Um,"__esModule",{value:!0});var wb=cm();wb.code='require("ajv/dist/runtime/equal").default';Um.default=wb});var $b=C(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});var qm=io(),Pe=Q(),Zj=ae(),eI=al(),tI={message:({params:{i:t,j:e}})=>Pe.str`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>Pe._`{i: ${t}, j: ${e}}`},rI={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:tI,code(t){let{gen:e,data:r,$data:n,schema:a,parentSchema:s,schemaCode:i,it:o}=t;if(!n&&!a)return;let f=e.let("valid"),u=s.items?qm.getSchemaTypes(s.items):[];t.block$data(f,l,Pe._`${i} === false`),t.ok(f);function l(){let y=e.let("i",Pe._`${r}.length`),j=e.let("j");t.setParams({i:y,j}),e.assign(f,!0),e.if(Pe._`${y} > 1`,()=>(_()?b:w)(y,j))}function _(){return u.length>0&&!u.some(y=>y==="object"||y==="array")}function b(y,j){let I=e.name("item"),k=qm.checkDataTypes(u,I,o.opts.strictNumbers,qm.DataType.Wrong),A=e.const("indices",Pe._`{}`);e.for(Pe._`;${y}--;`,()=>{e.let(I,Pe._`${r}[${y}]`),e.if(k,Pe._`continue`),u.length>1&&e.if(Pe._`typeof ${I} == "string"`,Pe._`${I} += "_"`),e.if(Pe._`typeof ${A}[${I}] == "number"`,()=>{e.assign(j,Pe._`${A}[${I}]`),t.error(),e.assign(f,!1).break()}).code(Pe._`${A}[${I}] = ${y}`)})}function w(y,j){let I=Zj.useFunc(e,eI.default),k=e.name("outer");e.label(k).for(Pe._`;${y}--;`,()=>e.for(Pe._`${j} = ${y}; ${j}--;`,()=>e.if(Pe._`${I}(${r}[${y}], ${r}[${j}])`,()=>{t.error(),e.assign(f,!1).break(k)})))}}};Nm.default=rI});var Ob=C(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});var Bm=Q(),nI=ae(),aI=al(),sI={message:"must be equal to constant",params:({schemaCode:t})=>Bm._`{allowedValue: ${t}}`},iI={keyword:"const",$data:!0,error:sI,code(t){let{gen:e,data:r,$data:n,schemaCode:a,schema:s}=t;n||s&&typeof s=="object"?t.fail$data(Bm._`!${nI.useFunc(e,aI.default)}(${r}, ${a})`):t.fail(Bm._`${s} !== ${r}`)}};Lm.default=iI});var vb=C(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});var bo=Q(),oI=ae(),pI=al(),fI={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>bo._`{allowedValues: ${t}}`},uI={keyword:"enum",schemaType:"array",$data:!0,error:fI,code(t){let{gen:e,data:r,$data:n,schema:a,schemaCode:s,it:i}=t;if(!n&&a.length===0)throw new Error("enum must have non-empty array");let o=a.length>=i.opts.loopEnum,f=oI.useFunc(e,pI.default),u;if(o||n)u=e.let("valid"),t.block$data(u,l);else{if(!Array.isArray(a))throw new Error("ajv implementation error");let b=e.const("vSchema",s);u=bo.or(...a.map((w,y)=>_(b,y)))}t.pass(u);function l(){e.assign(u,!1),e.forOf("v",s,b=>e.if(bo._`${f}(${r}, ${b})`,()=>e.assign(u,!0).break()))}function _(b,w){let y=a[w];return typeof y=="object"&&y!==null?bo._`${f}(${r}, ${b}[${w}])`:bo._`${r} === ${y}`}}};Vm.default=uI});var jb=C(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});var dI=mb(),lI=hb(),cI=Tb(),mI=yb(),hI=bb(),gI=xb(),_I=Fb(),TI=$b(),yI=Ob(),bI=vb(),xI=[dI.default,lI.default,cI.default,mI.default,hI.default,gI.default,_I.default,TI.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},yI.default,bI.default];Hm.default=xI});var Km=C(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.validateAdditionalItems=void 0;var ls=Q(),zm=ae(),FI={message:({params:{len:t}})=>ls.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>ls._`{limit: ${t}}`},wI={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:FI,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){zm.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Ib(t,n)}};function Ib(t,e){let{gen:r,schema:n,data:a,keyword:s,it:i}=t;i.items=!0;let o=r.const("len",ls._`${a}.length`);if(n===!1)t.setParams({len:e.length}),t.pass(ls._`${o} <= ${e.length}`);else if(typeof n=="object"&&!zm.alwaysValidSchema(i,n)){let u=r.var("valid",ls._`${o} <= ${e.length}`);r.if(ls.not(u),()=>f(u)),t.ok(u)}function f(u){r.forRange("i",e.length,o,l=>{t.subschema({keyword:s,dataProp:l,dataPropType:zm.Type.Num},u),i.allErrors||r.if(ls.not(u),()=>r.break())})}}xo.validateAdditionalItems=Ib;xo.default=wI});var Qm=C(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.validateTuple=void 0;var kb=Q(),sl=ae(),$I=et(),OI={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Sb(t,"additionalItems",e);r.items=!0,!sl.alwaysValidSchema(r,e)&&t.ok($I.validateArray(t))}};function Sb(t,e,r=t.schema){let{gen:n,parentSchema:a,data:s,keyword:i,it:o}=t;l(a),o.opts.unevaluated&&r.length&&o.items!==!0&&(o.items=sl.mergeEvaluated.items(n,r.length,o.items));let f=n.name("valid"),u=n.const("len",kb._`${s}.length`);r.forEach((_,b)=>{sl.alwaysValidSchema(o,_)||(n.if(kb._`${u} > ${b}`,()=>t.subschema({keyword:i,schemaProp:b,dataProp:b},f)),t.ok(f))});function l(_){let{opts:b,errSchemaPath:w}=o,y=r.length,j=y===_.minItems&&(y===_.maxItems||_[e]===!1);if(b.strictTuples&&!j){let I=`"${i}" is ${y}-tuple, but minItems or maxItems/${e} are not specified or different at path "${w}"`;sl.checkStrictMode(o,I,b.strictTuples)}}}Fo.validateTuple=Sb;Fo.default=OI});var Cb=C(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});var vI=Qm(),jI={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>vI.validateTuple(t,"items")};Jm.default=jI});var Gb=C(Xm=>{"use strict";Object.defineProperty(Xm,"__esModule",{value:!0});var Pb=Q(),II=ae(),kI=et(),SI=Km(),CI={message:({params:{len:t}})=>Pb.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>Pb._`{limit: ${t}}`},PI={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:CI,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:a}=r;n.items=!0,!II.alwaysValidSchema(n,e)&&(a?SI.validateAdditionalItems(t,a):t.ok(kI.validateArray(t)))}};Xm.default=PI});var Db=C(Ym=>{"use strict";Object.defineProperty(Ym,"__esModule",{value:!0});var ot=Q(),il=ae(),GI={message:({params:{min:t,max:e}})=>e===void 0?ot.str`must contain at least ${t} valid item(s)`:ot.str`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?ot._`{minContains: ${t}}`:ot._`{minContains: ${t}, maxContains: ${e}}`},DI={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:GI,code(t){let{gen:e,schema:r,parentSchema:n,data:a,it:s}=t,i,o,{minContains:f,maxContains:u}=n;s.opts.next?(i=f===void 0?1:f,o=u):i=1;let l=e.const("len",ot._`${a}.length`);if(t.setParams({min:i,max:o}),o===void 0&&i===0){il.checkStrictMode(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(o!==void 0&&i>o){il.checkStrictMode(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if(il.alwaysValidSchema(s,r)){let y=ot._`${l} >= ${i}`;o!==void 0&&(y=ot._`${y} && ${l} <= ${o}`),t.pass(y);return}s.items=!0;let _=e.name("valid");if(o===void 0&&i===1)b(_,()=>e.if(_,()=>e.break()));else{e.let(_,!1);let y=e.name("_valid"),j=e.let("count",0);b(y,()=>e.if(y,()=>w(j)))}t.result(_,()=>t.reset());function b(y,j){e.forRange("i",0,l,I=>{t.subschema({keyword:"contains",dataProp:I,dataPropType:il.Type.Num,compositeRule:!0},y),j()})}function w(y){e.code(ot._`${y}++`),o===void 0?e.if(ot._`${y} >= ${i}`,()=>e.assign(_,!0).break()):(e.if(ot._`${y} > ${o}`,()=>e.assign(_,!1).break()),i===1?e.assign(_,!0):e.if(ot._`${y} >= ${i}`,()=>e.assign(_,!0)))}}};Ym.default=DI});var Eb=C(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.validateSchemaDeps=Ot.validatePropertyDeps=Ot.error=void 0;var Zm=Q(),MI=ae(),wo=et();Ot.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return Zm.str`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>Zm._`{property: ${t},
|
|
13
|
+
|| ${i} === "boolean" || ${a} === null`).assign(o,L._`[${a}]`)}}}function JO({gen:t,parentData:e,parentDataProperty:r},n){t.if(L._`${e} !== undefined`,()=>t.assign(L._`${e}[${r}]`,n))}function om(t,e,r,n=so.Correct){let a=n===so.Correct?L.operators.EQ:L.operators.NEQ,s;switch(t){case"null":return L._`${e} ${a} null`;case"array":s=L._`Array.isArray(${e})`;break;case"object":s=L._`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=i(L._`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=i();break;default:return L._`typeof ${e} ${a} ${t}`}return n===so.Correct?s:L.not(s);function i(o=L.nil){return L.and(L._`typeof ${e} == "number"`,o,r?L._`isFinite(${e})`:L.nil)}}Se.checkDataType=om;function pm(t,e,r,n){if(t.length===1)return om(t[0],e,r,n);let a,s=_y.toHash(t);if(s.array&&s.object){let i=L._`typeof ${e} != "object"`;a=s.null?i:L._`!${e} || ${i}`,delete s.null,delete s.array,delete s.object}else a=L.nil;s.number&&delete s.integer;for(let i in s)a=L.and(a,om(i,e,r,n));return a}Se.checkDataTypes=pm;var XO={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?L._`{type: ${t}}`:L._`{type: ${e}}`};function fm(t){let e=YO(t);VO.reportError(e,XO)}Se.reportTypeError=fm;function YO(t){let{gen:e,data:r,schema:n}=t,a=_y.schemaRefOrVal(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:a,schemaValue:a,parentSchema:n,params:{},it:t}}});var xy=C(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.assignDefaults=void 0;var pi=Q(),ZO=ae();function ev(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let a in r)by(t,a,r[a].default);else e==="array"&&Array.isArray(n)&&n.forEach((a,s)=>by(t,s,a.default))}Vd.assignDefaults=ev;function by(t,e,r){let{gen:n,compositeRule:a,data:s,opts:i}=t;if(r===void 0)return;let o=pi._`${s}${pi.getProperty(e)}`;if(a){ZO.checkStrictMode(t,`default is ignored for: ${o}`);return}let f=pi._`${o} === undefined`;i.useDefaults==="empty"&&(f=pi._`${f} || ${o} === null || ${o} === ""`),n.if(f,pi._`${o} = ${pi.stringify(r)}`)}});var et=C(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.validateUnion=fe.validateArray=fe.usePattern=fe.callValidateCode=fe.schemaProperties=fe.allSchemaProperties=fe.noPropertyInData=fe.propertyInData=fe.isOwnProperty=fe.hasPropFunc=fe.reportMissingProp=fe.checkMissingProp=fe.checkReportMissingProp=void 0;var ge=Q(),um=ae(),ga=Kr();function tv(t,e){let{gen:r,data:n,it:a}=t;r.if(lm(r,n,e,a.opts.ownProperties),()=>{t.setParams({missingProperty:ge._`${e}`},!0),t.error()})}fe.checkReportMissingProp=tv;function rv({gen:t,data:e,it:{opts:r}},n,a){return ge.or(...n.map(s=>ge.and(lm(t,e,s,r.ownProperties),ge._`${a} = ${s}`)))}fe.checkMissingProp=rv;function nv(t,e){t.setParams({missingProperty:e},!0),t.error()}fe.reportMissingProp=nv;function Fy(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:ge._`Object.prototype.hasOwnProperty`})}fe.hasPropFunc=Fy;function dm(t,e,r){return ge._`${Fy(t)}.call(${e}, ${r})`}fe.isOwnProperty=dm;function av(t,e,r,n){let a=ge._`${e}${ge.getProperty(r)} !== undefined`;return n?ge._`${a} && ${dm(t,e,r)}`:a}fe.propertyInData=av;function lm(t,e,r,n){let a=ge._`${e}${ge.getProperty(r)} === undefined`;return n?ge.or(a,ge.not(dm(t,e,r))):a}fe.noPropertyInData=lm;function wy(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}fe.allSchemaProperties=wy;function sv(t,e){return wy(e).filter(r=>!um.alwaysValidSchema(t,e[r]))}fe.schemaProperties=sv;function iv({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:a,errorPath:s},it:i},o,f,u){let l=u?ge._`${t}, ${e}, ${n}${a}`:e,_=[[ga.default.instancePath,ge.strConcat(ga.default.instancePath,s)],[ga.default.parentData,i.parentData],[ga.default.parentDataProperty,i.parentDataProperty],[ga.default.rootData,ga.default.rootData]];i.opts.dynamicRef&&_.push([ga.default.dynamicAnchors,ga.default.dynamicAnchors]);let b=ge._`${l}, ${r.object(..._)}`;return f!==ge.nil?ge._`${o}.call(${f}, ${b})`:ge._`${o}(${b})`}fe.callValidateCode=iv;function ov({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"";return t.scopeValue("pattern",{key:r,ref:new RegExp(r,n),code:ge._`new RegExp(${r}, ${n})`})}fe.usePattern=ov;function pv(t){let{gen:e,data:r,keyword:n,it:a}=t,s=e.name("valid");if(a.allErrors){let o=e.let("valid",!0);return i(()=>e.assign(o,!1)),o}return e.var(s,!0),i(()=>e.break()),s;function i(o){let f=e.const("len",ge._`${r}.length`);e.forRange("i",0,f,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:um.Type.Num},s),e.if(ge.not(s),o)})}}fe.validateArray=pv;function fv(t){let{gen:e,schema:r,keyword:n,it:a}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(f=>um.alwaysValidSchema(a,f))&&!a.opts.unevaluated)return;let i=e.let("valid",!1),o=e.name("_valid");e.block(()=>r.forEach((f,u)=>{let l=t.subschema({keyword:n,schemaProp:u,compositeRule:!0},o);e.assign(i,ge._`${i} || ${o}`),t.mergeValidEvaluated(l,o)||e.if(ge.not(i))})),t.result(i,()=>t.reset(),()=>t.error(!0))}fe.validateUnion=fv});var vy=C(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.validateKeywordUsage=wt.validSchemaType=wt.funcKeywordCode=wt.macroKeywordCode=void 0;var qe=Q(),ps=Kr(),uv=et(),dv=ao();function lv(t,e){let{gen:r,keyword:n,schema:a,parentSchema:s,it:i}=t,o=e.macro.call(i.self,a,s,i),f=Oy(r,n,o);i.opts.validateSchema!==!1&&i.self.validateSchema(o,!0);let u=r.name("valid");t.subschema({schema:o,schemaPath:qe.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}wt.macroKeywordCode=lv;function cv(t,e){var r;let{gen:n,keyword:a,schema:s,parentSchema:i,$data:o,it:f}=t;hv(f,e);let u=!o&&e.compile?e.compile.call(f.self,s,i,f):e.validate,l=Oy(n,a,u),_=n.let("valid");t.block$data(_,b),t.ok((r=e.valid)!==null&&r!==void 0?r:_);function b(){if(e.errors===!1)j(),e.modifying&&$y(t),I(()=>t.error());else{let k=e.async?w():y();e.modifying&&$y(t),I(()=>mv(t,k))}}function w(){let k=n.let("ruleErrs",null);return n.try(()=>j(qe._`await `),A=>n.assign(_,!1).if(qe._`${A} instanceof ${f.ValidationError}`,()=>n.assign(k,qe._`${A}.errors`),()=>n.throw(A))),k}function y(){let k=qe._`${l}.errors`;return n.assign(k,null),j(qe.nil),k}function j(k=e.async?qe._`await `:qe.nil){let A=f.opts.passContext?ps.default.this:ps.default.self,ce=!("compile"in e&&!o||e.schema===!1);n.assign(_,qe._`${k}${uv.callValidateCode(t,l,A,ce)}`,e.modifying)}function I(k){var A;n.if(qe.not((A=e.valid)!==null&&A!==void 0?A:_),k)}}wt.funcKeywordCode=cv;function $y(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,qe._`${n.parentData}[${n.parentDataProperty}]`))}function mv(t,e){let{gen:r}=t;r.if(qe._`Array.isArray(${e})`,()=>{r.assign(ps.default.vErrors,qe._`${ps.default.vErrors} === null ? ${e} : ${ps.default.vErrors}.concat(${e})`).assign(ps.default.errors,qe._`${ps.default.vErrors}.length`),dv.extendErrors(t)},()=>t.error())}function hv({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Oy(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:qe.stringify(r)})}function gv(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t=="undefined")}wt.validSchemaType=gv;function _v({schema:t,opts:e,self:r,errSchemaPath:n},a,s){if(Array.isArray(a.keyword)?!a.keyword.includes(s):a.keyword!==s)throw new Error("ajv implementation error");let i=a.dependencies;if(i==null?void 0:i.some(o=>!Object.prototype.hasOwnProperty.call(t,o)))throw new Error(`parent schema must have dependencies of ${s}: ${i.join(",")}`);if(a.validateSchema&&!a.validateSchema(t[s])){let f=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(a.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(f);else throw new Error(f)}}wt.validateKeywordUsage=_v});var Iy=C(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});_a.extendSubschemaMode=_a.extendSubschemaData=_a.getSubschema=void 0;var $t=Q(),jy=ae();function Tv(t,{keyword:e,schemaProp:r,schema:n,schemaPath:a,errSchemaPath:s,topSchemaRef:i}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let o=t.schema[e];return r===void 0?{schema:o,schemaPath:$t._`${t.schemaPath}${$t.getProperty(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:o[r],schemaPath:$t._`${t.schemaPath}${$t.getProperty(e)}${$t.getProperty(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${jy.escapeFragment(r)}`}}if(n!==void 0){if(a===void 0||s===void 0||i===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:a,topSchemaRef:i,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}_a.getSubschema=Tv;function yv(t,e,{dataProp:r,dataPropType:n,data:a,dataTypes:s,propertyName:i}){if(a!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:o}=e;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:_}=e,b=o.let("data",$t._`${e.data}${$t.getProperty(r)}`,!0);f(b),t.errorPath=$t.str`${u}${jy.getErrorPath(r,n,_.jsPropertySyntax)}`,t.parentDataProperty=$t._`${r}`,t.dataPathArr=[...l,t.parentDataProperty]}if(a!==void 0){let u=a instanceof $t.Name?a:o.let("data",a,!0);f(u),i!==void 0&&(t.propertyName=i)}s&&(t.dataTypes=s);function f(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}_a.extendSubschemaData=yv;function bv(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:a,allErrors:s}){n!==void 0&&(t.compositeRule=n),a!==void 0&&(t.createErrors=a),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}_a.extendSubschemaMode=bv});var cm=C((Q9,ky)=>{"use strict";ky.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,a,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(a=n;a--!=0;)if(!t(e[a],r[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(a=n;a--!=0;)if(!Object.prototype.hasOwnProperty.call(r,s[a]))return!1;for(a=n;a--!=0;){var i=s[a];if(!t(e[i],r[i]))return!1}return!0}return e!==e&&r!==r}});var Cy=C((J9,Sy)=>{"use strict";var Ta=Sy.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},a=r.post||function(){};Hd(e,n,a,t,"",t)};Ta.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ta.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ta.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ta.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Hd(t,e,r,n,a,s,i,o,f,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,a,s,i,o,f,u);for(var l in n){var _=n[l];if(Array.isArray(_)){if(l in Ta.arrayKeywords)for(var b=0;b<_.length;b++)Hd(t,e,r,_[b],a+"/"+l+"/"+b,s,a,l,n,b)}else if(l in Ta.propsKeywords){if(_&&typeof _=="object")for(var w in _)Hd(t,e,r,_[w],a+"/"+l+"/"+xv(w),s,a,l,n,w)}else(l in Ta.keywords||t.allKeys&&!(l in Ta.skipKeywords))&&Hd(t,e,r,_,a+"/"+l,s,a,l,n)}r(n,a,s,i,o,f,u)}}function xv(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var mm=C((zd,Py)=>{(function(t,e){typeof zd=="object"&&typeof Py!="undefined"?e(zd):typeof define=="function"&&define.amd?define(["exports"],e):e(t.URI=t.URI||{})})(zd,function(t){"use strict";function e(){for(var c=arguments.length,d=Array(c),T=0;T<c;T++)d[T]=arguments[T];if(d.length>1){d[0]=d[0].slice(0,-1);for(var $=d.length-1,O=1;O<$;++O)d[O]=d[O].slice(1,-1);return d[$]=d[$].slice(1),d.join("")}else return d[0]}function r(c){return"(?:"+c+")"}function n(c){return c===void 0?"undefined":c===null?"null":Object.prototype.toString.call(c).split(" ").pop().split("]").shift().toLowerCase()}function a(c){return c.toUpperCase()}function s(c){return c!=null?c instanceof Array?c:typeof c.length!="number"||c.split||c.setInterval||c.call?[c]:Array.prototype.slice.call(c):[]}function i(c,d){var T=c;if(d)for(var $ in d)T[$]=d[$];return T}function o(c){var d="[A-Za-z]",T="[\\x0D]",$="[0-9]",O="[\\x22]",W=e($,"[A-Fa-f]"),B="[\\x0A]",te="[\\x20]",se=r(r("%[EFef]"+W+"%"+W+W+"%"+W+W)+"|"+r("%[89A-Fa-f]"+W+"%"+W+W)+"|"+r("%"+W+W)),we="[\\:\\/\\?\\#\\[\\]\\@]",Z="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",_e=e(we,Z),$e=c?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",he=c?"[\\uE000-\\uF8FF]":"[]",ne=e(d,$,"[\\-\\.\\_\\~]",$e),Te=r(d+e(d,$,"[\\+\\-\\.]")+"*"),oe=r(r(se+"|"+e(ne,Z,"[\\:]"))+"*"),Xa=r(r("25[0-5]")+"|"+r("2[0-4]"+$)+"|"+r("1"+$+$)+"|"+r("[1-9]"+$)+"|"+$),He=r(r("25[0-5]")+"|"+r("2[0-4]"+$)+"|"+r("1"+$+$)+"|"+r("0?[1-9]"+$)+"|0?0?"+$),Xe=r(He+"\\."+He+"\\."+He+"\\."+He),ue=r(W+"{1,4}"),ze=r(r(ue+"\\:"+ue)+"|"+Xe),Ye=r(r(ue+"\\:")+"{6}"+ze),_t=r("\\:\\:"+r(ue+"\\:")+"{5}"+ze),Ya=r(r(ue)+"?\\:\\:"+r(ue+"\\:")+"{4}"+ze),Er=r(r(r(ue+"\\:")+"{0,1}"+ue)+"?\\:\\:"+r(ue+"\\:")+"{3}"+ze),Ri=r(r(r(ue+"\\:")+"{0,2}"+ue)+"?\\:\\:"+r(ue+"\\:")+"{2}"+ze),id=r(r(r(ue+"\\:")+"{0,3}"+ue)+"?\\:\\:"+ue+"\\:"+ze),od=r(r(r(ue+"\\:")+"{0,4}"+ue)+"?\\:\\:"+ze),Js=r(r(r(ue+"\\:")+"{0,5}"+ue)+"?\\:\\:"+ue),Xs=r(r(r(ue+"\\:")+"{0,6}"+ue)+"?\\:\\:"),Rr=r([Ye,_t,Ya,Er,Ri,id,od,Js,Xs].join("|")),Ys=r(r(ne+"|"+se)+"+"),ic=r(Rr+"\\%25"+Ys),Za=r(Rr+r("\\%25|\\%(?!"+W+"{2})")+Ys),mF=r("[vV]"+W+"+\\."+e(ne,Z,"[\\:]")+"+"),hF=r("\\["+r(Za+"|"+Rr+"|"+mF)+"\\]"),Gg=r(r(se+"|"+e(ne,Z))+"*"),Ai=r(hF+"|"+Xe+"(?!"+Gg+")|"+Gg),Ui=r($+"*"),Dg=r(r(oe+"@")+"?"+Ai+r("\\:"+Ui)+"?"),qi=r(se+"|"+e(ne,Z,"[\\:\\@]")),gF=r(qi+"*"),Mg=r(qi+"+"),_F=r(r(se+"|"+e(ne,Z,"[\\@]"))+"+"),Ar=r(r("\\/"+gF)+"*"),Zs=r("\\/"+r(Mg+Ar)+"?"),oc=r(_F+Ar),pd=r(Mg+Ar),ei="(?!"+qi+")",x4=r(Ar+"|"+Zs+"|"+oc+"|"+pd+"|"+ei),ti=r(r(qi+"|"+e("[\\/\\?]",he))+"*"),Ni=r(r(qi+"|[\\/\\?]")+"*"),Wg=r(r("\\/\\/"+Dg+Ar)+"|"+Zs+"|"+pd+"|"+ei),TF=r(Te+"\\:"+Wg+r("\\?"+ti)+"?"+r("\\#"+Ni)+"?"),yF=r(r("\\/\\/"+Dg+Ar)+"|"+Zs+"|"+oc+"|"+ei),bF=r(yF+r("\\?"+ti)+"?"+r("\\#"+Ni)+"?"),F4=r(TF+"|"+bF),w4=r(Te+"\\:"+Wg+r("\\?"+ti)+"?"),$4="^("+Te+")\\:"+r(r("\\/\\/("+r("("+oe+")@")+"?("+Ai+")"+r("\\:("+Ui+")")+"?)")+"?("+Ar+"|"+Zs+"|"+pd+"|"+ei+")")+r("\\?("+ti+")")+"?"+r("\\#("+Ni+")")+"?$",O4="^(){0}"+r(r("\\/\\/("+r("("+oe+")@")+"?("+Ai+")"+r("\\:("+Ui+")")+"?)")+"?("+Ar+"|"+Zs+"|"+oc+"|"+ei+")")+r("\\?("+ti+")")+"?"+r("\\#("+Ni+")")+"?$",v4="^("+Te+")\\:"+r(r("\\/\\/("+r("("+oe+")@")+"?("+Ai+")"+r("\\:("+Ui+")")+"?)")+"?("+Ar+"|"+Zs+"|"+pd+"|"+ei+")")+r("\\?("+ti+")")+"?$",j4="^"+r("\\#("+Ni+")")+"?$",I4="^"+r("("+oe+")@")+"?("+Ai+")"+r("\\:("+Ui+")")+"?$";return{NOT_SCHEME:new RegExp(e("[^]",d,$,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(e("[^\\%\\:]",ne,Z),"g"),NOT_HOST:new RegExp(e("[^\\%\\[\\]\\:]",ne,Z),"g"),NOT_PATH:new RegExp(e("[^\\%\\/\\:\\@]",ne,Z),"g"),NOT_PATH_NOSCHEME:new RegExp(e("[^\\%\\/\\@]",ne,Z),"g"),NOT_QUERY:new RegExp(e("[^\\%]",ne,Z,"[\\:\\@\\/\\?]",he),"g"),NOT_FRAGMENT:new RegExp(e("[^\\%]",ne,Z,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(e("[^]",ne,Z),"g"),UNRESERVED:new RegExp(ne,"g"),OTHER_CHARS:new RegExp(e("[^\\%]",ne,_e),"g"),PCT_ENCODED:new RegExp(se,"g"),IPV4ADDRESS:new RegExp("^("+Xe+")$"),IPV6ADDRESS:new RegExp("^\\[?("+Rr+")"+r(r("\\%25|\\%(?!"+W+"{2})")+"("+Ys+")")+"?\\]?$")}}var f=o(!1),u=o(!0),l=function(){function c(d,T){var $=[],O=!0,W=!1,B=void 0;try{for(var te=d[Symbol.iterator](),se;!(O=(se=te.next()).done)&&($.push(se.value),!(T&&$.length===T));O=!0);}catch(we){W=!0,B=we}finally{try{!O&&te.return&&te.return()}finally{if(W)throw B}}return $}return function(d,T){if(Array.isArray(d))return d;if(Symbol.iterator in Object(d))return c(d,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=function(c){if(Array.isArray(c)){for(var d=0,T=Array(c.length);d<c.length;d++)T[d]=c[d];return T}else return Array.from(c)},b=2147483647,w=36,y=1,j=26,I=38,k=700,A=72,ce=128,Y="-",z=/^xn--/,be=/[^\0-\x7E]/,Ge=/[\x2E\u3002\uFF0E\uFF61]/g,Qa={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Vs=w-y,ct=Math.floor,tc=String.fromCharCode;function Ja(c){throw new RangeError(Qa[c])}function Lx(c,d){for(var T=[],$=c.length;$--;)T[$]=d(c[$]);return T}function gg(c,d){var T=c.split("@"),$="";T.length>1&&($=T[0]+"@",c=T[1]),c=c.replace(Ge,".");var O=c.split("."),W=Lx(O,d).join(".");return $+W}function _g(c){for(var d=[],T=0,$=c.length;T<$;){var O=c.charCodeAt(T++);if(O>=55296&&O<=56319&&T<$){var W=c.charCodeAt(T++);(W&64512)==56320?d.push(((O&1023)<<10)+(W&1023)+65536):(d.push(O),T--)}else d.push(O)}return d}var Vx=function(d){return String.fromCodePoint.apply(String,_(d))},Hx=function(d){return d-48<10?d-22:d-65<26?d-65:d-97<26?d-97:w},Tg=function(d,T){return d+22+75*(d<26)-((T!=0)<<5)},D=function(d,T,$){var O=0;for(d=$?ct(d/k):d>>1,d+=ct(d/T);d>Vs*j>>1;O+=w)d=ct(d/Vs);return ct(O+(Vs+1)*d/(d+I))},yg=function(d){var T=[],$=d.length,O=0,W=ce,B=A,te=d.lastIndexOf(Y);te<0&&(te=0);for(var se=0;se<te;++se)d.charCodeAt(se)>=128&&Ja("not-basic"),T.push(d.charCodeAt(se));for(var we=te>0?te+1:0;we<$;){for(var Z=O,_e=1,$e=w;;$e+=w){we>=$&&Ja("invalid-input");var he=Hx(d.charCodeAt(we++));(he>=w||he>ct((b-O)/_e))&&Ja("overflow"),O+=he*_e;var ne=$e<=B?y:$e>=B+j?j:$e-B;if(he<ne)break;var Te=w-ne;_e>ct(b/Te)&&Ja("overflow"),_e*=Te}var oe=T.length+1;B=D(O-Z,oe,Z==0),ct(O/oe)>b-W&&Ja("overflow"),W+=ct(O/oe),O%=oe,T.splice(O++,0,W)}return String.fromCodePoint.apply(String,T)},bg=function(d){var T=[];d=_g(d);var $=d.length,O=ce,W=0,B=A,te=!0,se=!1,we=void 0;try{for(var Z=d[Symbol.iterator](),_e;!(te=(_e=Z.next()).done);te=!0){var $e=_e.value;$e<128&&T.push(tc($e))}}catch(Za){se=!0,we=Za}finally{try{!te&&Z.return&&Z.return()}finally{if(se)throw we}}var he=T.length,ne=he;for(he&&T.push(Y);ne<$;){var Te=b,oe=!0,Xa=!1,He=void 0;try{for(var Xe=d[Symbol.iterator](),ue;!(oe=(ue=Xe.next()).done);oe=!0){var ze=ue.value;ze>=O&&ze<Te&&(Te=ze)}}catch(Za){Xa=!0,He=Za}finally{try{!oe&&Xe.return&&Xe.return()}finally{if(Xa)throw He}}var Ye=ne+1;Te-O>ct((b-W)/Ye)&&Ja("overflow"),W+=(Te-O)*Ye,O=Te;var _t=!0,Ya=!1,Er=void 0;try{for(var Ri=d[Symbol.iterator](),id;!(_t=(id=Ri.next()).done);_t=!0){var od=id.value;if(od<O&&++W>b&&Ja("overflow"),od==O){for(var Js=W,Xs=w;;Xs+=w){var Rr=Xs<=B?y:Xs>=B+j?j:Xs-B;if(Js<Rr)break;var Ys=Js-Rr,ic=w-Rr;T.push(tc(Tg(Rr+Ys%ic,0))),Js=ct(Ys/ic)}T.push(tc(Tg(Js,0))),B=D(W,Ye,ne==he),W=0,++ne}}}catch(Za){Ya=!0,Er=Za}finally{try{!_t&&Ri.return&&Ri.return()}finally{if(Ya)throw Er}}++W,++O}return T.join("")},zx=function(d){return gg(d,function(T){return z.test(T)?yg(T.slice(4).toLowerCase()):T})},Kx=function(d){return gg(d,function(T){return be.test(T)?"xn--"+bg(T):T})},Hs={version:"2.1.0",ucs2:{decode:_g,encode:Vx},decode:yg,encode:bg,toASCII:Kx,toUnicode:zx},Je={};function mt(c){var d=c.charCodeAt(0),T=void 0;return d<16?T="%0"+d.toString(16).toUpperCase():d<128?T="%"+d.toString(16).toUpperCase():d<2048?T="%"+(d>>6|192).toString(16).toUpperCase()+"%"+(d&63|128).toString(16).toUpperCase():T="%"+(d>>12|224).toString(16).toUpperCase()+"%"+(d>>6&63|128).toString(16).toUpperCase()+"%"+(d&63|128).toString(16).toUpperCase(),T}function zs(c){for(var d="",T=0,$=c.length;T<$;){var O=parseInt(c.substr(T+1,2),16);if(O<128)d+=String.fromCharCode(O),T+=3;else if(O>=194&&O<224){if($-T>=6){var W=parseInt(c.substr(T+4,2),16);d+=String.fromCharCode((O&31)<<6|W&63)}else d+=c.substr(T,6);T+=6}else if(O>=224){if($-T>=9){var B=parseInt(c.substr(T+4,2),16),te=parseInt(c.substr(T+7,2),16);d+=String.fromCharCode((O&15)<<12|(B&63)<<6|te&63)}else d+=c.substr(T,9);T+=9}else d+=c.substr(T,3),T+=3}return d}function rc(c,d){function T($){var O=zs($);return O.match(d.UNRESERVED)?O:$}return c.scheme&&(c.scheme=String(c.scheme).replace(d.PCT_ENCODED,T).toLowerCase().replace(d.NOT_SCHEME,"")),c.userinfo!==void 0&&(c.userinfo=String(c.userinfo).replace(d.PCT_ENCODED,T).replace(d.NOT_USERINFO,mt).replace(d.PCT_ENCODED,a)),c.host!==void 0&&(c.host=String(c.host).replace(d.PCT_ENCODED,T).toLowerCase().replace(d.NOT_HOST,mt).replace(d.PCT_ENCODED,a)),c.path!==void 0&&(c.path=String(c.path).replace(d.PCT_ENCODED,T).replace(c.scheme?d.NOT_PATH:d.NOT_PATH_NOSCHEME,mt).replace(d.PCT_ENCODED,a)),c.query!==void 0&&(c.query=String(c.query).replace(d.PCT_ENCODED,T).replace(d.NOT_QUERY,mt).replace(d.PCT_ENCODED,a)),c.fragment!==void 0&&(c.fragment=String(c.fragment).replace(d.PCT_ENCODED,T).replace(d.NOT_FRAGMENT,mt).replace(d.PCT_ENCODED,a)),c}function nc(c){return c.replace(/^0*(.*)/,"$1")||"0"}function ac(c,d){var T=c.match(d.IPV4ADDRESS)||[],$=l(T,2),O=$[1];return O?O.split(".").map(nc).join("."):c}function xg(c,d){var T=c.match(d.IPV6ADDRESS)||[],$=l(T,3),O=$[1],W=$[2];if(O){for(var B=O.toLowerCase().split("::").reverse(),te=l(B,2),se=te[0],we=te[1],Z=we?we.split(":").map(nc):[],_e=se.split(":").map(nc),$e=d.IPV4ADDRESS.test(_e[_e.length-1]),he=$e?7:8,ne=_e.length-he,Te=Array(he),oe=0;oe<he;++oe)Te[oe]=Z[oe]||_e[ne+oe]||"";$e&&(Te[he-1]=ac(Te[he-1],d));var Xa=Te.reduce(function(Ye,_t,Ya){if(!_t||_t==="0"){var Er=Ye[Ye.length-1];Er&&Er.index+Er.length===Ya?Er.length++:Ye.push({index:Ya,length:1})}return Ye},[]),He=Xa.sort(function(Ye,_t){return _t.length-Ye.length})[0],Xe=void 0;if(He&&He.length>1){var ue=Te.slice(0,He.index),ze=Te.slice(He.index+He.length);Xe=ue.join(":")+"::"+ze.join(":")}else Xe=Te.join(":");return W&&(Xe+="%"+W),Xe}else return c}var Qx=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,S="".match(/(){0}/)[1]===void 0;function Mr(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},T={},$=d.iri!==!1?u:f;d.reference==="suffix"&&(c=(d.scheme?d.scheme+":":"")+"//"+c);var O=c.match(Qx);if(O){S?(T.scheme=O[1],T.userinfo=O[3],T.host=O[4],T.port=parseInt(O[5],10),T.path=O[6]||"",T.query=O[7],T.fragment=O[8],isNaN(T.port)&&(T.port=O[5])):(T.scheme=O[1]||void 0,T.userinfo=c.indexOf("@")!==-1?O[3]:void 0,T.host=c.indexOf("//")!==-1?O[4]:void 0,T.port=parseInt(O[5],10),T.path=O[6]||"",T.query=c.indexOf("?")!==-1?O[7]:void 0,T.fragment=c.indexOf("#")!==-1?O[8]:void 0,isNaN(T.port)&&(T.port=c.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?O[4]:void 0)),T.host&&(T.host=xg(ac(T.host,$),$)),T.scheme===void 0&&T.userinfo===void 0&&T.host===void 0&&T.port===void 0&&!T.path&&T.query===void 0?T.reference="same-document":T.scheme===void 0?T.reference="relative":T.fragment===void 0?T.reference="absolute":T.reference="uri",d.reference&&d.reference!=="suffix"&&d.reference!==T.reference&&(T.error=T.error||"URI is not a "+d.reference+" reference.");var W=Je[(d.scheme||T.scheme||"").toLowerCase()];if(!d.unicodeSupport&&(!W||!W.unicodeSupport)){if(T.host&&(d.domainHost||W&&W.domainHost))try{T.host=Hs.toASCII(T.host.replace($.PCT_ENCODED,zs).toLowerCase())}catch(B){T.error=T.error||"Host's domain name can not be converted to ASCII via punycode: "+B}rc(T,f)}else rc(T,$);W&&W.parse&&W.parse(T,d)}else T.error=T.error||"URI can not be parsed.";return T}function Jx(c,d){var T=d.iri!==!1?u:f,$=[];return c.userinfo!==void 0&&($.push(c.userinfo),$.push("@")),c.host!==void 0&&$.push(xg(ac(String(c.host),T),T).replace(T.IPV6ADDRESS,function(O,W,B){return"["+W+(B?"%25"+B:"")+"]"})),(typeof c.port=="number"||typeof c.port=="string")&&($.push(":"),$.push(String(c.port))),$.length?$.join(""):void 0}var Fg=/^\.\.?\//,wg=/^\/\.(\/|$)/,$g=/^\/\.\.(\/|$)/,Xx=/^\/?(?:.|\n)*?(?=\/|$)/;function Ks(c){for(var d=[];c.length;)if(c.match(Fg))c=c.replace(Fg,"");else if(c.match(wg))c=c.replace(wg,"/");else if(c.match($g))c=c.replace($g,"/"),d.pop();else if(c==="."||c==="..")c="";else{var T=c.match(Xx);if(T){var $=T[0];c=c.slice($.length),d.push($)}else throw new Error("Unexpected dot segment condition")}return d.join("")}function ht(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},T=d.iri?u:f,$=[],O=Je[(d.scheme||c.scheme||"").toLowerCase()];if(O&&O.serialize&&O.serialize(c,d),c.host&&!T.IPV6ADDRESS.test(c.host)){if(d.domainHost||O&&O.domainHost)try{c.host=d.iri?Hs.toUnicode(c.host):Hs.toASCII(c.host.replace(T.PCT_ENCODED,zs).toLowerCase())}catch(te){c.error=c.error||"Host's domain name can not be converted to "+(d.iri?"Unicode":"ASCII")+" via punycode: "+te}}rc(c,T),d.reference!=="suffix"&&c.scheme&&($.push(c.scheme),$.push(":"));var W=Jx(c,d);if(W!==void 0&&(d.reference!=="suffix"&&$.push("//"),$.push(W),c.path&&c.path.charAt(0)!=="/"&&$.push("/")),c.path!==void 0){var B=c.path;!d.absolutePath&&(!O||!O.absolutePath)&&(B=Ks(B)),W===void 0&&(B=B.replace(/^\/\//,"/%2F")),$.push(B)}return c.query!==void 0&&($.push("?"),$.push(c.query)),c.fragment!==void 0&&($.push("#"),$.push(c.fragment)),$.join("")}function Og(c,d){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},$=arguments[3],O={};return $||(c=Mr(ht(c,T),T),d=Mr(ht(d,T),T)),T=T||{},!T.tolerant&&d.scheme?(O.scheme=d.scheme,O.userinfo=d.userinfo,O.host=d.host,O.port=d.port,O.path=Ks(d.path||""),O.query=d.query):(d.userinfo!==void 0||d.host!==void 0||d.port!==void 0?(O.userinfo=d.userinfo,O.host=d.host,O.port=d.port,O.path=Ks(d.path||""),O.query=d.query):(d.path?(d.path.charAt(0)==="/"?O.path=Ks(d.path):((c.userinfo!==void 0||c.host!==void 0||c.port!==void 0)&&!c.path?O.path="/"+d.path:c.path?O.path=c.path.slice(0,c.path.lastIndexOf("/")+1)+d.path:O.path=d.path,O.path=Ks(O.path)),O.query=d.query):(O.path=c.path,d.query!==void 0?O.query=d.query:O.query=c.query),O.userinfo=c.userinfo,O.host=c.host,O.port=c.port),O.scheme=c.scheme),O.fragment=d.fragment,O}function Yx(c,d,T){var $=i({scheme:"null"},T);return ht(Og(Mr(c,$),Mr(d,$),$,!0),$)}function Zx(c,d){return typeof c=="string"?c=ht(Mr(c,d),d):n(c)==="object"&&(c=Mr(ht(c,d),d)),c}function eF(c,d,T){return typeof c=="string"?c=ht(Mr(c,T),T):n(c)==="object"&&(c=ht(c,T)),typeof d=="string"?d=ht(Mr(d,T),T):n(d)==="object"&&(d=ht(d,T)),c===d}function tF(c,d){return c&&c.toString().replace(!d||!d.iri?f.ESCAPE:u.ESCAPE,mt)}function Wr(c,d){return c&&c.toString().replace(!d||!d.iri?f.PCT_ENCODED:u.PCT_ENCODED,zs)}var Wi={scheme:"http",domainHost:!0,parse:function(d,T){return d.host||(d.error=d.error||"HTTP URIs must have a host."),d},serialize:function(d,T){var $=String(d.scheme).toLowerCase()==="https";return(d.port===($?443:80)||d.port==="")&&(d.port=void 0),d.path||(d.path="/"),d}},vg={scheme:"https",domainHost:Wi.domainHost,parse:Wi.parse,serialize:Wi.serialize};function v(c){return typeof c.secure=="boolean"?c.secure:String(c.scheme).toLowerCase()==="wss"}var Ei={scheme:"ws",domainHost:!0,parse:function(d,T){var $=d;return $.secure=v($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$},serialize:function(d,T){if((d.port===(v(d)?443:80)||d.port==="")&&(d.port=void 0),typeof d.secure=="boolean"&&(d.scheme=d.secure?"wss":"ws",d.secure=void 0),d.resourceName){var $=d.resourceName.split("?"),O=l($,2),W=O[0],B=O[1];d.path=W&&W!=="/"?W:void 0,d.query=B,d.resourceName=void 0}return d.fragment=void 0,d}},jg={scheme:"wss",domainHost:Ei.domainHost,parse:Ei.parse,serialize:Ei.serialize},rF={},nF=!0,Ig="[A-Za-z0-9\\-\\.\\_\\~"+(nF?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",gt="[0-9A-Fa-f]",aF=r(r("%[EFef]"+gt+"%"+gt+gt+"%"+gt+gt)+"|"+r("%[89A-Fa-f]"+gt+"%"+gt+gt)+"|"+r("%"+gt+gt)),sF="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",iF="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",oF=e(iF,'[\\"\\\\]'),pF="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",fF=new RegExp(Ig,"g"),Qs=new RegExp(aF,"g"),uF=new RegExp(e("[^]",sF,"[\\.]",'[\\"]',oF),"g"),kg=new RegExp(e("[^]",Ig,pF),"g"),dF=kg;function sc(c){var d=zs(c);return d.match(fF)?d:c}var Sg={scheme:"mailto",parse:function(d,T){var $=d,O=$.to=$.path?$.path.split(","):[];if($.path=void 0,$.query){for(var W=!1,B={},te=$.query.split("&"),se=0,we=te.length;se<we;++se){var Z=te[se].split("=");switch(Z[0]){case"to":for(var _e=Z[1].split(","),$e=0,he=_e.length;$e<he;++$e)O.push(_e[$e]);break;case"subject":$.subject=Wr(Z[1],T);break;case"body":$.body=Wr(Z[1],T);break;default:W=!0,B[Wr(Z[0],T)]=Wr(Z[1],T);break}}W&&($.headers=B)}$.query=void 0;for(var ne=0,Te=O.length;ne<Te;++ne){var oe=O[ne].split("@");if(oe[0]=Wr(oe[0]),T.unicodeSupport)oe[1]=Wr(oe[1],T).toLowerCase();else try{oe[1]=Hs.toASCII(Wr(oe[1],T).toLowerCase())}catch(Xa){$.error=$.error||"Email address's domain name can not be converted to ASCII via punycode: "+Xa}O[ne]=oe.join("@")}return $},serialize:function(d,T){var $=d,O=s(d.to);if(O){for(var W=0,B=O.length;W<B;++W){var te=String(O[W]),se=te.lastIndexOf("@"),we=te.slice(0,se).replace(Qs,sc).replace(Qs,a).replace(uF,mt),Z=te.slice(se+1);try{Z=T.iri?Hs.toUnicode(Z):Hs.toASCII(Wr(Z,T).toLowerCase())}catch(ne){$.error=$.error||"Email address's domain name can not be converted to "+(T.iri?"Unicode":"ASCII")+" via punycode: "+ne}O[W]=we+"@"+Z}$.path=O.join(",")}var _e=d.headers=d.headers||{};d.subject&&(_e.subject=d.subject),d.body&&(_e.body=d.body);var $e=[];for(var he in _e)_e[he]!==rF[he]&&$e.push(he.replace(Qs,sc).replace(Qs,a).replace(kg,mt)+"="+_e[he].replace(Qs,sc).replace(Qs,a).replace(dF,mt));return $e.length&&($.query=$e.join("&")),$}},lF=/^([^\:]+)\:(.*)/,Cg={scheme:"urn",parse:function(d,T){var $=d.path&&d.path.match(lF),O=d;if($){var W=T.scheme||O.scheme||"urn",B=$[1].toLowerCase(),te=$[2],se=W+":"+(T.nid||B),we=Je[se];O.nid=B,O.nss=te,O.path=void 0,we&&(O=we.parse(O,T))}else O.error=O.error||"URN can not be parsed.";return O},serialize:function(d,T){var $=T.scheme||d.scheme||"urn",O=d.nid,W=$+":"+(T.nid||O),B=Je[W];B&&(d=B.serialize(d,T));var te=d,se=d.nss;return te.path=(O||T.nid)+":"+se,te}},cF=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Pg={scheme:"urn:uuid",parse:function(d,T){var $=d;return $.uuid=$.nss,$.nss=void 0,!T.tolerant&&(!$.uuid||!$.uuid.match(cF))&&($.error=$.error||"UUID is not valid."),$},serialize:function(d,T){var $=d;return $.nss=(d.uuid||"").toLowerCase(),$}};Je[Wi.scheme]=Wi,Je[vg.scheme]=vg,Je[Ei.scheme]=Ei,Je[jg.scheme]=jg,Je[Sg.scheme]=Sg,Je[Cg.scheme]=Cg,Je[Pg.scheme]=Pg,t.SCHEMES=Je,t.pctEncChar=mt,t.pctDecChars=zs,t.parse=Mr,t.removeDotSegments=Ks,t.serialize=ht,t.resolveComponents=Og,t.resolve=Yx,t.normalize=Zx,t.equal=eF,t.escapeComponent=tF,t.unescapeComponent=Wr,Object.defineProperty(t,"__esModule",{value:!0})})});var oo=C(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.getSchemaRefs=Le.resolveUrl=Le.normalizeId=Le._getFullPath=Le.getFullPath=Le.inlineRef=void 0;var Fv=ae(),wv=cm(),$v=Cy(),Kd=mm(),Ov=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function vv(t,e=!0){return typeof t=="boolean"?!0:e===!0?!hm(t):e?Gy(t)<=e:!1}Le.inlineRef=vv;var jv=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function hm(t){for(let e in t){if(jv.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(hm)||typeof r=="object"&&hm(r))return!0}return!1}function Gy(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!Ov.has(r)&&(typeof t[r]=="object"&&Fv.eachItem(t[r],n=>e+=Gy(n)),e===1/0))return 1/0}return e}function Dy(t="",e){e!==!1&&(t=fi(t));let r=Kd.parse(t);return My(r)}Le.getFullPath=Dy;function My(t){return Kd.serialize(t).split("#")[0]+"#"}Le._getFullPath=My;var Iv=/#\/?$/;function fi(t){return t?t.replace(Iv,""):""}Le.normalizeId=fi;function kv(t,e){return e=fi(e),Kd.resolve(t,e)}Le.resolveUrl=kv;var Sv=/^[a-z_][-a-z0-9._]*$/i;function Cv(t){if(typeof t=="boolean")return{};let{schemaId:e}=this.opts,r=fi(t[e]),n={"":r},a=Dy(r,!1),s={},i=new Set;return $v(t,{allKeys:!0},(u,l,_,b)=>{if(b===void 0)return;let w=a+l,y=n[b];typeof u[e]=="string"&&(y=j.call(this,u[e])),I.call(this,u.$anchor),I.call(this,u.$dynamicAnchor),n[l]=y;function j(k){if(k=fi(y?Kd.resolve(y,k):k),i.has(k))throw f(k);i.add(k);let A=this.refs[k];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?o(u,A.schema,k):k!==fi(w)&&(k[0]==="#"?(o(u,s[k],k),s[k]=u):this.refs[k]=w),k}function I(k){if(typeof k=="string"){if(!Sv.test(k))throw new Error(`invalid anchor "${k}"`);j.call(this,`#${k}`)}}}),s;function o(u,l,_){if(l!==void 0&&!wv(u,l))throw f(_)}function f(u){return new Error(`reference "${u}" resolves to more than one schema`)}}Le.getSchemaRefs=Cv});var uo=C(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.getData=ya.KeywordCxt=ya.validateFunctionCode=void 0;var Wy=my(),Ey=io(),gm=im(),Qd=io(),Pv=xy(),po=vy(),_m=Iy(),E=Q(),N=Kr(),Gv=oo(),Qr=ae(),fo=ao();function Dv(t){if(qy(t)&&(Ny(t),Uy(t))){Ev(t);return}Ry(t,()=>Wy.topBoolOrEmptySchema(t))}ya.validateFunctionCode=Dv;function Ry({gen:t,validateName:e,schema:r,schemaEnv:n,opts:a},s){a.code.es5?t.func(e,E._`${N.default.data}, ${N.default.valCxt}`,n.$async,()=>{t.code(E._`"use strict"; ${Ay(r,a)}`),Wv(t,a),t.code(s)}):t.func(e,E._`${N.default.data}, ${Mv(a)}`,n.$async,()=>t.code(Ay(r,a)).code(s))}function Mv(t){return E._`{${N.default.instancePath}="", ${N.default.parentData}, ${N.default.parentDataProperty}, ${N.default.rootData}=${N.default.data}${t.dynamicRef?E._`, ${N.default.dynamicAnchors}={}`:E.nil}}={}`}function Wv(t,e){t.if(N.default.valCxt,()=>{t.var(N.default.instancePath,E._`${N.default.valCxt}.${N.default.instancePath}`),t.var(N.default.parentData,E._`${N.default.valCxt}.${N.default.parentData}`),t.var(N.default.parentDataProperty,E._`${N.default.valCxt}.${N.default.parentDataProperty}`),t.var(N.default.rootData,E._`${N.default.valCxt}.${N.default.rootData}`),e.dynamicRef&&t.var(N.default.dynamicAnchors,E._`${N.default.valCxt}.${N.default.dynamicAnchors}`)},()=>{t.var(N.default.instancePath,E._`""`),t.var(N.default.parentData,E._`undefined`),t.var(N.default.parentDataProperty,E._`undefined`),t.var(N.default.rootData,N.default.data),e.dynamicRef&&t.var(N.default.dynamicAnchors,E._`{}`)})}function Ev(t){let{schema:e,opts:r,gen:n}=t;Ry(t,()=>{r.$comment&&e.$comment&&Ly(t),Nv(t),n.let(N.default.vErrors,null),n.let(N.default.errors,0),r.unevaluated&&Rv(t),By(t),Vv(t)})}function Rv(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",E._`${r}.evaluated`),e.if(E._`${t.evaluated}.dynamicProps`,()=>e.assign(E._`${t.evaluated}.props`,E._`undefined`)),e.if(E._`${t.evaluated}.dynamicItems`,()=>e.assign(E._`${t.evaluated}.items`,E._`undefined`))}function Ay(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?E._`/*# sourceURL=${r} */`:E.nil}function Av(t,e){if(qy(t)&&(Ny(t),Uy(t))){Uv(t,e);return}Wy.boolOrEmptySchema(t,e)}function Uy({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function qy(t){return typeof t.schema!="boolean"}function Uv(t,e){let{schema:r,gen:n,opts:a}=t;a.$comment&&r.$comment&&Ly(t),Bv(t),Lv(t);let s=n.const("_errs",N.default.errors);By(t,s),n.var(e,E._`${s} === ${N.default.errors}`)}function Ny(t){Qr.checkUnknownRules(t),qv(t)}function By(t,e){if(t.opts.jtd)return Vy(t,[],!1,e);let r=Ey.getSchemaTypes(t.schema),n=Ey.coerceAndCheckDataType(t,r);Vy(t,r,!n,e)}function qv(t){let{schema:e,errSchemaPath:r,opts:n,self:a}=t;e.$ref&&n.ignoreKeywordsWithRef&&Qr.schemaHasRulesButRef(e,a.RULES)&&a.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Nv(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&Qr.checkStrictMode(t,"default is ignored in the schema root")}function Bv(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=Gv.resolveUrl(t.baseId,e))}function Lv(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function Ly({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:a}){let s=r.$comment;if(a.$comment===!0)t.code(E._`${N.default.self}.logger.log(${s})`);else if(typeof a.$comment=="function"){let i=E.str`${n}/$comment`,o=t.scopeValue("root",{ref:e.root});t.code(E._`${N.default.self}.opts.$comment(${s}, ${i}, ${o}.schema)`)}}function Vv(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:a,opts:s}=t;r.$async?e.if(E._`${N.default.errors} === 0`,()=>e.return(N.default.data),()=>e.throw(E._`new ${a}(${N.default.vErrors})`)):(e.assign(E._`${n}.errors`,N.default.vErrors),s.unevaluated&&Hv(t),e.return(E._`${N.default.errors} === 0`))}function Hv({gen:t,evaluated:e,props:r,items:n}){r instanceof E.Name&&t.assign(E._`${e}.props`,r),n instanceof E.Name&&t.assign(E._`${e}.items`,n)}function Vy(t,e,r,n){let{gen:a,schema:s,data:i,allErrors:o,opts:f,self:u}=t,{RULES:l}=u;if(s.$ref&&(f.ignoreKeywordsWithRef||!Qr.schemaHasRulesButRef(s,l))){a.block(()=>Ky(t,"$ref",l.all.$ref.definition));return}f.jtd||zv(t,e),a.block(()=>{for(let b of l.rules)_(b);_(l.post)});function _(b){!gm.shouldUseGroup(s,b)||(b.type?(a.if(Qd.checkDataType(b.type,i,f.strictNumbers)),Hy(t,b),e.length===1&&e[0]===b.type&&r&&(a.else(),Qd.reportTypeError(t)),a.endIf()):Hy(t,b),o||a.if(E._`${N.default.errors} === ${n||0}`))}}function Hy(t,e){let{gen:r,schema:n,opts:{useDefaults:a}}=t;a&&Pv.assignDefaults(t,e.type),r.block(()=>{for(let s of e.rules)gm.shouldUseRule(n,s)&&Ky(t,s.keyword,s.definition,e.type)})}function zv(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Kv(t,e),t.opts.allowUnionTypes||Qv(t,e),Jv(t,t.dataTypes))}function Kv(t,e){if(!!e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{zy(t.dataTypes,r)||Tm(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),t.dataTypes=t.dataTypes.filter(r=>zy(e,r))}}function Qv(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Tm(t,"use allowUnionTypes to allow union type keyword")}function Jv(t,e){let r=t.self.RULES.all;for(let n in r){let a=r[n];if(typeof a=="object"&&gm.shouldUseRule(t.schema,a)){let{type:s}=a.definition;s.length&&!s.some(i=>Xv(e,i))&&Tm(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function Xv(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function zy(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function Tm(t,e){e+=` at "${t.schemaEnv.baseId+t.errSchemaPath}" (strictTypes)`,Qr.checkStrictMode(t,e,t.opts.strictTypes)}var ym=class{constructor(e,r,n){if(po.validateKeywordUsage(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=Qr.schemaRefOrVal(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",Qy(this.$data,e));else if(this.schemaCode=this.schemaValue,!po.validSchemaType(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",N.default.errors))}result(e,r,n){this.failResult(E.not(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult(E.not(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail(E._`${r} !== undefined && (${E.or(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?fo.reportExtraError:fo.reportError)(this,this.def.error,r)}$dataError(){fo.reportError(this,this.def.$dataError||fo.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');fo.resetErrorsCount(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=E.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=E.nil,r=E.nil){if(!this.$data)return;let{gen:n,schemaCode:a,schemaType:s,def:i}=this;n.if(E.or(E._`${a} === undefined`,r)),e!==E.nil&&n.assign(e,!0),(s.length||i.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==E.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:a,it:s}=this;return E.or(i(),o());function i(){if(n.length){if(!(r instanceof E.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return E._`${Qd.checkDataTypes(f,r,s.opts.strictNumbers,Qd.DataType.Wrong)}`}return E.nil}function o(){if(a.validateSchema){let f=e.scopeValue("validate$data",{ref:a.validateSchema});return E._`!${f}(${r})`}return E.nil}}subschema(e,r){let n=_m.getSubschema(this.it,e);_m.extendSubschemaData(n,this.it,e),_m.extendSubschemaMode(n,e);let a=q(P(P({},this.it),n),{items:void 0,props:void 0});return Av(a,r),a}mergeEvaluated(e,r){let{it:n,gen:a}=this;!n.opts.unevaluated||(n.props!==!0&&e.props!==void 0&&(n.props=Qr.mergeEvaluated.props(a,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Qr.mergeEvaluated.items(a,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:a}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return a.if(r,()=>this.mergeEvaluated(e,E.Name)),!0}};ya.KeywordCxt=ym;function Ky(t,e,r,n){let a=new ym(t,r,e);"code"in r?r.code(a,n):a.$data&&r.validate?po.funcKeywordCode(a,r):"macro"in r?po.macroKeywordCode(a,r):(r.compile||r.validate)&&po.funcKeywordCode(a,r)}var Yv=/^\/(?:[^~]|~0|~1)*$/,Zv=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Qy(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let a,s;if(t==="")return N.default.rootData;if(t[0]==="/"){if(!Yv.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);a=t,s=N.default.rootData}else{let u=Zv.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let l=+u[1];if(a=u[2],a==="#"){if(l>=e)throw new Error(f("property/index",l));return n[e-l]}if(l>e)throw new Error(f("data",l));if(s=r[e-l],!a)return s}let i=s,o=a.split("/");for(let u of o)u&&(s=E._`${s}${E.getProperty(Qr.unescapeJsonPointer(u))}`,i=E._`${i} && ${s}`);return i;function f(u,l){return`Cannot access ${u} ${l} levels up, current level is ${e}`}}ya.getData=Qy});var xm=C(bm=>{"use strict";Object.defineProperty(bm,"__esModule",{value:!0});var Jy=class extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}};bm.default=Jy});var $m=C(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});var Fm=oo(),Xy=class extends Error{constructor(e,r,n){super(n||`can't resolve reference ${r} from id ${e}`);this.missingRef=Fm.resolveUrl(e,r),this.missingSchema=Fm.normalizeId(Fm.getFullPath(this.missingRef))}};wm.default=Xy});var jm=C(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.resolveSchema=tt.getCompilingSchema=tt.resolveRef=tt.compileSchema=tt.SchemaEnv=void 0;var st=Q(),ej=xm(),fs=Kr(),it=oo(),Yy=ae(),tj=uo(),rj=mm(),lo=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:it.normalizeId(n==null?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n==null?void 0:n.$async,this.refs={}}};tt.SchemaEnv=lo;function Om(t){let e=Zy.call(this,t);if(e)return e;let r=it.getFullPath(t.root.baseId),{es5:n,lines:a}=this.opts.code,{ownProperties:s}=this.opts,i=new st.CodeGen(this.scope,{es5:n,lines:a,ownProperties:s}),o;t.$async&&(o=i.scopeValue("Error",{ref:ej.default,code:st._`require("ajv/dist/runtime/validation_error").default`}));let f=i.scopeName("validate");t.validateName=f;let u={gen:i,allErrors:this.opts.allErrors,data:fs.default.data,parentData:fs.default.parentData,parentDataProperty:fs.default.parentDataProperty,dataNames:[fs.default.data],dataPathArr:[st.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:st.stringify(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:o,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:st.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:st._`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),tj.validateFunctionCode(u),i.optimize(this.opts.code.optimize);let _=i.toString();l=`${i.scopeRefs(fs.default.scope)}return ${_}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let w=new Function(`${fs.default.self}`,`${fs.default.scope}`,l)(this,this.scope.get());if(this.scope.value(f,{ref:w}),w.errors=null,w.schema=t.schema,w.schemaEnv=t,t.$async&&(w.$async=!0),this.opts.code.source===!0&&(w.source={validateName:f,validateCode:_,scopeValues:i._values}),this.opts.unevaluated){let{props:y,items:j}=u;w.evaluated={props:y instanceof st.Name?void 0:y,items:j instanceof st.Name?void 0:j,dynamicProps:y instanceof st.Name,dynamicItems:j instanceof st.Name},w.source&&(w.source.evaluated=st.stringify(w.evaluated))}return t.validate=w,t}catch(_){throw delete t.validate,delete t.validateName,l&&this.logger.error("Error compiling schema, function code:",l),_}finally{this._compilations.delete(t)}}tt.compileSchema=Om;function nj(t,e,r){var n;r=it.resolveUrl(e,r);let a=t.refs[r];if(a)return a;let s=ij.call(this,t,r);if(s===void 0){let i=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:o}=this.opts;i&&(s=new lo({schema:i,schemaId:o,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=aj.call(this,s)}tt.resolveRef=nj;function aj(t){return it.inlineRef(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Om.call(this,t)}function Zy(t){for(let e of this._compilations)if(sj(e,t))return e}tt.getCompilingSchema=Zy;function sj(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function ij(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Jd.call(this,t,e)}function Jd(t,e){let r=rj.parse(e),n=it._getFullPath(r),a=it.getFullPath(t.baseId);if(Object.keys(t.schema).length>0&&n===a)return vm.call(this,r,t);let s=it.normalizeId(n),i=this.refs[s]||this.schemas[s];if(typeof i=="string"){let o=Jd.call(this,t,i);return typeof(o==null?void 0:o.schema)!="object"?void 0:vm.call(this,r,o)}if(typeof(i==null?void 0:i.schema)=="object"){if(i.validate||Om.call(this,i),s===it.normalizeId(e)){let{schema:o}=i,{schemaId:f}=this.opts,u=o[f];return u&&(a=it.resolveUrl(a,u)),new lo({schema:o,schemaId:f,root:t,baseId:a})}return vm.call(this,r,i)}}tt.resolveSchema=Jd;var oj=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function vm(t,{baseId:e,schema:r,root:n}){var a;if(((a=t.fragment)===null||a===void 0?void 0:a[0])!=="/")return;for(let o of t.fragment.slice(1).split("/")){if(typeof r=="boolean"||(r=r[Yy.unescapeFragment(o)],r===void 0))return;let f=typeof r=="object"&&r[this.opts.schemaId];!oj.has(o)&&f&&(e=it.resolveUrl(e,f))}let s;if(typeof r!="boolean"&&r.$ref&&!Yy.schemaHasRulesButRef(r,this.RULES)){let o=it.resolveUrl(e,r.$ref);s=Jd.call(this,n,o)}let{schemaId:i}=this.opts;if(s=s||new lo({schema:r,schemaId:i,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var eb=C((rX,pj)=>{pj.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var ob=C(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.CodeGen=Ce.Name=Ce.nil=Ce.stringify=Ce.str=Ce._=Ce.KeywordCxt=void 0;var fj=uo();Object.defineProperty(Ce,"KeywordCxt",{enumerable:!0,get:function(){return fj.KeywordCxt}});var ui=Q();Object.defineProperty(Ce,"_",{enumerable:!0,get:function(){return ui._}});Object.defineProperty(Ce,"str",{enumerable:!0,get:function(){return ui.str}});Object.defineProperty(Ce,"stringify",{enumerable:!0,get:function(){return ui.stringify}});Object.defineProperty(Ce,"nil",{enumerable:!0,get:function(){return ui.nil}});Object.defineProperty(Ce,"Name",{enumerable:!0,get:function(){return ui.Name}});Object.defineProperty(Ce,"CodeGen",{enumerable:!0,get:function(){return ui.CodeGen}});var uj=xm(),tb=$m(),dj=sm(),co=jm(),lj=Q(),mo=oo(),Xd=io(),Im=ae(),rb=eb(),cj=["removeAdditional","useDefaults","coerceTypes"],mj=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),hj={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},gj={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},nb=200;function _j(t){var e,r,n,a,s,i,o,f,u,l,_,b,w,y,j,I,k,A,ce,Y,z,be;let Ge=t.strict,Qa=(e=t.code)===null||e===void 0?void 0:e.optimize,Vs=Qa===!0||Qa===void 0?1:Qa||0;return{strictSchema:(n=(r=t.strictSchema)!==null&&r!==void 0?r:Ge)!==null&&n!==void 0?n:!0,strictNumbers:(s=(a=t.strictNumbers)!==null&&a!==void 0?a:Ge)!==null&&s!==void 0?s:!0,strictTypes:(o=(i=t.strictTypes)!==null&&i!==void 0?i:Ge)!==null&&o!==void 0?o:"log",strictTuples:(u=(f=t.strictTuples)!==null&&f!==void 0?f:Ge)!==null&&u!==void 0?u:"log",strictRequired:(_=(l=t.strictRequired)!==null&&l!==void 0?l:Ge)!==null&&_!==void 0?_:!1,code:t.code?q(P({},t.code),{optimize:Vs}):{optimize:Vs},loopRequired:(b=t.loopRequired)!==null&&b!==void 0?b:nb,loopEnum:(w=t.loopEnum)!==null&&w!==void 0?w:nb,meta:(y=t.meta)!==null&&y!==void 0?y:!0,messages:(j=t.messages)!==null&&j!==void 0?j:!0,inlineRefs:(I=t.inlineRefs)!==null&&I!==void 0?I:!0,schemaId:(k=t.schemaId)!==null&&k!==void 0?k:"$id",addUsedSchema:(A=t.addUsedSchema)!==null&&A!==void 0?A:!0,validateSchema:(ce=t.validateSchema)!==null&&ce!==void 0?ce:!0,validateFormats:(Y=t.validateFormats)!==null&&Y!==void 0?Y:!0,unicodeRegExp:(z=t.unicodeRegExp)!==null&&z!==void 0?z:!0,int32range:(be=t.int32range)!==null&&be!==void 0?be:!0}}var Yd=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts=P(P({},e),_j(e));let{es5:r,lines:n}=this.opts.code;this.scope=new lj.ValueScope({scope:{},prefixes:mj,es5:r,lines:n}),this.logger=wj(e.logger);let a=e.validateFormats;e.validateFormats=!1,this.RULES=dj.getRules(),ab.call(this,hj,e,"NOT SUPPORTED"),ab.call(this,gj,e,"DEPRECATED","warn"),this._metaOpts=xj.call(this),e.formats&&yj.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&bj.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),Tj.call(this),e.validateFormats=a}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,a=rb;n==="id"&&(a=P({},rb),a.id=a.$id,delete a.$id),r&&e&&this.addMetaSchema(a,a[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let a=n(r);return"$async"in n||(this.errors=n.errors),a}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return a.call(this,e,r);function a(l,_){return ye(this,null,function*(){yield s.call(this,l.$schema);let b=this._addSchema(l,_);return b.validate||i.call(this,b)})}function s(l){return ye(this,null,function*(){l&&!this.getSchema(l)&&(yield a.call(this,{$ref:l},!0))})}function i(l){return ye(this,null,function*(){try{return this._compileSchemaEnv(l)}catch(_){if(!(_ instanceof tb.default))throw _;return o.call(this,_),yield f.call(this,_.missingSchema),i.call(this,l)}})}function o({missingSchema:l,missingRef:_}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${_} cannot be resolved`)}function f(l){return ye(this,null,function*(){let _=yield u.call(this,l);this.refs[l]||(yield s.call(this,_.$schema)),this.refs[l]||this.addSchema(_,l,r)})}function u(l){return ye(this,null,function*(){let _=this._loading[l];if(_)return _;try{return yield this._loading[l]=n(l)}finally{delete this._loading[l]}})}}addSchema(e,r,n,a=this.opts.validateSchema){if(Array.isArray(e)){for(let i of e)this.addSchema(i,void 0,n,a);return this}let s;if(typeof e=="object"){let{schemaId:i}=this.opts;if(s=e[i],s!==void 0&&typeof s!="string")throw new Error(`schema ${i} must be string`)}return r=mo.normalizeId(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,a,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let a=this.validate(n,e);if(!a&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return a}getSchema(e){let r;for(;typeof(r=sb.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,a=new co.SchemaEnv({schema:{},schemaId:n});if(r=co.resolveSchema.call(this,a,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=sb.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=mo.normalizeId(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Oj.call(this,n,r),!r)return Im.eachItem(n,s=>km.call(this,s)),this;jj.call(this,r);let a=q(P({},r),{type:Xd.getJSONTypes(r.type),schemaType:Xd.getJSONTypes(r.schemaType)});return Im.eachItem(n,a.type.length===0?s=>km.call(this,s,a):s=>a.type.forEach(i=>km.call(this,s,a,i))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let a=n.rules.findIndex(s=>s.keyword===e);a>=0&&n.rules.splice(a,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(a=>`${n}${a.instancePath} ${a.message}`).reduce((a,s)=>a+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let a of r){let s=a.split("/").slice(1),i=e;for(let o of s)i=i[o];for(let o in n){let f=n[o];if(typeof f!="object")continue;let{$data:u}=f.definition,l=i[o];u&&l&&(i[o]=ib(l))}}return e}_removeAllSchemas(e,r){for(let n in e){let a=e[n];(!r||r.test(n))&&(typeof a=="string"?delete e[n]:a&&!a.meta&&(this._cache.delete(a.schema),delete e[n]))}}_addSchema(e,r,n,a=this.opts.validateSchema,s=this.opts.addUsedSchema){let i,{schemaId:o}=this.opts;if(typeof e=="object")i=e[o];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let f=this._cache.get(e);if(f!==void 0)return f;let u=mo.getSchemaRefs.call(this,e);return n=mo.normalizeId(i||n),f=new co.SchemaEnv({schema:e,schemaId:o,meta:r,baseId:n,localRefs:u}),this._cache.set(f.schema,f),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=f),a&&this.validateSchema(e,!0),f}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):co.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{co.compileSchema.call(this,e)}finally{this.opts=r}}};Ce.default=Yd;Yd.ValidationError=uj.default;Yd.MissingRefError=tb.default;function ab(t,e,r,n="error"){for(let a in t){let s=a;s in e&&this.logger[n](`${r}: option ${a}. ${t[s]}`)}}function sb(t){return t=mo.normalizeId(t),this.schemas[t]||this.refs[t]}function Tj(){let t=this.opts.schemas;if(!!t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function yj(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function bj(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function xj(){let t=P({},this.opts);for(let e of cj)delete t[e];return t}var Fj={log(){},warn(){},error(){}};function wj(t){if(t===!1)return Fj;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var $j=/^[a-z_$][a-z0-9_$:-]*$/i;function Oj(t,e){let{RULES:r}=this;if(Im.eachItem(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!$j.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function km(t,e,r){var n;let a=e==null?void 0:e.post;if(r&&a)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,i=a?s.post:s.rules.find(({type:f})=>f===r);if(i||(i={type:r,rules:[]},s.rules.push(i)),s.keywords[t]=!0,!e)return;let o={keyword:t,definition:q(P({},e),{type:Xd.getJSONTypes(e.type),schemaType:Xd.getJSONTypes(e.schemaType)})};e.before?vj.call(this,i,o,e.before):i.rules.push(o),s.all[t]=o,(n=e.implements)===null||n===void 0||n.forEach(f=>this.addKeyword(f))}function vj(t,e,r){let n=t.rules.findIndex(a=>a.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function jj(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=ib(e)),t.validateSchema=this.compile(e,!0))}var Ij={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ib(t){return{anyOf:[t,Ij]}}});var pb=C(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});var kj={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Sm.default=kj});var lb=C(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.callRef=us.getValidate=void 0;var Sj=$m(),fb=et(),Ve=Q(),di=Kr(),ub=jm(),Zd=ae(),Cj={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:a,schemaEnv:s,validateName:i,opts:o,self:f}=n,{root:u}=s;if((r==="#"||r==="#/")&&a===u.baseId)return _();let l=ub.resolveRef.call(f,u,a,r);if(l===void 0)throw new Sj.default(a,r);if(l instanceof ub.SchemaEnv)return b(l);return w(l);function _(){if(s===u)return el(t,i,s,s.$async);let y=e.scopeValue("root",{ref:u});return el(t,Ve._`${y}.validate`,u,u.$async)}function b(y){let j=db(t,y);el(t,j,y,y.$async)}function w(y){let j=e.scopeValue("schema",o.code.source===!0?{ref:y,code:Ve.stringify(y)}:{ref:y}),I=e.name("valid"),k=t.subschema({schema:y,dataTypes:[],schemaPath:Ve.nil,topSchemaRef:j,errSchemaPath:r},I);t.mergeEvaluated(k),t.ok(I)}}};function db(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):Ve._`${r.scopeValue("wrapper",{ref:e})}.validate`}us.getValidate=db;function el(t,e,r,n){let{gen:a,it:s}=t,{allErrors:i,schemaEnv:o,opts:f}=s,u=f.passContext?di.default.this:Ve.nil;n?l():_();function l(){if(!o.$async)throw new Error("async schema referenced by sync schema");let y=a.let("valid");a.try(()=>{a.code(Ve._`await ${fb.callValidateCode(t,e,u)}`),w(e),i||a.assign(y,!0)},j=>{a.if(Ve._`!(${j} instanceof ${s.ValidationError})`,()=>a.throw(j)),b(j),i||a.assign(y,!1)}),t.ok(y)}function _(){t.result(fb.callValidateCode(t,e,u),()=>w(e),()=>b(e))}function b(y){let j=Ve._`${y}.errors`;a.assign(di.default.vErrors,Ve._`${di.default.vErrors} === null ? ${j} : ${di.default.vErrors}.concat(${j})`),a.assign(di.default.errors,Ve._`${di.default.vErrors}.length`)}function w(y){var j;if(!s.opts.unevaluated)return;let I=(j=r==null?void 0:r.validate)===null||j===void 0?void 0:j.evaluated;if(s.props!==!0)if(I&&!I.dynamicProps)I.props!==void 0&&(s.props=Zd.mergeEvaluated.props(a,I.props,s.props));else{let k=a.var("props",Ve._`${y}.evaluated.props`);s.props=Zd.mergeEvaluated.props(a,k,s.props,Ve.Name)}if(s.items!==!0)if(I&&!I.dynamicItems)I.items!==void 0&&(s.items=Zd.mergeEvaluated.items(a,I.items,s.items));else{let k=a.var("items",Ve._`${y}.evaluated.items`);s.items=Zd.mergeEvaluated.items(a,k,s.items,Ve.Name)}}}us.callRef=el;us.default=Cj});var cb=C(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});var Pj=pb(),Gj=lb(),Dj=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Pj.default,Gj.default];Cm.default=Dj});var mb=C(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});var tl=Q(),ba=tl.operators,rl={maximum:{okStr:"<=",ok:ba.LTE,fail:ba.GT},minimum:{okStr:">=",ok:ba.GTE,fail:ba.LT},exclusiveMaximum:{okStr:"<",ok:ba.LT,fail:ba.GTE},exclusiveMinimum:{okStr:">",ok:ba.GT,fail:ba.LTE}},Mj={message:({keyword:t,schemaCode:e})=>tl.str`must be ${rl[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>tl._`{comparison: ${rl[t].okStr}, limit: ${e}}`},Wj={keyword:Object.keys(rl),type:"number",schemaType:"number",$data:!0,error:Mj,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data(tl._`${r} ${rl[e].fail} ${n} || isNaN(${r})`)}};Pm.default=Wj});var hb=C(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});var ho=Q(),Ej={message:({schemaCode:t})=>ho.str`must be multiple of ${t}`,params:({schemaCode:t})=>ho._`{multipleOf: ${t}}`},Rj={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Ej,code(t){let{gen:e,data:r,schemaCode:n,it:a}=t,s=a.opts.multipleOfPrecision,i=e.let("res"),o=s?ho._`Math.abs(Math.round(${i}) - ${i}) > 1e-${s}`:ho._`${i} !== parseInt(${i})`;t.fail$data(ho._`(${n} === 0 || (${i} = ${r}/${n}, ${o}))`)}};Gm.default=Rj});var _b=C(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});function gb(t){let e=t.length,r=0,n=0,a;for(;n<e;)r++,a=t.charCodeAt(n++),a>=55296&&a<=56319&&n<e&&(a=t.charCodeAt(n),(a&64512)==56320&&n++);return r}Dm.default=gb;gb.code='require("ajv/dist/runtime/ucs2length").default'});var Tb=C(Mm=>{"use strict";Object.defineProperty(Mm,"__esModule",{value:!0});var ds=Q(),Aj=ae(),Uj=_b(),qj={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return ds.str`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>ds._`{limit: ${t}}`},Nj={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:qj,code(t){let{keyword:e,data:r,schemaCode:n,it:a}=t,s=e==="maxLength"?ds.operators.GT:ds.operators.LT,i=a.opts.unicode===!1?ds._`${r}.length`:ds._`${Aj.useFunc(t.gen,Uj.default)}(${r})`;t.fail$data(ds._`${i} ${s} ${n}`)}};Mm.default=Nj});var yb=C(Wm=>{"use strict";Object.defineProperty(Wm,"__esModule",{value:!0});var Bj=et(),nl=Q(),Lj={message:({schemaCode:t})=>nl.str`must match pattern "${t}"`,params:({schemaCode:t})=>nl._`{pattern: ${t}}`},Vj={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Lj,code(t){let{data:e,$data:r,schema:n,schemaCode:a,it:s}=t,i=s.opts.unicodeRegExp?"u":"",o=r?nl._`(new RegExp(${a}, ${i}))`:Bj.usePattern(t,n);t.fail$data(nl._`!${o}.test(${e})`)}};Wm.default=Vj});var bb=C(Em=>{"use strict";Object.defineProperty(Em,"__esModule",{value:!0});var go=Q(),Hj={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return go.str`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>go._`{limit: ${t}}`},zj={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Hj,code(t){let{keyword:e,data:r,schemaCode:n}=t,a=e==="maxProperties"?go.operators.GT:go.operators.LT;t.fail$data(go._`Object.keys(${r}).length ${a} ${n}`)}};Em.default=zj});var xb=C(Rm=>{"use strict";Object.defineProperty(Rm,"__esModule",{value:!0});var _o=et(),To=Q(),Kj=ae(),Qj={message:({params:{missingProperty:t}})=>To.str`must have required property '${t}'`,params:({params:{missingProperty:t}})=>To._`{missingProperty: ${t}}`},Jj={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Qj,code(t){let{gen:e,schema:r,schemaCode:n,data:a,$data:s,it:i}=t,{opts:o}=i;if(!s&&r.length===0)return;let f=r.length>=o.loopRequired;if(i.allErrors?u():l(),o.strictRequired){let w=t.parentSchema.properties,{definedProperties:y}=t.it;for(let j of r)if((w==null?void 0:w[j])===void 0&&!y.has(j)){let I=i.schemaEnv.baseId+i.errSchemaPath,k=`required property "${j}" is not defined at "${I}" (strictRequired)`;Kj.checkStrictMode(i,k,i.opts.strictRequired)}}function u(){if(f||s)t.block$data(To.nil,_);else for(let w of r)_o.checkReportMissingProp(t,w)}function l(){let w=e.let("missing");if(f||s){let y=e.let("valid",!0);t.block$data(y,()=>b(w,y)),t.ok(y)}else e.if(_o.checkMissingProp(t,r,w)),_o.reportMissingProp(t,w),e.else()}function _(){e.forOf("prop",n,w=>{t.setParams({missingProperty:w}),e.if(_o.noPropertyInData(e,a,w,o.ownProperties),()=>t.error())})}function b(w,y){t.setParams({missingProperty:w}),e.forOf(w,n,()=>{e.assign(y,_o.propertyInData(e,a,w,o.ownProperties)),e.if(To.not(y),()=>{t.error(),e.break()})},To.nil)}}};Rm.default=Jj});var Fb=C(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});var yo=Q(),Xj={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return yo.str`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>yo._`{limit: ${t}}`},Yj={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Xj,code(t){let{keyword:e,data:r,schemaCode:n}=t,a=e==="maxItems"?yo.operators.GT:yo.operators.LT;t.fail$data(yo._`${r}.length ${a} ${n}`)}};Am.default=Yj});var al=C(Um=>{"use strict";Object.defineProperty(Um,"__esModule",{value:!0});var wb=cm();wb.code='require("ajv/dist/runtime/equal").default';Um.default=wb});var $b=C(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});var qm=io(),Pe=Q(),Zj=ae(),eI=al(),tI={message:({params:{i:t,j:e}})=>Pe.str`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>Pe._`{i: ${t}, j: ${e}}`},rI={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:tI,code(t){let{gen:e,data:r,$data:n,schema:a,parentSchema:s,schemaCode:i,it:o}=t;if(!n&&!a)return;let f=e.let("valid"),u=s.items?qm.getSchemaTypes(s.items):[];t.block$data(f,l,Pe._`${i} === false`),t.ok(f);function l(){let y=e.let("i",Pe._`${r}.length`),j=e.let("j");t.setParams({i:y,j}),e.assign(f,!0),e.if(Pe._`${y} > 1`,()=>(_()?b:w)(y,j))}function _(){return u.length>0&&!u.some(y=>y==="object"||y==="array")}function b(y,j){let I=e.name("item"),k=qm.checkDataTypes(u,I,o.opts.strictNumbers,qm.DataType.Wrong),A=e.const("indices",Pe._`{}`);e.for(Pe._`;${y}--;`,()=>{e.let(I,Pe._`${r}[${y}]`),e.if(k,Pe._`continue`),u.length>1&&e.if(Pe._`typeof ${I} == "string"`,Pe._`${I} += "_"`),e.if(Pe._`typeof ${A}[${I}] == "number"`,()=>{e.assign(j,Pe._`${A}[${I}]`),t.error(),e.assign(f,!1).break()}).code(Pe._`${A}[${I}] = ${y}`)})}function w(y,j){let I=Zj.useFunc(e,eI.default),k=e.name("outer");e.label(k).for(Pe._`;${y}--;`,()=>e.for(Pe._`${j} = ${y}; ${j}--;`,()=>e.if(Pe._`${I}(${r}[${y}], ${r}[${j}])`,()=>{t.error(),e.assign(f,!1).break(k)})))}}};Nm.default=rI});var Ob=C(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});var Bm=Q(),nI=ae(),aI=al(),sI={message:"must be equal to constant",params:({schemaCode:t})=>Bm._`{allowedValue: ${t}}`},iI={keyword:"const",$data:!0,error:sI,code(t){let{gen:e,data:r,$data:n,schemaCode:a,schema:s}=t;n||s&&typeof s=="object"?t.fail$data(Bm._`!${nI.useFunc(e,aI.default)}(${r}, ${a})`):t.fail(Bm._`${s} !== ${r}`)}};Lm.default=iI});var vb=C(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});var bo=Q(),oI=ae(),pI=al(),fI={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>bo._`{allowedValues: ${t}}`},uI={keyword:"enum",schemaType:"array",$data:!0,error:fI,code(t){let{gen:e,data:r,$data:n,schema:a,schemaCode:s,it:i}=t;if(!n&&a.length===0)throw new Error("enum must have non-empty array");let o=a.length>=i.opts.loopEnum,f=oI.useFunc(e,pI.default),u;if(o||n)u=e.let("valid"),t.block$data(u,l);else{if(!Array.isArray(a))throw new Error("ajv implementation error");let b=e.const("vSchema",s);u=bo.or(...a.map((w,y)=>_(b,y)))}t.pass(u);function l(){e.assign(u,!1),e.forOf("v",s,b=>e.if(bo._`${f}(${r}, ${b})`,()=>e.assign(u,!0).break()))}function _(b,w){let y=a[w];return typeof y=="object"&&y!==null?bo._`${f}(${r}, ${b}[${w}])`:bo._`${r} === ${y}`}}};Vm.default=uI});var jb=C(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});var dI=mb(),lI=hb(),cI=Tb(),mI=yb(),hI=bb(),gI=xb(),_I=Fb(),TI=$b(),yI=Ob(),bI=vb(),xI=[dI.default,lI.default,cI.default,mI.default,hI.default,gI.default,_I.default,TI.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},yI.default,bI.default];Hm.default=xI});var Km=C(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.validateAdditionalItems=void 0;var ls=Q(),zm=ae(),FI={message:({params:{len:t}})=>ls.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>ls._`{limit: ${t}}`},wI={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:FI,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){zm.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Ib(t,n)}};function Ib(t,e){let{gen:r,schema:n,data:a,keyword:s,it:i}=t;i.items=!0;let o=r.const("len",ls._`${a}.length`);if(n===!1)t.setParams({len:e.length}),t.pass(ls._`${o} <= ${e.length}`);else if(typeof n=="object"&&!zm.alwaysValidSchema(i,n)){let u=r.var("valid",ls._`${o} <= ${e.length}`);r.if(ls.not(u),()=>f(u)),t.ok(u)}function f(u){r.forRange("i",e.length,o,l=>{t.subschema({keyword:s,dataProp:l,dataPropType:zm.Type.Num},u),i.allErrors||r.if(ls.not(u),()=>r.break())})}}xo.validateAdditionalItems=Ib;xo.default=wI});var Qm=C(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.validateTuple=void 0;var kb=Q(),sl=ae(),$I=et(),OI={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Sb(t,"additionalItems",e);r.items=!0,!sl.alwaysValidSchema(r,e)&&t.ok($I.validateArray(t))}};function Sb(t,e,r=t.schema){let{gen:n,parentSchema:a,data:s,keyword:i,it:o}=t;l(a),o.opts.unevaluated&&r.length&&o.items!==!0&&(o.items=sl.mergeEvaluated.items(n,r.length,o.items));let f=n.name("valid"),u=n.const("len",kb._`${s}.length`);r.forEach((_,b)=>{sl.alwaysValidSchema(o,_)||(n.if(kb._`${u} > ${b}`,()=>t.subschema({keyword:i,schemaProp:b,dataProp:b},f)),t.ok(f))});function l(_){let{opts:b,errSchemaPath:w}=o,y=r.length,j=y===_.minItems&&(y===_.maxItems||_[e]===!1);if(b.strictTuples&&!j){let I=`"${i}" is ${y}-tuple, but minItems or maxItems/${e} are not specified or different at path "${w}"`;sl.checkStrictMode(o,I,b.strictTuples)}}}Fo.validateTuple=Sb;Fo.default=OI});var Cb=C(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});var vI=Qm(),jI={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>vI.validateTuple(t,"items")};Jm.default=jI});var Gb=C(Xm=>{"use strict";Object.defineProperty(Xm,"__esModule",{value:!0});var Pb=Q(),II=ae(),kI=et(),SI=Km(),CI={message:({params:{len:t}})=>Pb.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>Pb._`{limit: ${t}}`},PI={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:CI,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:a}=r;n.items=!0,!II.alwaysValidSchema(n,e)&&(a?SI.validateAdditionalItems(t,a):t.ok(kI.validateArray(t)))}};Xm.default=PI});var Db=C(Ym=>{"use strict";Object.defineProperty(Ym,"__esModule",{value:!0});var ot=Q(),il=ae(),GI={message:({params:{min:t,max:e}})=>e===void 0?ot.str`must contain at least ${t} valid item(s)`:ot.str`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?ot._`{minContains: ${t}}`:ot._`{minContains: ${t}, maxContains: ${e}}`},DI={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:GI,code(t){let{gen:e,schema:r,parentSchema:n,data:a,it:s}=t,i,o,{minContains:f,maxContains:u}=n;s.opts.next?(i=f===void 0?1:f,o=u):i=1;let l=e.const("len",ot._`${a}.length`);if(t.setParams({min:i,max:o}),o===void 0&&i===0){il.checkStrictMode(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(o!==void 0&&i>o){il.checkStrictMode(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if(il.alwaysValidSchema(s,r)){let y=ot._`${l} >= ${i}`;o!==void 0&&(y=ot._`${y} && ${l} <= ${o}`),t.pass(y);return}s.items=!0;let _=e.name("valid");if(o===void 0&&i===1)b(_,()=>e.if(_,()=>e.break()));else{e.let(_,!1);let y=e.name("_valid"),j=e.let("count",0);b(y,()=>e.if(y,()=>w(j)))}t.result(_,()=>t.reset());function b(y,j){e.forRange("i",0,l,I=>{t.subschema({keyword:"contains",dataProp:I,dataPropType:il.Type.Num,compositeRule:!0},y),j()})}function w(y){e.code(ot._`${y}++`),o===void 0?e.if(ot._`${y} >= ${i}`,()=>e.assign(_,!0).break()):(e.if(ot._`${y} > ${o}`,()=>e.assign(_,!1).break()),i===1?e.assign(_,!0):e.if(ot._`${y} >= ${i}`,()=>e.assign(_,!0)))}}};Ym.default=DI});var Eb=C(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.validateSchemaDeps=Ot.validatePropertyDeps=Ot.error=void 0;var Zm=Q(),MI=ae(),wo=et();Ot.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return Zm.str`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>Zm._`{property: ${t},
|
|
14
14
|
missingProperty: ${n},
|
|
15
15
|
depsCount: ${e},
|
|
16
|
-
deps: ${r}}`};var WI={keyword:"dependencies",type:"object",schemaType:"object",error:Ot.error,code(t){let[e,r]=EI(t);Mb(t,e),Wb(t,r)}};function EI({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let a=Array.isArray(t[n])?e:r;a[n]=t[n]}return[e,r]}function Mb(t,e=t.schema){let{gen:r,data:n,it:a}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let i in e){let o=e[i];if(o.length===0)continue;let f=wo.propertyInData(r,n,i,a.opts.ownProperties);t.setParams({property:i,depsCount:o.length,deps:o.join(", ")}),a.allErrors?r.if(f,()=>{for(let u of o)wo.checkReportMissingProp(t,u)}):(r.if(Zm._`${f} && (${wo.checkMissingProp(t,o,s)})`),wo.reportMissingProp(t,s),r.else())}}Ot.validatePropertyDeps=Mb;function Wb(t,e=t.schema){let{gen:r,data:n,keyword:a,it:s}=t,i=r.name("valid");for(let o in e)MI.alwaysValidSchema(s,e[o])||(r.if(wo.propertyInData(r,n,o,s.opts.ownProperties),()=>{let f=t.subschema({keyword:a,schemaProp:o},i);t.mergeValidEvaluated(f,i)},()=>r.var(i,!0)),t.ok(i))}Ot.validateSchemaDeps=Wb;Ot.default=WI});var Ab=C(eh=>{"use strict";Object.defineProperty(eh,"__esModule",{value:!0});var Rb=Q(),RI=ae(),AI={message:"property name must be valid",params:({params:t})=>Rb._`{propertyName: ${t.propertyName}}`},UI={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:AI,code(t){let{gen:e,schema:r,data:n,it:a}=t;if(RI.alwaysValidSchema(a,r))return;let s=e.name("valid");e.forIn("key",n,i=>{t.setParams({propertyName:i}),t.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},s),e.if(Rb.not(s),()=>{t.error(!0),a.allErrors||e.break()})}),t.ok(s)}};eh.default=UI});var rh=C(th=>{"use strict";Object.defineProperty(th,"__esModule",{value:!0});var ol=et(),pt=Q(),qI=Kr(),pl=ae(),NI={message:"must NOT have additional properties",params:({params:t})=>pt._`{additionalProperty: ${t.additionalProperty}}`},BI={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:NI,code(t){let{gen:e,schema:r,parentSchema:n,data:a,errsCount:s,it:i}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:o,opts:f}=i;if(i.props=!0,f.removeAdditional!=="all"&&pl.alwaysValidSchema(i,r))return;let u=ol.allSchemaProperties(n.properties),l=ol.allSchemaProperties(n.patternProperties);_(),t.ok(pt._`${s} === ${qI.default.errors}`);function _(){e.forIn("key",a,I=>{!u.length&&!l.length?y(I):e.if(b(I),()=>y(I))})}function b(I){let k;if(u.length>8){let A=pl.schemaRefOrVal(i,n.properties,"properties");k=ol.isOwnProperty(e,A,I)}else u.length?k=pt.or(...u.map(A=>pt._`${I} === ${A}`)):k=pt.nil;return l.length&&(k=pt.or(k,...l.map(A=>pt._`${ol.usePattern(t,A)}.test(${I})`))),pt.not(k)}function w(I){e.code(pt._`delete ${a}[${I}]`)}function y(I){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){w(I);return}if(r===!1){t.setParams({additionalProperty:I}),t.error(),o||e.break();return}if(typeof r=="object"&&!pl.alwaysValidSchema(i,r)){let k=e.name("valid");f.removeAdditional==="failing"?(j(I,k,!1),e.if(pt.not(k),()=>{t.reset(),w(I)})):(j(I,k),o||e.if(pt.not(k),()=>e.break()))}}function j(I,k,A){let ce={keyword:"additionalProperties",dataProp:I,dataPropType:pl.Type.Str};A===!1&&Object.assign(ce,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(ce,k)}}};th.default=BI});var Nb=C(ah=>{"use strict";Object.defineProperty(ah,"__esModule",{value:!0});var LI=uo(),Ub=et(),nh=ae(),qb=rh(),VI={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:a,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&qb.default.code(new LI.KeywordCxt(s,qb.default,"additionalProperties"));let i=Ub.allSchemaProperties(r);for(let _ of i)s.definedProperties.add(_);s.opts.unevaluated&&i.length&&s.props!==!0&&(s.props=nh.mergeEvaluated.props(e,nh.toHash(i),s.props));let o=i.filter(_=>!nh.alwaysValidSchema(s,r[_]));if(o.length===0)return;let f=e.name("valid");for(let _ of o)u(_)?l(_):(e.if(Ub.propertyInData(e,a,_,s.opts.ownProperties)),l(_),s.allErrors||e.else().var(f,!0),e.endIf()),t.it.definedProperties.add(_),t.ok(f);function u(_){return s.opts.useDefaults&&!s.compositeRule&&r[_].default!==void 0}function l(_){t.subschema({keyword:"properties",schemaProp:_,dataProp:_},f)}}};ah.default=VI});var Hb=C(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});var Bb=et(),fl=Q(),Lb=ae(),Vb=ae(),HI={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:a,it:s}=t,{opts:i}=s,o=Bb.allSchemaProperties(r),f=o.filter(j=>Lb.alwaysValidSchema(s,r[j]));if(o.length===0||f.length===o.length&&(!s.opts.unevaluated||s.props===!0))return;let u=i.strictSchema&&!i.allowMatchingProperties&&a.properties,l=e.name("valid");s.props!==!0&&!(s.props instanceof fl.Name)&&(s.props=Vb.evaluatedPropsToName(e,s.props));let{props:_}=s;b();function b(){for(let j of o)u&&w(j),s.allErrors?y(j):(e.var(l,!0),y(j),e.if(l))}function w(j){for(let I in u)new RegExp(j).test(I)&&Lb.checkStrictMode(s,`property ${I} matches pattern ${j} (use allowMatchingProperties)`)}function y(j){e.forIn("key",n,I=>{e.if(fl._`${Bb.usePattern(t,j)}.test(${I})`,()=>{let k=f.includes(j);k||t.subschema({keyword:"patternProperties",schemaProp:j,dataProp:I,dataPropType:Vb.Type.Str},l),s.opts.unevaluated&&_!==!0?e.assign(fl._`${_}[${I}]`,!0):!k&&!s.allErrors&&e.if(fl.not(l),()=>e.break())})})}}};sh.default=HI});var zb=C(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});var zI=ae(),KI={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if(zI.alwaysValidSchema(n,r)){t.fail();return}let a=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),t.failResult(a,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};ih.default=KI});var Kb=C(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});var QI=et(),JI={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:QI.validateUnion,error:{message:"must match a schema in anyOf"}};oh.default=JI});var Qb=C(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});var ul=Q(),XI=ae(),YI={message:"must match exactly one schema in oneOf",params:({params:t})=>ul._`{passingSchemas: ${t.passing}}`},ZI={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:YI,code(t){let{gen:e,schema:r,parentSchema:n,it:a}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(a.opts.discriminator&&n.discriminator)return;let s=r,i=e.let("valid",!1),o=e.let("passing",null),f=e.name("_valid");t.setParams({passing:o}),e.block(u),t.result(i,()=>t.reset(),()=>t.error(!0));function u(){s.forEach((l,_)=>{let b;XI.alwaysValidSchema(a,l)?e.var(f,!0):b=t.subschema({keyword:"oneOf",schemaProp:_,compositeRule:!0},f),_>0&&e.if(ul._`${f} && ${i}`).assign(i,!1).assign(o,ul._`[${o}, ${_}]`).else(),e.if(f,()=>{e.assign(i,!0),e.assign(o,_),b&&t.mergeEvaluated(b,ul.Name)})})}}};ph.default=ZI});var Jb=C(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});var ek=ae(),tk={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let a=e.name("valid");r.forEach((s,i)=>{if(ek.alwaysValidSchema(n,s))return;let o=t.subschema({keyword:"allOf",schemaProp:i},a);t.ok(a),t.mergeEvaluated(o)})}};fh.default=tk});var Zb=C(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});var dl=Q(),Xb=ae(),rk={message:({params:t})=>dl.str`must match "${t.ifClause}" schema`,params:({params:t})=>dl._`{failingKeyword: ${t.ifClause}}`},nk={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:rk,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&Xb.checkStrictMode(n,'"if" without "then" and "else" is ignored');let a=Yb(n,"then"),s=Yb(n,"else");if(!a&&!s)return;let i=e.let("valid",!0),o=e.name("_valid");if(f(),t.reset(),a&&s){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(o,u("then",l),u("else",l))}else a?e.if(o,u("then")):e.if(dl.not(o),u("else"));t.pass(i,()=>t.error(!0));function f(){let l=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},o);t.mergeEvaluated(l)}function u(l,_){return()=>{let b=t.subschema({keyword:l},o);e.assign(i,o),t.mergeValidEvaluated(b,i),_?e.assign(_,dl._`${l}`):t.setParams({ifClause:l})}}}};function Yb(t,e){let r=t.schema[e];return r!==void 0&&!Xb.alwaysValidSchema(t,r)}uh.default=nk});var ex=C(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});var ak=ae(),sk={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&ak.checkStrictMode(r,`"${t}" without "if" is ignored`)}};dh.default=sk});var tx=C(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});var ik=Km(),ok=Cb(),pk=Qm(),fk=Gb(),uk=Db(),dk=Eb(),lk=Ab(),ck=rh(),mk=Nb(),hk=Hb(),gk=zb(),_k=Kb(),Tk=Qb(),yk=Jb(),bk=Zb(),xk=ex();function Fk(t=!1){let e=[gk.default,_k.default,Tk.default,yk.default,bk.default,xk.default,lk.default,ck.default,dk.default,mk.default,hk.default];return t?e.push(ok.default,fk.default):e.push(ik.default,pk.default),e.push(uk.default),e}lh.default=Fk});var rx=C(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});var xe=Q(),wk={message:({schemaCode:t})=>xe.str`must match format "${t}"`,params:({schemaCode:t})=>xe._`{format: ${t}}`},$k={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:wk,code(t,e){let{gen:r,data:n,$data:a,schema:s,schemaCode:i,it:o}=t,{opts:f,errSchemaPath:u,schemaEnv:l,self:_}=o;if(!f.validateFormats)return;a?b():w();function b(){let y=r.scopeValue("formats",{ref:_.formats,code:f.code.formats}),j=r.const("fDef",xe._`${y}[${i}]`),I=r.let("fType"),k=r.let("format");r.if(xe._`typeof ${j} == "object" && !(${j} instanceof RegExp)`,()=>r.assign(I,xe._`${j}.type || "string"`).assign(k,xe._`${j}.validate`),()=>r.assign(I,xe._`"string"`).assign(k,j)),t.fail$data(xe.or(A(),ce()));function A(){return f.strictSchema===!1?xe.nil:xe._`${i} && !${k}`}function ce(){let Y=l.$async?xe._`(${j}.async ? await ${k}(${n}) : ${k}(${n}))`:xe._`${k}(${n})`,z=xe._`(typeof ${k} == "function" ? ${Y} : ${k}.test(${n}))`;return xe._`${k} && ${k} !== true && ${I} === ${e} && !${z}`}}function w(){let y=_.formats[s];if(!y){A();return}if(y===!0)return;let[j,I,k]=ce(y);j===e&&t.pass(Y());function A(){if(f.strictSchema===!1){_.logger.warn(z());return}throw new Error(z());function z(){return`unknown format "${s}" ignored in schema at path "${u}"`}}function ce(z){let be=z instanceof RegExp?xe.regexpCode(z):f.code.formats?xe._`${f.code.formats}${xe.getProperty(s)}`:void 0,Ge=r.scopeValue("formats",{key:s,ref:z,code:be});return typeof z=="object"&&!(z instanceof RegExp)?[z.type||"string",z.validate,xe._`${Ge}.validate`]:["string",z,Ge]}function Y(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!l.$async)throw new Error("async format in sync schema");return xe._`await ${k}(${n})`}return typeof I=="function"?xe._`${k}(${n})`:xe._`${k}.test(${n})`}}}};ch.default=$k});var nx=C(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});var Ok=rx(),vk=[Ok.default];mh.default=vk});var ax=C(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.contentVocabulary=li.metadataVocabulary=void 0;li.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];li.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var ix=C(hh=>{"use strict";Object.defineProperty(hh,"__esModule",{value:!0});var jk=cb(),Ik=jb(),kk=tx(),Sk=nx(),sx=ax(),Ck=[jk.default,Ik.default,kk.default(),Sk.default,sx.metadataVocabulary,sx.contentVocabulary];hh.default=Ck});var ox=C($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.DiscrError=void 0;var Pk;(function(t){t.Tag="tag",t.Mapping="mapping"})(Pk=$o.DiscrError||($o.DiscrError={}))});var px=C(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});var ci=Q(),gh=ox(),Gk={message:({params:{discrError:t,tagName:e}})=>t===gh.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>ci._`{error: ${t}, tag: ${r}, tagValue: ${e}}`},Dk={keyword:"discriminator",type:"object",schemaType:"object",error:Gk,code(t){let{gen:e,data:r,schema:n,parentSchema:a,it:s}=t,{oneOf:i}=a;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let o=n.propertyName;if(typeof o!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!i)throw new Error("discriminator: requires oneOf keyword");let f=e.let("valid",!1),u=e.const("tag",ci._`${r}${ci.getProperty(o)}`);e.if(ci._`typeof ${u} == "string"`,()=>l(),()=>t.error(!1,{discrError:gh.DiscrError.Tag,tag:u,tagName:o})),t.ok(f);function l(){let w=b();e.if(!1);for(let y in w)e.elseIf(ci._`${u} === ${y}`),e.assign(f,_(w[y]));e.else(),t.error(!1,{discrError:gh.DiscrError.Mapping,tag:u,tagName:o}),e.endIf()}function _(w){let y=e.name("valid"),j=t.subschema({keyword:"oneOf",schemaProp:w},y);return t.mergeEvaluated(j,ci.Name),y}function b(){var w;let y={},j=k(a),I=!0;for(let Y=0;Y<i.length;Y++){let z=i[Y],be=(w=z.properties)===null||w===void 0?void 0:w[o];if(typeof be!="object")throw new Error(`discriminator: oneOf schemas must have "properties/${o}"`);I=I&&(j||k(z)),A(be,Y)}if(!I)throw new Error(`discriminator: "${o}" must be required`);return y;function k({required:Y}){return Array.isArray(Y)&&Y.includes(o)}function A(Y,z){if(Y.const)ce(Y.const,z);else if(Y.enum)for(let be of Y.enum)ce(be,z);else throw new Error(`discriminator: "properties/${o}" must have "const" or "enum"`)}function ce(Y,z){if(typeof Y!="string"||Y in y)throw new Error(`discriminator: "${o}" values must be unique strings`);y[Y]=z}}}};_h.default=Dk});var fx=C((NX,Mk)=>{Mk.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var lx=C((je,dx)=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.CodeGen=je.Name=je.nil=je.stringify=je.str=je._=je.KeywordCxt=void 0;var Wk=ob(),Ek=ix(),Rk=px(),ux=fx(),Ak=["/properties"],ll="http://json-schema.org/draft-07/schema",Th=class extends Wk.default{_addVocabularies(){super._addVocabularies(),Ek.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(Rk.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(ux,Ak):ux;this.addMetaSchema(e,ll,!1),this.refs["http://json-schema.org/schema"]=ll}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ll)?ll:void 0)}};dx.exports=je=Th;Object.defineProperty(je,"__esModule",{value:!0});je.default=Th;var Uk=uo();Object.defineProperty(je,"KeywordCxt",{enumerable:!0,get:function(){return Uk.KeywordCxt}});var mi=Q();Object.defineProperty(je,"_",{enumerable:!0,get:function(){return mi._}});Object.defineProperty(je,"str",{enumerable:!0,get:function(){return mi.str}});Object.defineProperty(je,"stringify",{enumerable:!0,get:function(){return mi.stringify}});Object.defineProperty(je,"nil",{enumerable:!0,get:function(){return mi.nil}});Object.defineProperty(je,"Name",{enumerable:!0,get:function(){return mi.Name}});Object.defineProperty(je,"CodeGen",{enumerable:!0,get:function(){return mi.CodeGen}})});var Wx=C((Dr,Mx)=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});function Xu(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var lt=Xu(require("stream")),vx=Xu(require("http")),Wh=Xu(require("url")),gJ=Xu(require("https")),Ns=Xu(require("zlib")),_J=lt.Readable,aa=Symbol("buffer"),Eh=Symbol("type"),Bs=class{constructor(){this[Eh]="";let e=arguments[0],r=arguments[1],n=[],a=0;if(e){let i=e,o=Number(i.length);for(let f=0;f<o;f++){let u=i[f],l;u instanceof Buffer?l=u:ArrayBuffer.isView(u)?l=Buffer.from(u.buffer,u.byteOffset,u.byteLength):u instanceof ArrayBuffer?l=Buffer.from(u):u instanceof Bs?l=u[aa]:l=Buffer.from(typeof u=="string"?u:String(u)),a+=l.length,n.push(l)}}this[aa]=Buffer.concat(n);let s=r&&r.type!==void 0&&String(r.type).toLowerCase();s&&!/[^\u0020-\u007E]/.test(s)&&(this[Eh]=s)}get size(){return this[aa].length}get type(){return this[Eh]}text(){return Promise.resolve(this[aa].toString())}arrayBuffer(){let e=this[aa],r=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return Promise.resolve(r)}stream(){let e=new _J;return e._read=function(){},e.push(this[aa]),e.push(null),e}toString(){return"[object Blob]"}slice(){let e=this.size,r=arguments[0],n=arguments[1],a,s;r===void 0?a=0:r<0?a=Math.max(e+r,0):a=Math.min(r,e),n===void 0?s=e:n<0?s=Math.max(e+n,0):s=Math.min(n,e);let i=Math.max(s-a,0),f=this[aa].slice(a,a+i),u=new Bs([],{type:arguments[2]});return u[aa]=f,u}};Object.defineProperties(Bs.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});Object.defineProperty(Bs.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0});function Ee(t,e,r){Error.call(this,t),this.message=t,this.type=e,r&&(this.code=this.errno=r.code),Error.captureStackTrace(this,this.constructor)}Ee.prototype=Object.create(Error.prototype);Ee.prototype.constructor=Ee;Ee.prototype.name="FetchError";var Rh;try{Rh=require("encoding").convert}catch(t){}var sa=Symbol("Body internals"),jx=lt.PassThrough;function Ie(t){var e=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=r.size;let a=n===void 0?0:n;var s=r.timeout;let i=s===void 0?0:s;t==null?t=null:Ix(t)?t=Buffer.from(t.toString()):Yu(t)||Buffer.isBuffer(t)||(Object.prototype.toString.call(t)==="[object ArrayBuffer]"?t=Buffer.from(t):ArrayBuffer.isView(t)?t=Buffer.from(t.buffer,t.byteOffset,t.byteLength):t instanceof lt||(t=Buffer.from(String(t)))),this[sa]={body:t,disturbed:!1,error:null},this.size=a,this.timeout=i,t instanceof lt&&t.on("error",function(o){let f=o.name==="AbortError"?o:new Ee(`Invalid response body while trying to fetch ${e.url}: ${o.message}`,"system",o);e[sa].error=f})}Ie.prototype={get body(){return this[sa].body},get bodyUsed(){return this[sa].disturbed},arrayBuffer(){return Pi.call(this).then(function(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)})},blob(){let t=this.headers&&this.headers.get("content-type")||"";return Pi.call(this).then(function(e){return Object.assign(new Bs([],{type:t.toLowerCase()}),{[aa]:e})})},json(){var t=this;return Pi.call(this).then(function(e){try{return JSON.parse(e.toString())}catch(r){return Ie.Promise.reject(new Ee(`invalid json response body at ${t.url} reason: ${r.message}`,"invalid-json"))}})},text(){return Pi.call(this).then(function(t){return t.toString()})},buffer(){return Pi.call(this)},textConverted(){var t=this;return Pi.call(this).then(function(e){return TJ(e,t.headers)})}};Object.defineProperties(Ie.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});Ie.mixIn=function(t){for(let e of Object.getOwnPropertyNames(Ie.prototype))if(!(e in t)){let r=Object.getOwnPropertyDescriptor(Ie.prototype,e);Object.defineProperty(t,e,r)}};function Pi(){var t=this;if(this[sa].disturbed)return Ie.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[sa].disturbed=!0,this[sa].error)return Ie.Promise.reject(this[sa].error);let e=this.body;if(e===null)return Ie.Promise.resolve(Buffer.alloc(0));if(Yu(e)&&(e=e.stream()),Buffer.isBuffer(e))return Ie.Promise.resolve(e);if(!(e instanceof lt))return Ie.Promise.resolve(Buffer.alloc(0));let r=[],n=0,a=!1;return new Ie.Promise(function(s,i){let o;t.timeout&&(o=setTimeout(function(){a=!0,i(new Ee(`Response timeout while trying to fetch ${t.url} (over ${t.timeout}ms)`,"body-timeout"))},t.timeout)),e.on("error",function(f){f.name==="AbortError"?(a=!0,i(f)):i(new Ee(`Invalid response body while trying to fetch ${t.url}: ${f.message}`,"system",f))}),e.on("data",function(f){if(!(a||f===null)){if(t.size&&n+f.length>t.size){a=!0,i(new Ee(`content size at ${t.url} over limit: ${t.size}`,"max-size"));return}n+=f.length,r.push(f)}}),e.on("end",function(){if(!a){clearTimeout(o);try{s(Buffer.concat(r,n))}catch(f){i(new Ee(`Could not create Buffer from response body for ${t.url}: ${f.message}`,"system",f))}}})})}function TJ(t,e){if(typeof Rh!="function")throw new Error("The package `encoding` must be installed to use the textConverted() function");let r=e.get("content-type"),n="utf-8",a,s;return r&&(a=/charset=([^;]*)/i.exec(r)),s=t.slice(0,1024).toString(),!a&&s&&(a=/<meta.+?charset=(['"])(.+?)\1/i.exec(s)),!a&&s&&(a=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(s),a||(a=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(s),a&&a.pop()),a&&(a=/charset=(.*)/i.exec(a.pop()))),!a&&s&&(a=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(s)),a&&(n=a.pop(),(n==="gb2312"||n==="gbk")&&(n="gb18030")),Rh(t,"UTF-8",n).toString()}function Ix(t){return typeof t!="object"||typeof t.append!="function"||typeof t.delete!="function"||typeof t.get!="function"||typeof t.getAll!="function"||typeof t.has!="function"||typeof t.set!="function"?!1:t.constructor.name==="URLSearchParams"||Object.prototype.toString.call(t)==="[object URLSearchParams]"||typeof t.sort=="function"}function Yu(t){return typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.constructor=="function"&&typeof t.constructor.name=="string"&&/^(Blob|File)$/.test(t.constructor.name)&&/^(Blob|File)$/.test(t[Symbol.toStringTag])}function kx(t){let e,r,n=t.body;if(t.bodyUsed)throw new Error("cannot clone body after it is used");return n instanceof lt&&typeof n.getBoundary!="function"&&(e=new jx,r=new jx,n.pipe(e),n.pipe(r),t[sa].body=e,n=r),n}function Sx(t){return t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":Ix(t)?"application/x-www-form-urlencoded;charset=UTF-8":Yu(t)?t.type||null:Buffer.isBuffer(t)||Object.prototype.toString.call(t)==="[object ArrayBuffer]"||ArrayBuffer.isView(t)?null:typeof t.getBoundary=="function"?`multipart/form-data;boundary=${t.getBoundary()}`:t instanceof lt?null:"text/plain;charset=UTF-8"}function Cx(t){let e=t.body;return e===null?0:Yu(e)?e.size:Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&(e._lengthRetrievers&&e._lengthRetrievers.length==0||e.hasKnownLength&&e.hasKnownLength())?e.getLengthSync():null}function yJ(t,e){let r=e.body;r===null?t.end():Yu(r)?r.stream().pipe(t):Buffer.isBuffer(r)?(t.write(r),t.end()):r.pipe(t)}Ie.Promise=global.Promise;var Px=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,Ah=/[^\t\x20-\x7e\x80-\xff]/;function Zu(t){if(t=`${t}`,Px.test(t)||t==="")throw new TypeError(`${t} is not a legal HTTP header name`)}function Gx(t){if(t=`${t}`,Ah.test(t))throw new TypeError(`${t} is not a legal HTTP header value`)}function Gi(t,e){e=e.toLowerCase();for(let r in t)if(r.toLowerCase()===e)return r}var Fe=Symbol("map"),Ke=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;if(this[Fe]=Object.create(null),e instanceof Ke){let r=e.raw(),n=Object.keys(r);for(let a of n)for(let s of r[a])this.append(a,s);return}if(e!=null)if(typeof e=="object"){let r=e[Symbol.iterator];if(r!=null){if(typeof r!="function")throw new TypeError("Header pairs must be iterable");let n=[];for(let a of e){if(typeof a!="object"||typeof a[Symbol.iterator]!="function")throw new TypeError("Each header pair must be iterable");n.push(Array.from(a))}for(let a of n){if(a.length!==2)throw new TypeError("Each header pair must be a name/value tuple");this.append(a[0],a[1])}}else for(let n of Object.keys(e)){let a=e[n];this.append(n,a)}}else throw new TypeError("Provided initializer must be an object")}get(e){e=`${e}`,Zu(e);let r=Gi(this[Fe],e);return r===void 0?null:this[Fe][r].join(", ")}forEach(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=Uh(this),a=0;for(;a<n.length;){var s=n[a];let i=s[0],o=s[1];e.call(r,o,i,this),n=Uh(this),a++}}set(e,r){e=`${e}`,r=`${r}`,Zu(e),Gx(r);let n=Gi(this[Fe],e);this[Fe][n!==void 0?n:e]=[r]}append(e,r){e=`${e}`,r=`${r}`,Zu(e),Gx(r);let n=Gi(this[Fe],e);n!==void 0?this[Fe][n].push(r):this[Fe][e]=[r]}has(e){return e=`${e}`,Zu(e),Gi(this[Fe],e)!==void 0}delete(e){e=`${e}`,Zu(e);let r=Gi(this[Fe],e);r!==void 0&&delete this[Fe][r]}raw(){return this[Fe]}keys(){return Nh(this,"key")}values(){return Nh(this,"value")}[Symbol.iterator](){return Nh(this,"key+value")}};Ke.prototype.entries=Ke.prototype[Symbol.iterator];Object.defineProperty(Ke.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(Ke.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});function Uh(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"key+value";return Object.keys(t[Fe]).sort().map(e==="key"?function(n){return n.toLowerCase()}:e==="value"?function(n){return t[Fe][n].join(", ")}:function(n){return[n.toLowerCase(),t[Fe][n].join(", ")]})}var qh=Symbol("internal");function Nh(t,e){let r=Object.create(Bh);return r[qh]={target:t,kind:e,index:0},r}var Bh=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==Bh)throw new TypeError("Value of `this` is not a HeadersIterator");var t=this[qh];let e=t.target,r=t.kind,n=t.index,a=Uh(e,r),s=a.length;return n>=s?{value:void 0,done:!0}:(this[qh].index=n+1,{value:a[n],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));Object.defineProperty(Bh,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});function bJ(t){let e=Object.assign({__proto__:null},t[Fe]),r=Gi(t[Fe],"Host");return r!==void 0&&(e[r]=e[r][0]),e}function xJ(t){let e=new Ke;for(let r of Object.keys(t))if(!Px.test(r))if(Array.isArray(t[r]))for(let n of t[r])Ah.test(n)||(e[Fe][r]===void 0?e[Fe][r]=[n]:e[Fe][r].push(n));else Ah.test(t[r])||(e[Fe][r]=[t[r]]);return e}var Va=Symbol("Response internals"),FJ=vx.STATUS_CODES,rt=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ie.call(this,e,r);let n=r.status||200,a=new Ke(r.headers);if(e!=null&&!a.has("Content-Type")){let s=Sx(e);s&&a.append("Content-Type",s)}this[Va]={url:r.url,status:n,statusText:r.statusText||FJ[n],headers:a,counter:r.counter}}get url(){return this[Va].url||""}get status(){return this[Va].status}get ok(){return this[Va].status>=200&&this[Va].status<300}get redirected(){return this[Va].counter>0}get statusText(){return this[Va].statusText}get headers(){return this[Va].headers}clone(){return new rt(kx(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}};Ie.mixIn(rt.prototype);Object.defineProperties(rt.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});Object.defineProperty(rt.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});var ia=Symbol("Request internals"),Lh=Wh.parse,wJ=Wh.format,$J="destroy"in lt.Readable.prototype;function gl(t){return typeof t=="object"&&typeof t[ia]=="object"}function OJ(t){let e=t&&typeof t=="object"&&Object.getPrototypeOf(t);return!!(e&&e.constructor.name==="AbortSignal")}var oa=class{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n;gl(e)?n=Lh(e.url):(e&&e.href?n=Lh(e.href):n=Lh(`${e}`),e={});let a=r.method||e.method||"GET";if(a=a.toUpperCase(),(r.body!=null||gl(e)&&e.body!==null)&&(a==="GET"||a==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let s=r.body!=null?r.body:gl(e)&&e.body!==null?kx(e):null;Ie.call(this,s,{timeout:r.timeout||e.timeout||0,size:r.size||e.size||0});let i=new Ke(r.headers||e.headers||{});if(s!=null&&!i.has("Content-Type")){let f=Sx(s);f&&i.append("Content-Type",f)}let o=gl(e)?e.signal:null;if("signal"in r&&(o=r.signal),o!=null&&!OJ(o))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[ia]={method:a,redirect:r.redirect||e.redirect||"follow",headers:i,parsedURL:n,signal:o},this.follow=r.follow!==void 0?r.follow:e.follow!==void 0?e.follow:20,this.compress=r.compress!==void 0?r.compress:e.compress!==void 0?e.compress:!0,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent}get method(){return this[ia].method}get url(){return wJ(this[ia].parsedURL)}get headers(){return this[ia].headers}get redirect(){return this[ia].redirect}get signal(){return this[ia].signal}clone(){return new oa(this)}};Ie.mixIn(oa.prototype);Object.defineProperty(oa.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(oa.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}});function vJ(t){let e=t[ia].parsedURL,r=new Ke(t[ia].headers);if(r.has("Accept")||r.set("Accept","*/*"),!e.protocol||!e.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(e.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(t.signal&&t.body instanceof lt.Readable&&!$J)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let n=null;if(t.body==null&&/^(POST|PUT)$/i.test(t.method)&&(n="0"),t.body!=null){let s=Cx(t);typeof s=="number"&&(n=String(s))}n&&r.set("Content-Length",n),r.has("User-Agent")||r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let a=t.agent;return typeof a=="function"&&(a=a(e)),!r.has("Connection")&&!a&&r.set("Connection","close"),Object.assign({},e,{method:t.method,headers:bJ(r),agent:a})}function ed(t){Error.call(this,t),this.type="aborted",this.message=t,Error.captureStackTrace(this,this.constructor)}ed.prototype=Object.create(Error.prototype);ed.prototype.constructor=ed;ed.prototype.name="AbortError";var Dx=lt.PassThrough,jJ=Wh.resolve;function Ha(t,e){if(!Ha.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return Ie.Promise=Ha.Promise,new Ha.Promise(function(r,n){let a=new oa(t,e),s=vJ(a),i=(s.protocol==="https:"?gJ:vx).request,o=a.signal,f=null,u=function(){let j=new ed("The user aborted a request.");n(j),a.body&&a.body instanceof lt.Readable&&a.body.destroy(j),!(!f||!f.body)&&f.body.emit("error",j)};if(o&&o.aborted){u();return}let l=function(){u(),w()},_=i(s),b;o&&o.addEventListener("abort",l);function w(){_.abort(),o&&o.removeEventListener("abort",l),clearTimeout(b)}a.timeout&&_.once("socket",function(y){b=setTimeout(function(){n(new Ee(`network timeout at: ${a.url}`,"request-timeout")),w()},a.timeout)}),_.on("error",function(y){n(new Ee(`request to ${a.url} failed, reason: ${y.message}`,"system",y)),w()}),_.on("response",function(y){clearTimeout(b);let j=xJ(y.headers);if(Ha.isRedirect(y.statusCode)){let Y=j.get("Location"),z=Y===null?null:jJ(a.url,Y);switch(a.redirect){case"error":n(new Ee(`uri requested responds with a redirect, redirect mode is set to error: ${a.url}`,"no-redirect")),w();return;case"manual":if(z!==null)try{j.set("Location",z)}catch(Ge){n(Ge)}break;case"follow":if(z===null)break;if(a.counter>=a.follow){n(new Ee(`maximum redirect reached at: ${a.url}`,"max-redirect")),w();return}let be={headers:new Ke(a.headers),follow:a.follow,counter:a.counter+1,agent:a.agent,compress:a.compress,method:a.method,body:a.body,signal:a.signal,timeout:a.timeout,size:a.size};if(y.statusCode!==303&&a.body&&Cx(a)===null){n(new Ee("Cannot follow redirect with body being a readable stream","unsupported-redirect")),w();return}(y.statusCode===303||(y.statusCode===301||y.statusCode===302)&&a.method==="POST")&&(be.method="GET",be.body=void 0,be.headers.delete("content-length")),r(Ha(new oa(z,be))),w();return}}y.once("end",function(){o&&o.removeEventListener("abort",l)});let I=y.pipe(new Dx),k={url:a.url,status:y.statusCode,statusText:y.statusMessage,headers:j,size:a.size,timeout:a.timeout,counter:a.counter},A=j.get("Content-Encoding");if(!a.compress||a.method==="HEAD"||A===null||y.statusCode===204||y.statusCode===304){f=new rt(I,k),r(f);return}let ce={flush:Ns.Z_SYNC_FLUSH,finishFlush:Ns.Z_SYNC_FLUSH};if(A=="gzip"||A=="x-gzip"){I=I.pipe(Ns.createGunzip(ce)),f=new rt(I,k),r(f);return}if(A=="deflate"||A=="x-deflate"){y.pipe(new Dx).once("data",function(z){(z[0]&15)==8?I=I.pipe(Ns.createInflate()):I=I.pipe(Ns.createInflateRaw()),f=new rt(I,k),r(f)});return}if(A=="br"&&typeof Ns.createBrotliDecompress=="function"){I=I.pipe(Ns.createBrotliDecompress()),f=new rt(I,k),r(f);return}f=new rt(I,k),r(f)}),yJ(_,a)})}Ha.isRedirect=function(t){return t===301||t===302||t===303||t===307||t===308};Ha.Promise=global.Promise;Mx.exports=Dr=Ha;Object.defineProperty(Dr,"__esModule",{value:!0});Dr.default=Dr;Dr.Headers=Ke;Dr.Request=oa;Dr.Response=rt;Dr.FetchError=Ee});var Rx=C((Ls,Ex)=>{var td=Wx(),IJ=td.default||td,_l=function(t,e){return/^\/\//.test(t)&&(t="https:"+t),IJ.call(this,t,e)};_l.ponyfill=!0;Ex.exports=Ls=_l;Ls.fetch=_l;Ls.Headers=td.Headers;Ls.Request=td.Request;Ls.Response=td.Response;Ls.default=_l});IF(exports,{APIFunctions:()=>R,APIValidators:()=>Dh,AggregateTransferManyTxInputSchema:()=>nf,AggregateTransferManyTxOutputSchema:()=>af,AggregateTransfersFnInputSchema:()=>Uo,AggregateTransfersFnOutputSchema:()=>qo,AuthenticationCheckTxInputSchema:()=>sf,AuthenticationCheckTxOutputSchema:()=>of,Client:()=>sd,ClientFunctions:()=>U,ClientFunctionsEnum:()=>mg,ClientQueryBuilderFunctionsEnum:()=>hg,ClientValidators:()=>g4,ConstsSchema:()=>cs,CreateAccessTokenFnInputSchema:()=>No,CreateAccessTokenFnOutputSchema:()=>Bo,CreateAccessTokenTxInputSchema:()=>pf,CreateAccessTokenTxOutputSchema:()=>ff,CreateContractFnInputSchema:()=>Lo,CreateContractFnOutputSchema:()=>Vo,CreateContractTxInputSchema:()=>uf,CreateContractTxOutputSchema:()=>df,CreateDepositFnInputSchema:()=>Ho,CreateDepositFnOutputSchema:()=>zo,CreateDepositTxInputSchema:()=>lf,CreateDepositTxOutputSchema:()=>cf,CreateDistributionTxInputSchema:()=>mf,CreateDistributionTxOutputSchema:()=>hf,CreateExchangeFnInputSchema:()=>Ko,CreateExchangeFnOutputSchema:()=>Qo,CreateTokenFnInputSchema:()=>Jo,CreateTokenFnOutputSchema:()=>Xo,CreateTokenTxInputSchema:()=>gf,CreateTokenTxOutputSchema:()=>_f,CreateTransferFnInputSchema:()=>Yo,CreateTransferFnOutputSchema:()=>Zo,CreateTransferGroupFnInputSchema:()=>ep,CreateTransferGroupFnOutputSchema:()=>tp,CreateTransferGroupTxInputSchema:()=>bf,CreateTransferGroupTxOutputSchema:()=>xf,CreateTransferManyTxInputSchema:()=>Ff,CreateTransferManyTxOutputSchema:()=>wf,CreateTransferTxInputSchema:()=>Tf,CreateTransferTxOutputSchema:()=>yf,CreateTransfersFnInputSchema:()=>rp,CreateTransfersFnOutputSchema:()=>np,CreateWalletFnInputSchema:()=>ap,CreateWalletFnOutputSchema:()=>sp,CreateWalletTxInputSchema:()=>$f,CreateWalletTxOutputSchema:()=>Of,CreateWithdrawalFnInputSchema:()=>ip,CreateWithdrawalFnOutputSchema:()=>op,CreateWithdrawalTxInputSchema:()=>vf,CreateWithdrawalTxOutputSchema:()=>jf,DbFilterFunctionBasicEnum:()=>Xh,DbFilterFunctionInEnum:()=>Yh,DbFilterFunctionMetadataBasicEnum:()=>Jh,DbFilterFunctionMetadataInEnum:()=>Zh,DbFilterFunctionMetadataNullEnum:()=>eg,DbFilterFunctionNullEnum:()=>tg,DbFilterOperatorEnum:()=>rg,DbFilterOperatorExtendedEnum:()=>ag,DbFilterOperatorStringEnum:()=>ng,DbModelNameEnum:()=>cg,ErrorMessage:()=>re,Errors:()=>me,ExportDatabaseTxInputSchema:()=>If,ExportDatabaseTxOutputSchema:()=>kf,FindBalanceManyTxInputSchema:()=>Sf,FindBalanceManyTxOutputSchema:()=>Cf,FindBalancesFnInputSchema:()=>pp,FindBalancesFnOutputSchema:()=>fp,FindTokenManyTxInputSchema:()=>Pf,FindTokenManyTxOutputSchema:()=>Gf,FindTokensFnInputSchema:()=>up,FindTokensFnOutputSchema:()=>dp,FindTransferGroupManyTxInputSchema:()=>Df,FindTransferGroupManyTxOutputSchema:()=>Mf,FindTransferGroupsFnInputSchema:()=>lp,FindTransferGroupsFnOutputSchema:()=>cp,FindTransferManyTxInputSchema:()=>Wf,FindTransferManyTxOutputSchema:()=>Ef,FindTransfersFnInputSchema:()=>mp,FindTransfersFnOutputSchema:()=>hp,FindWalletManyTxInputSchema:()=>Rf,FindWalletManyTxOutputSchema:()=>Af,FindWalletsFnInputSchema:()=>gp,FindWalletsFnOutputSchema:()=>_p,FinishTransactionTxInputSchema:()=>Uf,FinishTransactionTxOutputSchema:()=>qf,FnConstsSchema:()=>yp,GetBalanceFnInputSchema:()=>bp,GetBalanceFnOutputSchema:()=>xp,GetBalanceHistoryFnInputSchema:()=>Fp,GetBalanceHistoryFnOutputSchema:()=>wp,GetBalanceHistoryTxInputSchema:()=>Lf,GetBalanceHistoryTxOutputSchema:()=>Vf,GetBalanceTxInputSchema:()=>Nf,GetBalanceTxOutputSchema:()=>Bf,GetDatabaseExportProgressTxInputSchema:()=>Hf,GetDatabaseExportProgressTxOutputSchema:()=>zf,GetDatabaseImportProgressTxInputSchema:()=>Kf,GetDatabaseImportProgressTxOutputSchema:()=>Qf,GetFlagsFnInputSchema:()=>$p,GetFlagsFnOutputSchema:()=>Op,GetFlagsTxInputSchema:()=>Jf,GetFlagsTxOutputSchema:()=>Xf,GetStatisticsFnInputSchema:()=>vp,GetStatisticsFnOutputSchema:()=>jp,GetStatisticsTxInputSchema:()=>Yf,GetStatisticsTxOutputSchema:()=>Zf,GetTokenFnInputSchema:()=>Ip,GetTokenFnOutputSchema:()=>kp,GetTokenManyTxInputSchema:()=>ru,GetTokenManyTxOutputSchema:()=>nu,GetTokenTxInputSchema:()=>eu,GetTokenTxOutputSchema:()=>tu,GetTransferFnInputSchema:()=>Sp,GetTransferFnOutputSchema:()=>Cp,GetTransferGroupFnInputSchema:()=>Pp,GetTransferGroupFnOutputSchema:()=>Gp,GetTransferGroupTxInputSchema:()=>iu,GetTransferGroupTxOutputSchema:()=>ou,GetTransferTxInputSchema:()=>au,GetTransferTxOutputSchema:()=>su,GetWalletFnInputSchema:()=>Dp,GetWalletFnOutputSchema:()=>Mp,GetWalletManyTxInputSchema:()=>uu,GetWalletManyTxOutputSchema:()=>du,GetWalletTxInputSchema:()=>pu,GetWalletTxOutputSchema:()=>fu,ITxAggregatorSimpleEnum:()=>Sh,ITxDistributorLeftoverRuleEnum:()=>Ch,ITxMetadataActionEnum:()=>Ph,ITxMetadataActionForReverseEnum:()=>Gh,ITxPeriodSimpleEnum:()=>Ju,ImportActionsTxInputSchema:()=>Us,ImportActionsTxOutputSchema:()=>lu,ImportDataFnInputSchema:()=>Ss,ImportDataFnOutputSchema:()=>Wp,ImportDatabaseTxInputSchema:()=>cu,ImportDatabaseTxOutputSchema:()=>mu,ListDatabaseBackupsTxInputSchema:()=>hu,ListDatabaseBackupsTxOutputSchema:()=>gu,QueryBuilder:()=>Qe,QueryLogsTxInputSchema:()=>yu,QueryLogsTxOutputSchema:()=>bu,QueryTxInputSchema:()=>_u,QueryTxOutputSchema:()=>Tu,ResetDatabaseTxInputSchema:()=>xu,ResetDatabaseTxOutputSchema:()=>Fu,ReverseTransferFnInputSchema:()=>Ep,ReverseTransferFnOutputSchema:()=>Rp,ReverseTransferGroupFnInputSchema:()=>Ap,ReverseTransferGroupFnOutputSchema:()=>Up,ReverseTransferGroupManyTxInputSchema:()=>ju,ReverseTransferGroupManyTxOutputSchema:()=>Iu,ReverseTransferGroupTxInputSchema:()=>Ou,ReverseTransferGroupTxOutputSchema:()=>vu,ReverseTransferManyTxInputSchema:()=>ku,ReverseTransferManyTxOutputSchema:()=>Su,ReverseTransferTxInputSchema:()=>wu,ReverseTransferTxOutputSchema:()=>$u,ReverseTransfersFnInputSchema:()=>qp,ReverseTransfersFnOutputSchema:()=>Np,SetFlagsFnInputSchema:()=>Bp,SetFlagsFnOutputSchema:()=>Lp,SetFlagsTxInputSchema:()=>Cu,SetFlagsTxOutputSchema:()=>Pu,StartTransactionTxInputSchema:()=>Gu,StartTransactionTxOutputSchema:()=>Du,StreamPromise:()=>ua,TokenStatusEnum:()=>ig,TokenTableInputSchema:()=>vo,TokenTableSchema:()=>jo,TokenTypeEnum:()=>sg,TransferGroupStatusEnum:()=>ad,TransferGroupTableInputSchema:()=>So,TransferGroupTableSchema:()=>Co,TransferGroupTypeEnum:()=>fg,TransferLogTableInputSchema:()=>Po,TransferLogTableSchema:()=>Go,TransferStatusEnum:()=>og,TransferStatusInputEnum:()=>pg,TransferTableInputSchema:()=>Io,TransferTableSchema:()=>ko,TransferTypeEnum:()=>za,TxConstsSchema:()=>Wu,UpdateTokenFnInputSchema:()=>Vp,UpdateTokenFnOutputSchema:()=>Hp,UpdateTokenTxInputSchema:()=>Eu,UpdateTokenTxOutputSchema:()=>Ru,UpdateTransferFnInputSchema:()=>zp,UpdateTransferFnOutputSchema:()=>Kp,UpdateTransferGroupFnInputSchema:()=>Qp,UpdateTransferGroupFnOutputSchema:()=>Jp,UpdateTransferGroupManyTxInputSchema:()=>Bu,UpdateTransferGroupManyTxOutputSchema:()=>Lu,UpdateTransferGroupTxInputSchema:()=>qu,UpdateTransferGroupTxOutputSchema:()=>Nu,UpdateTransferGroupsFnInputSchema:()=>Xp,UpdateTransferGroupsFnOutputSchema:()=>Yp,UpdateTransferManyTxInputSchema:()=>Vu,UpdateTransferManyTxOutputSchema:()=>Hu,UpdateTransferTxInputSchema:()=>Au,UpdateTransferTxOutputSchema:()=>Uu,UpdateTransfersFnInputSchema:()=>Zp,UpdateTransfersFnOutputSchema:()=>ef,UpdateWalletFnInputSchema:()=>tf,UpdateWalletFnOutputSchema:()=>rf,UpdateWalletTxInputSchema:()=>zu,UpdateWalletTxOutputSchema:()=>Ku,Validator:()=>Qu,WalletStatusEnum:()=>dg,WalletTableInputSchema:()=>Do,WalletTableSchema:()=>Mo,WalletTokenSettingTableInputSchema:()=>Wo,WalletTokenSettingTableSchema:()=>Eo,WalletTypeEnum:()=>ug,WapiClientType:()=>dt,WapiSettingTableInputSchema:()=>Ro,WapiSettingTableSchema:()=>Ao,WapiSettingTypeEnum:()=>lg,aggregateTransfers:()=>yl,create:()=>T4,createAccessToken:()=>bl,createContract:()=>xl,createDeposit:()=>Fl,createExchange:()=>wl,createToken:()=>$l,createTransfer:()=>Ol,createTransferGroup:()=>vl,createTransfers:()=>jl,createWallet:()=>Il,createWithdrawal:()=>kl,findBalances:()=>Sl,findTokens:()=>Cl,findTransferGroups:()=>Pl,findTransfers:()=>Gl,findWallets:()=>Dl,getBalance:()=>Ml,getBalanceHistory:()=>Wl,getFlags:()=>El,getStatistics:()=>Rl,getToken:()=>Al,getTransfer:()=>Ul,getTransferGroup:()=>ql,getWallet:()=>Nl,importData:()=>Ll,isImportDataFnInput:()=>Bl,isImportDataFnOptions:()=>Mi,reverseTransfer:()=>Vl,reverseTransferGroup:()=>Hl,reverseTransfers:()=>zl,setFlags:()=>Kl,updateToken:()=>Ql,updateTransfer:()=>Jl,updateTransferGroup:()=>Xl,updateTransferGroups:()=>Yl,updateTransfers:()=>Zl,updateWallet:()=>ec,utils:()=>y4});var Dc=ri(Gc()),pT=Gc();function pe(...t){process.env.WAPI_DEBUG&&console.log(...t)}var Hr=class extends Error{constructor({code:e,message:r,data:n,description:a}){super(r);var s;this.code=e,this.message=r,this.data=n,this.description=(s=a!=null?a:Nw[r])!=null?s:""}toJSON(){return{code:this.code,message:this.message,description:this.description,data:this.data}}},fT=class extends Hr{constructor({message:e,data:r,code:n}){super({message:e,data:r,code:n||me.DatabaseError})}},Ne=class extends Hr{constructor({message:e,data:r,code:n}){super({message:e,data:r,code:n||me.SchemaValidationError})}},de=class extends Hr{constructor({message:e,data:r,code:n}){super({message:e,data:r,code:n||me.InputError})}},uT=class extends Hr{constructor({message:e,data:r,code:n}){super({message:e,data:r,code:n||me.ConstraintError})}},dT=class extends Hr{constructor({message:e,data:r,code:n}){super({message:e,data:r,code:n||me.UnknownError})}},hd=class extends Hr{constructor({message:e,data:r,code:n}){super({message:e,data:r,code:n||me.ConnectionError})}},gd=class extends Hr{constructor({message:e,data:r,code:n}){super({message:e,data:r,code:n||me.StreamError})}},_d=class extends Hr{constructor({message:e,data:r,code:n}){super({message:e,data:r,code:n||me.AuthenticationError})}};function Mc({message:t,data:e,code:r}){switch(r){case me.SchemaValidationError:return new Ne({message:t,data:e,code:r});case me.DatabaseError:return new fT({message:t,data:e,code:r});case me.InputError:return new de({message:t,data:e,code:r});case me.ConstraintError:return new uT({message:t,data:e,code:r});case me.ConnectionError:return new hd({message:t,data:e,code:r});case me.StreamError:return new gd({message:t,data:e,code:r});case me.AuthenticationError:return new _d({message:t,data:e,code:r});default:return new dT({message:t,data:e,code:r})}}var me;(function(f){f.SchemaValidationError="SchemaValidationError",f.DatabaseError="DatabaseError",f.InputError="InputError",f.UnknownError="UnknownError",f.ConstraintError="ConstraintError",f.ConnectionError="ConnectionError",f.StreamError="StreamError",f.AuthenticationError="AuthenticationError"})(me||(me={}));var re;(function(v){v.AUTHENTICATION_FAILED="AUTHENTICATION_FAILED",v.BAL_FUTURE_DATETIME="BAL_FUTURE_DATETIME",v.CONFLICTING_OPTIONS="CONFLICTING_OPTIONS",v.CONTRACT_OWNER_NOT_FOUND="CONTRACT_OWNER_NOT_FOUND",v.DATABASE_ERROR="DATABASE_ERROR",v.DISTRIBUTION_MISSING_TARGETS="DISTRIBUTION_MISSING_TARGETS",v.EXCHANGE_MISSING_TARGETS="EXCHANGE_MISSING_TARGETS",v.IMPORT_MISSING_CONTRACT_TOKEN="IMPORT_MISSING_CONTRACT_TOKEN",v.IMPORT_MISSING_TOKEN_WALLET="IMPORT_MISSING_TOKEN_WALLET",v.IMPORT_OBJECT_DUPLICATE="IMPORT_OBJECT_DUPLICATE",v.IMPORT_OBJECT_EXISTS="IMPORT_OBJECT_EXISTS",v.IMPORT_PREDATED_TRANSFER="IMPORT_PREDATED_TRANSFER",v.IMPORT_USE_BEFORE_CREATE="IMPORT_USE_BEFORE_CREATE",v.INPUT_NEEDS_IDENTIFIER="INPUT_NEEDS_IDENTIFIER",v.INPUT_NEEDS_TOKEN="INPUT_NEEDS_TOKEN",v.INPUT_STREAM_ERROR="INPUT_STREAM_ERROR",v.INPUT_STREAM_TIMEOUT="INPUT_STREAM_TIMEOUT",v.INPUT_STREAM_INVALID="INPUT_STREAM_INVALID",v.INPUT_STREAM_NOT_ALLOWED="INPUT_STREAM_NOT_ALLOWED",v.INPUT_INVALID="INPUT_INVALID",v.INVALID_COMPLEX_FILTER="INVALID_COMPLEX_FILTER",v.INVALID_FIELD_AGR_COMB="INVALID_FIELD_AGR_COMB",v.INVALID_FIELD_FOR_MODEL="INVALID_FIELD_FOR_MODEL",v.INVALID_LATEST_HASH="INVALID_LATEST_HASH",v.INVALID_MODEL="INVALID_MODEL",v.NO_METADATA_ON_MODEL="NO_METADATA_ON_MODEL",v.RUNNING_BALANCE_WITHOUT_WALLET="RUNNING_BALANCE_WITHOUT_WALLET",v.SIGNED_AMOUNT_WITHOUT_WALLET="SIGNED_AMOUNT_WITHOUT_WALLET",v.TOKEN_INVALID_WALLET="TOKEN_INVALID_WALLET",v.TOKEN_LIMIT_REACHED="TOKEN_LIMIT_REACHED",v.TR_AMOUNT_NOT_DIVISIBLE="TR_AMOUNT_NOT_DIVISIBLE",v.TR_CANCELLED_CANT_RV="TR_CANCELLED_CANT_RV",v.TR_CANT_UPDATE_TO_PENDING="TR_CANT_UPDATE_TO_PENDING",v.TR_DEPOSIT_CANT_RV_WITHOUT_FLAG="TR_DEPOSIT_CANT_RV_WITHOUT_FLAG",v.TR_FROM_WALLET_DEPOSIT="TR_FROM_WALLET_DEPOSIT",v.TR_FROM_WALLET_STATUS_CONSTRAINT="TR_FROM_WALLET_STATUS_CONSTRAINT",v.TR_INVALID_BALANCE="TR_INVALID_BALANCE",v.TR_INVALID_CANCELLED="TR_INVALID_CANCELLED",v.TR_TIMESTAMP_IN_PAST="TR_TIMESTAMP_IN_PAST",v.TR_TO_WALLET_STATUS_CONSTRAINT="TR_TO_WALLET_STATUS_CONSTRAINT",v.TR_TO_WALLET_WITHDRAWAL="TR_TO_WALLET_WITHDRAWAL",v.TR_TOKEN_DISABLED="TR_TOKEN_DISABLED",v.TR_TOKEN_DWONLY="TR_TOKEN_DWONLY",v.TR_TRG_CLOSED="TR_TRG_CLOSED",v.TR_TRG_STATUS_MISMATCH="TR_TRG_STATUS_MISMATCH",v.TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG="TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG",v.TRANSACTION_NOT_FOUND="TRANSACTION_NOT_FOUND",v.TRANSACTION_TIMEOUT="TRANSACTION_TIMEOUT",v.TRG_BALANCE_CHECK_REQUIRED_WITHOUT_STATUS_LOCK="TRG_BALANCE_CHECK_REQUIRED_WITHOUT_STATUS_LOCK",v.TRG_CANCELLED_CANT_RV="TRG_CANCELLED_CANT_RV",v.TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG="TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG",v.TRG_SINGLE_PENDING_TR_CANT_RV="TRG_SINGLE_PENDING_TR_CANT_RV",v.TRG_WITHDRAWAL_CANT_RV_WITHOUT_FLAG="TRG_WITHDRAWAL_CANT_RV_WITHOUT_FLAG",v.UNCLEAR_AGGREGATOR="UNCLEAR_AGGREGATOR",v.TR_MISSING_FILTER="TR_MISSING_FILTER",v.TRG_MISSING_FILTER="TRG_MISSING_FILTER",v.HTTP_BODY_SIZE="HTTP_BODY_SIZE",v.METHOD_DISABLED="METHOD_DISABLED",v.DATABASE_IMPORT_UNEXPECTED_ERROR="DATABASE_IMPORT_UNEXPECTED_ERROR",v.DATABASE_IMPORT_NOT_FOUND="DATABASE_IMPORT_NOT_FOUND",v.DATABASE_BACKUP_CREATE_UNEXPECTED_ERROR="DATABASE_BACKUP_CREATE_UNEXPECTED_ERROR",v.LIST_DATABASE_BACKUPS_UNEXPECTED_ERROR="LIST_DATABASE_BACKUPS_UNEXPECTED_ERROR",v.IMPORT_DATABASE_PROGRESS_NOT_FOUND="IMPORT_DATABASE_PROGRESS_NOT_FOUND",v.IMPORT_DATABASE_PROGRESS_UNEXPECTED_ERROR="IMPORT_DATABASE_PROGRESS_UNEXPECTED_ERROR",v.DATABASE_BACKUP_PROGRESS_NOT_FOUND="DATABASE_BACKUP_PROGRESS_NOT_FOUND",v.DATABASE_BACKUP_PROGRESS_UNEXPECTED_ERROR="DATABASE_BACKUP_PROGRESS_UNEXPECTED_ERROR"})(re||(re={}));var Nw={AUTHENTICATION_FAILED:"Provided credentials are invalid",BAL_FUTURE_DATETIME:"Balance datetime can't be in the future",CONFLICTING_OPTIONS:"return_running_balance and return_running_balance_for can't be specified together",CONTRACT_OWNER_NOT_FOUND:"Unable to find Wallet specified as Contract token owner",DATABASE_ERROR:"Something went wrong in the DB layer",DISTRIBUTION_MISSING_TARGETS:"Unable to resolve all targets (Wallets, Tokens) for distribution request",EXCHANGE_MISSING_TARGETS:"Unable to resolve all targets (Wallets, Token) for exchange request",IMPORT_MISSING_CONTRACT_TOKEN:"The import contract specifies Token that does not exist",IMPORT_MISSING_TOKEN_WALLET:"The import results in invalid Token without valid Wallet",IMPORT_OBJECT_DUPLICATE:"The import includes create directives for same object multiple times",IMPORT_OBJECT_EXISTS:"The import includes create directives for already existing objects",IMPORT_PREDATED_TRANSFER:"The oldest Transfer in the import file is older than already existing Transfers in the WAPI instance",IMPORT_USE_BEFORE_CREATE:"The import includes create directive for object that is used in Transfer before create dateTime",INPUT_NEEDS_IDENTIFIER:"Missing identifier - automatically calculated identifiers conflict on identical input for 30s To make an identical transfer during that window you need to provide a unique identifier",INPUT_NEEDS_TOKEN:"token must be specified on input or in client config",INPUT_STREAM_ERROR:"Input stream emitted an error",INPUT_STREAM_TIMEOUT:"No data provided to input stream in 30s",INPUT_STREAM_INVALID:"Invalid input stream identifier provided",INPUT_STREAM_NOT_ALLOWED:"Method does not support input stream",INPUT_INVALID:"Invalid input on stream",INVALID_COMPLEX_FILTER:"The provided complex filter does not pass validation",INVALID_FIELD_AGR_COMB:"Provided aggregation field was not found on Model",INVALID_FIELD_FOR_MODEL:"Provided groupBy field was not found on Model",INVALID_LATEST_HASH:"Provided latest_control_hash does not match the latest outgoing Transfer from Wallet",INVALID_MODEL:"Provided Model name is invalid",NO_METADATA_ON_MODEL:"Can't use metadata field for grouping as current Model does not have metadata",RUNNING_BALANCE_WITHOUT_WALLET:"return_running_balance option requires Wallet filter to be specified",SIGNED_AMOUNT_WITHOUT_WALLET:"return_signed_balance option requires Wallet filter to be specified",TOKEN_INVALID_WALLET:"Invalid belongs_to wallet provided",TOKEN_LIMIT_REACHED:"Unable to issue more tokens as Token.limit has been reached",TR_AMOUNT_NOT_DIVISIBLE:"Transfer amount is not divisible by specified Token.divisor",TR_CANCELLED_CANT_RV:"Cancelled Transfer can not be reversed",TR_CANT_UPDATE_TO_PENDING:"Transfer status can only move from 'pending'->'finished'/'cancelled",TR_DEPOSIT_CANT_RV_WITHOUT_FLAG:"Deposits are expected connection points with outside systems, thus extra validation is required. Reversing a Transfer.type = 'deposit' requires reverse_deposit option to be true.",TR_FROM_WALLET_DEPOSIT:"From wallet can't be specified when doing a deposit",TR_FROM_WALLET_STATUS_CONSTRAINT:"From wallet.status doesn't allow this type of transfers",TR_INVALID_BALANCE:"Transfer results in invalid balance for a Wallet",TR_INVALID_CANCELLED:"Cant create cancelled transfer",TR_TIMESTAMP_IN_PAST:"Transfer.created_at must be the latest",TR_TO_WALLET_STATUS_CONSTRAINT:"To wallet.status doesn't allow this type of transfers",TR_TO_WALLET_WITHDRAWAL:"To wallet can't be specified when doing a withdrawal",TR_TOKEN_DISABLED:"Token status is set to 'disabled' - no new transfers allowed",TR_TOKEN_DWONLY:"Token status is set to 'dw-only' - only deposits or withdrawals allowed",TR_TRG_CLOSED:"Cant add Transfer to group. TransferGroup is closed",TR_TRG_STATUS_MISMATCH:"Transfers in transfer_group must match transfer_group.transfer_status",TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG:"Withdrawals are expected connection points with outside systems, thus extra validation is required. Reversing a Transfer.type = 'withdrawal' requires reverse_withdrawal option to be true.",TRANSACTION_NOT_FOUND:"No open DB transaction with provided was found",TRANSACTION_TIMEOUT:"Transaction timed out",TRG_BALANCE_CHECK_REQUIRED_WITHOUT_STATUS_LOCK:"For integrity reasons running balance validations are required if TransferGroup.transfer_status_lock = false",TRG_CANCELLED_CANT_RV:"Cancelled TransferGroup can not be reversed",TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG:"TransferGroup includes Transfer.type = 'deposit', thus for extra validation the reverse_deposit option must be set true",TRG_SINGLE_PENDING_TR_CANT_RV:"Transfer is part of TransferGroup and can not be reversed separately",TRG_WITHDRAWAL_CANT_RV_WITHOUT_FLAG:"TransferGroup includes Transfer.type = 'withdrawal', thus for extra validation the reverse_withdrawal option must be set true",UNCLEAR_AGGREGATOR:"Invalid aggregator function provided",TR_MISSING_FILTER:"Transactions can't reversed or updated without valid filter",TRG_MISSING_FILTER:"Transaction groups can't reversed or updated without valid filter",HTTP_BODY_SIZE:"Http body size can't be more than 100MB",METHOD_DISABLED:"Method is disabled",DATABASE_IMPORT_UNEXPECTED_ERROR:"Unexpected error while importing database backup",DATABASE_IMPORT_NOT_FOUND:"Database import file not found",DATABASE_BACKUP_CREATE_UNEXPECTED_ERROR:"Unexpected error while creating database backup",LIST_DATABASE_BACKUPS_UNEXPECTED_ERROR:"Unexpected error while listing database backups",IMPORT_DATABASE_PROGRESS_NOT_FOUND:"Import database progress not found",IMPORT_DATABASE_PROGRESS_UNEXPECTED_ERROR:"Unexpected error while getting database import progress",DATABASE_BACKUP_PROGRESS_NOT_FOUND:"Database backup progress not found",DATABASE_BACKUP_PROGRESS_UNEXPECTED_ERROR:"Unexpected error while getting database backup progress"};var Bc=ri(kT());var ST=ri(require("crypto"));function as(t=8){return(0,ST.randomBytes)(t).toString("hex")}var Lc={timeouts:{},values:{},set(t,e){this.timeouts[t]=setTimeout(()=>this.clear(t),3e4),this.values[t]=e},get(t){return this.values[t]},getKey(t){let e=JSON.parse(JSON.stringify(t)),r="";return Object.keys(e).sort().forEach(n=>{let a="";e[n]&&typeof e[n]=="object"&&!Array.isArray(e[n])?a=this.getKey(e[n]):a=JSON.stringify(e[n]),r+=n+":"+a}),r},clear(t){this.timeouts[t]&&clearTimeout(this.timeouts[t]),delete this.timeouts[t],delete this.values[t]},clearAll(){Object.keys(this.timeouts).forEach(t=>{clearTimeout(this.timeouts[t])}),this.timeouts={},this.values={}}};function Re(t){if(!t)return(0,Bc.v4)();let e=Lc.getKey(t);if(Lc.get(e))throw new de({message:re.INPUT_NEEDS_IDENTIFIER,data:t});let r=(0,Bc.v4)();return Lc.set(e,r),r}function CT(t){return new Promise(e=>setTimeout(e,t))}function PT(){return Re()}function Pd(t){return JSON.parse(JSON.stringify(t))}function yt(t,e,r){if(e in t){if(t[e]===void 0)throw new Ne({message:`undefined provided for ${e}`,data:t});return t}if(!r)throw new Ne({message:`${e} is required if no default set`,data:t});let n=Pd(t);return n[e]=r,n}function G(t){let e=GT(t);if(e!=null)return{foreign:e}}function J(t){let e=GT(t);if(e!=null)return{identifier:e}}function M({input:t,options:e,validate:r}){var a;let n=Pd(t);return(a=n.options)!=null||(n.options=e!=null?e:{}),r(n)}function GT(t){return t==null?t:t+""}function z$(t){return Object.keys(t).filter(e=>t[e]!==void 0).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function DT(t){let e=t.host;return typeof window!="undefined"&&(e=t.host.replace(/^https:/,"wss:")),e+"?"+z$({apikey:t.apikey,apisecret:t.apisecret,db:t.database,clientVersion:t.clientVersion})}function MT(t){return typeof window=="undefined"?[DT(t),{rejectUnauthorized:t.rejectUnauthorized}]:[DT(t)]}function Gd(t,e){let r={};return Object.keys(t).forEach(n=>{e[n]?typeof e[n]=="string"?r[e[n]]=t[n]:r[n]=e[n](t[n]):r[n]=t[n]}),r}function bt(t){return t.split(",").map(e=>e.split(" ")).map(e=>{let[r,n]=e;return{field:r,direction:n==="desc"?"desc":"asc"}})}function WT(t){return new Date(t).setHours(0,0,0,0)>new Date().setHours(0,0,0,0)}function K$(t){return t%4==0&&(t%100!=0||t%400==0)}var Q$=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,J$=[0,31,28,31,30,31,30,31,31,30,31,30,31];function ET(t){let e=Q$.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],a=+e[3];return n>=1&&n<=12&&a>=1&&a<=(n===2&&K$(r)?29:J$[n])}var X$=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function Y$(t,e){let r=X$.exec(t);if(!r)return!1;let n=+r[1],a=+r[2],s=+r[3],i=r[5];return(n<=23&&a<=59&&s<=59||n===23&&a===59&&s===60)&&(!e||i!=="")}var Z$=/t|\s/i;function RT(t){let e=t.split(Z$);return e.length===1?ET(e[0]):e.length===2&&ET(e[0])&&Y$(e[1])}var ve;(function(o){o.version="2.0",o.acknowledgement="ack",o.ping="ping",o.pong="pong",o.streamChunk="streamChunk",o.streamPause="streamPause",o.streamResume="streamResume"})(ve||(ve={}));var ss=ri(require("stream")),Dd=class extends ss.Readable{constructor(e){super(e)}_read(e){}};var Vc=class extends ss.PassThrough{constructor(){super({objectMode:!0})}write(e,r,n){if(n)throw new TypeError("Stream in objectMode, no encoding supported");return super.write(e,r)}end(e,r,n){if(n)throw new TypeError("Stream in objectMode, no encoding supported");return super.end(e,r)}},Hc=class extends ss.Transform{constructor(e){super(q(P({},e),{writableObjectMode:!0,readableObjectMode:!0}));this.dataTransform=e.dataTransform}_transform(e,r,n){this.dataTransform(e).then(a=>{a?n(null,a):n()}).catch(n)}_flush(e){this.dataTransform().then(r=>{r?e(null,r):e()}).catch(e)}};var ua=class{constructor(e){this.streamObject=new Dd({objectMode:!0});this.outStreamObject=new Dd({objectMode:!0});this.started=!1;this.makeRequest=e}start(e){if(this.mode&&this.mode!==e)throw new Error("Already in use as "+this.mode);if(this.started)return;if(this.promise=new Promise((n,a)=>{this.resolve=n,this.reject=a}),this.started=!0,this.mode=e,this.makeRequest===void 0){this.streamObject.push(null),this.resolve(void 0);return}this.makeRequest(this.streamObject).catch(this.reject);let r=[];if(this.mode==="stream"){this.streamObject.on("data",n=>{if(n||this.outStreamObject.push(n),n.error){let a=Mc(n.error);return this.outStreamObject.destroy(a),this.streamObject.destroy(a)}if(!n.prop){r.push(n);return}if(n.dataArr){let a=P({},n);delete a.dataArr,n.dataArr.forEach(s=>{this.outStreamObject.push(q(P({},a),{data:s}))});return}this.outStreamObject.push(n)}).on("end",()=>{let n=r.pop();if(!n)return;let a=n.result;Object.keys(a).forEach(s=>{!Array.isArray(a[s])||(a[s].forEach(i=>{this.outStreamObject.push({type:ve.streamChunk,prop:s,data:i})}),a[s]=[])}),this.outStreamObject.push(n),this.outStreamObject.push(null)}).on("error",n=>{this.outStreamObject.destroy(n)});return}if(this.mode==="promise"){let n=new Map;this.streamObject.on("data",a=>{var i;if(a===void 0)return;if(a.error){let o=Mc(a.error);return this.streamObject.destroy(o)}if(!a.prop){r.push(a);return}let s=(i=n.get(a.prop))!=null?i:[];a.dataArr?s.push(...a.dataArr):s.push(a.data),n.set(a.prop,s)}).on("end",()=>{let a=r.pop();if(!a)return;let s=a.result;if(!n.size)return this.resolve(s);let i=!1;n.forEach((o,f)=>{Array.isArray(s[f])?(o.push(...s[f]),s[f]=o):o.length===1?s[f]=o:(this.streamObject.destroy(new gd({message:"Received multiple chunks for non-array property "+f,code:me.StreamError,data:o})),i=!0)}),i||this.resolve(s)}).on("error",this.reject)}}then(e,r){return this.start("promise"),this.promise.then(e,r)}catch(e){return this.start("promise"),this.promise.catch(e)}stream(){return this.start("stream"),this.outStreamObject}};var Md=class extends ua{constructor(e,r){super(e);this.inputStream=r}input(e){return e?typeof e=="function"?(e(this.inputStream),this):(console.warn("currently disabled"),this):this.inputStream}};var cx=ri(lx());var qk="http://json-schema.org/draft-07/schema",Nk="JSONRPCRequest",Bk="A JSON RPC 2.0 request",Lk=[{description:"An individual request",$ref:"#/definitions/request"}],Vk={request:{type:"object",required:["jsonrpc","method"],properties:{jsonrpc:{enum:["2.0"]},method:{type:"string"},id:{type:["string","number","null"],note:["While allowed, null should be avoided: http://www.jsonrpc.org/specification#id1","While allowed, a number with a fractional part should be avoided: http://www.jsonrpc.org/specification#id2"]},params:{type:["array","object"]}}}},yh={$schema:qk,$id:Nk,description:Bk,oneOf:Lk,definitions:Vk};var Hk="http://json-schema.org/draft-07/schema",zk="JSONRPCResponse",Kk="A JSON RPC 2.0 response",Qk=[{$ref:"#/definitions/success"},{$ref:"#/definitions/error"}],Jk={common:{required:["id","jsonrpc"],not:{description:"cannot have result and error at the same time",required:["result","error"]},type:"object",properties:{id:{type:["string","integer","null"],note:["spec says a number which should not contain a fractional part","We choose integer here, but this is unenforceable with some languages"]},jsonrpc:{enum:["2.0"]}}},success:{description:"A success. The result member is then required and can be anything.",allOf:[{$ref:"#/definitions/common"},{required:["result"]}]},error:{allOf:[{$ref:"#/definitions/common"},{required:["error"],properties:{error:{type:"object",required:["code","message"],properties:{code:{type:"integer",note:["unenforceable in some languages"]},message:{type:"string"},data:{description:"optional, can be anything"}}}}}]}},bh={$schema:Hk,$id:zk,description:Kk,oneOf:Qk,definitions:Jk};var Xk="http://json-schema.org/draft-07/schema",Yk="ClientOptions",Zk="Client input options",eS="object",tS={client:{$ref:"#/definitions/ClientType"},connection:{anyOf:[{$ref:"#/definitions/ws_connection"},{$ref:"#/definitions/https_connection"}]}},rS=["client","connection"],nS=!1,aS={ClientType:{$id:"ClientType",type:"string",enum:["ws","https"]},ws_connection:{description:"Connection options for ws api",type:"object",properties:{host:{description:"URL of the API",type:"string"},apikey:{description:"API key for the client",type:"string"},apisecret:{description:"API secret for the client",type:"string"}},required:["host","apikey","apisecret"]},https_connection:{description:"Connection options for https api",type:"object",properties:{host:{description:"URL of the API",type:"string"},jwt:{description:"Auth token for calling api",type:"string"}},required:["host"]}},xh={$schema:Xk,$id:Yk,description:Zk,type:eS,properties:tS,required:rS,additionalProperties:nS,definitions:aS};var sS="http://json-schema.org/draft-07/schema",iS="Consts",oS="Enums and consts used by the system",pS={Flags:{$id:"Flags",$comment:"knex|manual",description:"Allowed filtering functions",type:"object",properties:{allow_timestamps:{description:"Allow setting timestamps in transfer insert/update statements",type:"boolean"},production:{description:"Is running in production mode?",type:"boolean"}},$typescript:'{"additionalProperties":false}'},DbFilterMetadata:{$id:"FilterMetadata",$comment:"knex|manual",type:"object",propertyNames:{type:"string",format:"validkey"},patternProperties:{".*":{type:["string","boolean","number"]}}},DbFilterFunctionWherePrimitive:{$id:"DbFilterFunctionWherePrimitive",$comment:"knex|manual",description:"Filtering for where and orWhere",type:"object",properties:{function:{$ref:"#/definitions/DbFilterFunctionBasic"},field:{type:"string"},operator:{$ref:"#/definitions/DbFilterOperatorExtended"},value:{type:["string","number","boolean"]}},required:["function","field","value"],$typescript:'{"additionalProperties": false}'},DbFilterFunctionWherePrimitiveForeign:{$id:"DbFilterFunctionWherePrimitiveForeign",$comment:"knex|manual",description:"Filtering for where and orWhere",type:"object",properties:{function:{$ref:"#/definitions/DbFilterFunctionBasic"},field:{type:"string"},operator:{$ref:"#/definitions/DbFilterOperatorExtended"},value:{anyOf:[{type:["string","number","boolean"]},{type:"object",properties:{foreign:{type:["string","number"]}},required:["foreign"],$typescript:'{"additionalProperties": false}'}]}},required:["function","field","value"],$typescript:'{"additionalProperties": false}'},DbFilterFunctionWherePrimitiveIdentifier:{$id:"DbFilterFunctionWherePrimitiveIdentifier",$comment:"knex|manual",description:"Filtering for where and orWhere",type:"object",properties:{function:{$ref:"#/definitions/DbFilterFunctionBasic"},field:{type:"string"},operator:{$ref:"#/definitions/DbFilterOperatorExtended"},value:{anyOf:[{type:["string","number","boolean"]},{type:"object",properties:{identifier:{type:["string","number"]}},required:["identifier"],$typescript:'{"additionalProperties": false}'}]}},required:["function","field","value"],$typescript:'{"additionalProperties": false}'},DbFilterFunctionWhereMetadataPrimitive:{$id:"DbFilterFunctionWhereMetadataPrimitive",$comment:"knex|manual",description:"Filtering for where and orWhere",type:"object",properties:{function:{$ref:"#/definitions/DbFilterFunctionMetadataBasic"},field:{type:"string"},operator:{$ref:"#/definitions/DbFilterOperatorExtended"},value:{type:["string","number","boolean"]}},required:["function","field","value"],$typescript:'{"additionalProperties": false}'},DbFilterFunctionMetadataBasic:{$id:"DbFilterFunctionMetadataBasic",$comment:"knex|manual",type:"string",enum:["whereMetadata","orWhereMetadata"]},DbFilterFunctionWhereObject:{$id:"DbFilterFunctionWhereObject",$comment:"knex|manual",description:"Filtering for where and orWhere",type:"object",properties:{function:{$ref:"#/definitions/DbFilterFunctionBasic"},value:{type:"object",properties:{metadata:{$ref:"#/definitions/DbFilterMetadata"}}}},required:["function","value"],$typescript:'{"additionalProperties": false}'},DbFilterFunctionBasic:{$id:"DbFilterFunctionBasic",$comment:"knex|manual",type:"string",enum:["where","orWhere"]},DbFilterFunctionWhereIns:{$id:"DbFilterFunctionWhereIns",$comment:"knex|manual",description:"Filtering for whereIn and orWhereIn",type:"object",properties:{function:{$ref:"#/definitions/DbFilterFunctionIn"},field:{type:"string"},value:{anyOf:[{type:"array",items:{type:"string"},minItems:1},{type:"array",items:{type:"number"},minItems:1}]}},required:["function","field","value"],$typescript:'{"additionalProperties": false}'},DbFilterFunctionIn:{$id:"DbFilterFunctionIn",$comment:"knex|manual",type:"string",enum:["whereIn","orWhereIn"]},DbFilterFunctionWhereMetadataIns:{$id:"DbFilterFunctionWhereMetadataIns",$comment:"knex|manual",description:"Filtering for whereIn and orWhereIn for metadata",type:"object",properties:{function:{$ref:"#/definitions/DbFilterFunctionMetadataIn"},field:{type:"string"},value:{anyOf:[{type:"array",items:{type:"string"},minItems:1},{type:"array",items:{type:"number"},minItems:1}]}},required:["function","field","value"],$typescript:'{"additionalProperties": false}'},DbFilterFunctionMetadataIn:{$id:"DbFilterFunctionMetadataIn",$comment:"knex|manual",type:"string",enum:["whereMetadataIn","orWhereMetadataIn"]},DbFilterFunctionWhereMetadataNulls:{$id:"DbFilterFunctionWhereMetadataNulls",$comment:"knex|manual",description:"Filtering for whereNull and orWhereNull, whereNotNull and orWhereNotNull for metadata",type:"object",properties:{function:{$ref:"#/definitions/DbFilterFunctionMetadataNull"},field:{type:"string"}},required:["function","field"],$typescript:'{"additionalProperties": false}'},DbFilterFunctionMetadataNull:{$id:"DbFilterFunctionMetadataNull",$comment:"knex|manual",type:"string",enum:["whereMetadataNull","orWhereMetadataNull","whereMetadataNotNull","orWhereMetadataNotNull"]},DbFilterFunctionWhereNulls:{$id:"DbFilterFunctionWhereNulls",$comment:"knex|manual",description:"Filtering for whereNull and orWhereNull, whereNotNull and orWhereNotNull",type:"object",properties:{function:{$ref:"#/definitions/DbFilterFunctionNull"},field:{type:"string"}},required:["function","field"],$typescript:'{"additionalProperties": false}'},DbFilterFunctionNull:{$id:"DbFilterFunctionNull",$comment:"knex|manual",type:"string",enum:["whereNull","orWhereNull","whereNotNull","orWhereNotNull"]},DbFilterOperator:{$id:"DbFilterOperator",$comment:"knex|manual",description:"Allowed filtering operators, ignored when value is not primitive",type:"string",enum:["=",">=","<=","<",">"],default:"="},DbFilterOperatorString:{$id:"DbFilterOperatorString",$comment:"knex|manual",description:"Allowed filtering operators for strings",type:"string",enum:["like","ilike"]},DbFilterOperatorExtended:{$id:"DbFilterOperatorExtended",$comment:"knex|manual",description:"Allowed filtering operators, ignored when value is not primitive",type:"string",enum:["=",">=","<=","<",">","like","ilike"],default:"="},DbFilter:{$id:"DbFilter",$comment:"knex|manual",anyOf:[{$ref:"#/definitions/DbFilterMetadata"},{$ref:"#/definitions/DbFilterFunctionWhereInner"},{$ref:"#/definitions/DbFilterFunctionWherePrimitive"},{$ref:"#/definitions/DbFilterFunctionWherePrimitiveForeign"},{$ref:"#/definitions/DbFilterFunctionWherePrimitiveIdentifier"},{$ref:"#/definitions/DbFilterFunctionWhereMetadataPrimitive"},{$ref:"#/definitions/DbFilterFunctionWhereObject"},{$ref:"#/definitions/DbFilterFunctionWhereIns"},{$ref:"#/definitions/DbFilterFunctionWhereMetadataIns"},{$ref:"#/definitions/DbFilterFunctionWhereMetadataNulls"},{$ref:"#/definitions/DbFilterFunctionWhereNulls"}]},DbFilterFunctionWhereInner:{$id:"DbFilterFunctionWhereInner",$comment:"knex|manual",description:"Filtering for where and orWhere",type:"object",properties:{function:{$ref:"#/definitions/DbFilterFunctionBasic"},inner:{type:"array",items:{$ref:"#/definitions/DbFilter"}}},required:["function","inner"],$typescript:'{"additionalProperties": false}'},TokenType:{$id:"TokenType",$comment:"model",description:"DB type values for TokenType",type:"string",enum:["value","share","group","contract"]},TokenStatus:{$id:"TokenStatus",$comment:"model",description:"DB type values for TokenStatus",type:"string",enum:["active","dw-only","disabled"]},TransferGroupStatus:{$id:"TransferGroupStatus",$comment:"model",description:"DB type values for TransferGroupStatus",type:"string",enum:["open","closed"]},TransferStatus:{$id:"TransferStatus",$comment:"model",description:"DB type values for TransferStatus",type:"string",enum:["pending","finished","cancelled"]},TransferStatusInput:{$id:"TransferStatusInput",$comment:"model",description:"DB type input values for TransferStatus",type:"string",enum:["pending","finished"]},TransferGroupType:{$id:"TransferGroupType",$comment:"model",description:"DB type values for TransferGroupType",type:"string",enum:["regular","exchange","distribution"]},TransferType:{$id:"TransferType",$comment:"model",description:"DB type values for TransferType",type:"string",enum:["transfer","deposit","withdrawal"]},WalletType:{$id:"WalletType",$comment:"model",description:"DB type values for WalletType",type:"string",enum:["token","house","regular"]},WalletStatus:{$id:"WalletStatus",$comment:"model",description:"DB type values for WalletStatus",type:"string",enum:["active","disabled"]},WapiSettingType:{$id:"WapiSettingType",$comment:"model",description:"DB type values for WapiSettingType",type:"string",enum:["flag","setting"]},DbModelName:{$id:"DbModelName",$comment:"model",description:"DB Model Names",type:"string",enum:["Token","TransferGroup","TransferLog","Transfer","WalletTokenSetting","Wallet","WapiSetting"]}},cs={$schema:sS,$id:iS,description:oS,definitions:pS};var fS="http://json-schema.org/draft-07/schema",uS="TokenTableInput",dS="TokenTableInput",lS="Units of value which can be transferred in this system",cS="object",mS={foreign:{description:"Name of the token, used for name based token transfers. Must be unique",type:"string",maxLength:255,minLength:1},public:{description:"Boolean indicating if token can be traded with outside seed wallet",default:!0,type:"boolean"},metadata:{description:"Key/value object describing the token",type:["object","null"]},divisor:{description:"Minimum amount of token that can be transferred",type:["number","null"]},limit:{description:"Maximum amount of token that can be issued",type:["number","null"]},type:{description:"Type of the token",default:"value",$ref:"/db/consts.schema.json#/definitions/TokenType"},status:{description:"Current status for the token",default:"active",$ref:"/db/consts.schema.json#/definitions/TokenStatus"}},hS=!1,gS=["foreign"],vo={$schema:fS,$id:uS,title:dS,description:lS,type:cS,properties:mS,additionalProperties:hS,required:gS};var _S="http://json-schema.org/draft-07/schema",TS="TokenTable",yS="TokenTable",bS="Units of value which can be transferred in this system",xS="object",FS={id:{description:"System defined primary key",type:"integer"},foreign:{description:"Name of the token, used for name based token transfers. Must be unique",type:"string",maxLength:255,minLength:1},public:{description:"Boolean indicating if token can be traded with outside seed wallet",default:!0,type:"boolean"},belongs_to:{description:"Foreign key to seed wallet",type:"integer"},created_at:{description:"Datetime when the token was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when the token was last updated",type:"string",format:"date-time"},metadata:{description:"Key/value object describing the token",type:["object","null"]},divisor:{description:"Minimum amount of token that can be transferred",type:["number","null"]},limit:{description:"Maximum amount of token that can be issued",type:["number","null"]},type:{description:"Type of the token",default:"value",$ref:"/db/consts.schema.json#/definitions/TokenType"},status:{description:"Current status for the token",default:"active",$ref:"/db/consts.schema.json#/definitions/TokenStatus"}},wS=!1,$S={TokenTableAccessibleFields:{$id:"TokenTableAccessibleFields",type:"string",enum:["id","foreign","public","metadata","divisor","limit","type","status"]},TokenTableFields:{$id:"TokenTableFields",type:"string",enum:["id","foreign","public","belongs_to","created_at","updated_at","metadata","divisor","limit","type","status"]},TokenTableStringFields:{$id:"TokenTableStringFields",type:"string",enum:["foreign","created_at","updated_at","type","status"]},TokenTableObjectFields:{$id:"TokenTableObjectFields",type:"string",enum:["metadata"]},TokenTableNumberFields:{$id:"TokenTableNumberFields",type:"string",enum:["id","belongs_to","divisor","limit"]},TokenTableBooleanFields:{$id:"TokenTableBooleanFields",type:"string",enum:["public"]}},OS=["id","foreign","public","belongs_to","created_at","updated_at","type","status"],jo={$schema:_S,$id:TS,title:yS,description:bS,type:xS,properties:FS,additionalProperties:wS,definitions:$S,required:OS};var vS="http://json-schema.org/draft-07/schema",jS="TokenTableOptional",IS="TokenTableOptional",kS="Units of value which can be transferred in this system Only require id, other fields are optional",SS="object",CS={id:{description:"System defined primary key",type:"integer"},foreign:{description:"Name of the token, used for name based token transfers. Must be unique",type:"string",maxLength:255,minLength:1},public:{description:"Boolean indicating if token can be traded with outside seed wallet",default:!0,type:"boolean"},belongs_to:{description:"Foreign key to seed wallet",type:"integer"},created_at:{description:"Datetime when the token was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when the token was last updated",type:"string",format:"date-time"},metadata:{description:"Key/value object describing the token",type:["object","null"]},divisor:{description:"Minimum amount of token that can be transferred",type:["number","null"]},limit:{description:"Maximum amount of token that can be issued",type:["number","null"]},type:{description:"Type of the token",default:"value",$ref:"/db/consts.schema.json#/definitions/TokenType"},status:{description:"Current status for the token",default:"active",$ref:"/db/consts.schema.json#/definitions/TokenStatus"}},PS=!1,GS=["id"],Fh={$schema:vS,$id:jS,title:IS,description:kS,type:SS,properties:CS,additionalProperties:PS,required:GS};var DS="http://json-schema.org/draft-07/schema",MS="TransferTableInput",WS="TransferTableInput",ES="A transfer of value from one wallet to another",RS="object",AS={identifier:{description:"Identifier for this transfer. Must be unique",type:"string",maxLength:255,minLength:1},control_hash:{description:'Hash binding this transfer to the from_wallets transfer chain. It is calculated as sha256(latest_outgoing_hash + "-" + NEW.identifier)',type:["string","null"],maxLength:255},from_wallet_id:{description:"Foreign key to wallet funds originate from",type:"integer"},to_wallet_id:{description:"Foreign key to wallet where funds are going",type:"integer"},token_id:{description:"Foreign key to token this transfer refers to",type:"integer"},amount:{description:"The transfer amount",type:"number"},type:{description:"Type of the transfer",default:"transfer",$ref:"/db/consts.schema.json#/definitions/TransferType"},status:{description:"Status of the transfer",default:"finished",$ref:"/db/consts.schema.json#/definitions/TransferStatusInput"},force:{description:"Set to true to force transfer without checking for negative balance constraints",default:!1,type:"boolean"},created_at:{description:"Datetime when this transfer was created - can only be latest",type:"string",format:"date-time"},updated_at:{description:"Datetime when this transfer was updated - can only be latest",type:"string",format:"date-time"},metadata:{description:"Key/value object describing this transfer",type:["object","null"]},transfer_group_id:{description:"Foreign key pointing to the transfer_group this transfer belongs to",type:["integer","null"]},reverses_id:{description:"Foreign key pointing to the transfer this transfer reverses. Must be unique",type:["integer","null"]},status_finalized_at:{description:"DateTime transfer reached final status",type:["string","null"],format:"date-time"}},US=!1,qS=["identifier","from_wallet_id","to_wallet_id","token_id","amount"],Io={$schema:DS,$id:MS,title:WS,description:ES,type:RS,properties:AS,additionalProperties:US,required:qS};var NS="http://json-schema.org/draft-07/schema",BS="TransferTable",LS="TransferTable",VS="A transfer of value from one wallet to another",HS="object",zS={id:{description:"System defined primary key",type:"integer"},identifier:{description:"Identifier for this transfer. Must be unique",type:"string",maxLength:255,minLength:1},control_hash:{description:'Hash binding this transfer to the from_wallets transfer chain. It is calculated as sha256(latest_outgoing_hash + "-" + NEW.identifier)',type:["string","null"],maxLength:255},from_wallet_id:{description:"Foreign key to wallet funds originate from",type:"integer"},to_wallet_id:{description:"Foreign key to wallet where funds are going",type:"integer"},token_id:{description:"Foreign key to token this transfer refers to",type:"integer"},amount:{description:"The transfer amount",type:"number"},type:{description:"Type of the transfer",default:"transfer",$ref:"/db/consts.schema.json#/definitions/TransferType"},status:{description:"Status of the transfer",default:"finished",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},force:{description:"Set to true to force transfer without checking for negative balance constraints",default:!1,type:"boolean"},auto_hash:{description:"When set to true it will automatically calculate the control_hash",default:!1,type:"boolean"},created_at:{description:"Datetime when this transfer was created - can only be latest",type:"string",format:"date-time"},updated_at:{description:"Datetime when this transfer was updated - can only be latest",type:"string",format:"date-time"},metadata:{description:"Key/value object describing this transfer",type:["object","null"]},transfer_group_id:{description:"Foreign key pointing to the transfer_group this transfer belongs to",type:["integer","null"]},reverses_id:{description:"Foreign key pointing to the transfer this transfer reverses. Must be unique",type:["integer","null"]},status_finalized_at:{description:"DateTime transfer reached final status",type:["string","null"],format:"date-time"},group_validate:{description:"Boolean showing if the transfer_group has validate_final_balance_only",default:!1,type:"boolean"}},KS=!1,QS={TransferTableAccessibleFields:{$id:"TransferTableAccessibleFields",type:"string",enum:["id","identifier","control_hash","from_wallet_id","to_wallet_id","token_id","amount","type","status","force","created_at","updated_at","metadata","transfer_group_id","reverses_id","status_finalized_at"]},TransferTableFields:{$id:"TransferTableFields",type:"string",enum:["id","identifier","control_hash","from_wallet_id","to_wallet_id","token_id","amount","type","status","force","auto_hash","created_at","updated_at","metadata","transfer_group_id","reverses_id","status_finalized_at"]},TransferTableStringFields:{$id:"TransferTableStringFields",type:"string",enum:["identifier","control_hash","type","status","created_at","updated_at","status_finalized_at"]},TransferTableObjectFields:{$id:"TransferTableObjectFields",type:"string",enum:["metadata"]},TransferTableNumberFields:{$id:"TransferTableNumberFields",type:"string",enum:["id","from_wallet_id","to_wallet_id","token_id","amount","transfer_group_id","reverses_id"]},TransferTableBooleanFields:{$id:"TransferTableBooleanFields",type:"string",enum:["force","auto_hash"]}},JS=["id","identifier","from_wallet_id","to_wallet_id","token_id","amount","type","status","force","auto_hash","created_at","updated_at"],ko={$schema:NS,$id:BS,title:LS,description:VS,type:HS,properties:zS,additionalProperties:KS,definitions:QS,required:JS};var XS="http://json-schema.org/draft-07/schema",YS="TransferTableOptional",ZS="TransferTableOptional",eC="A transfer of value from one wallet to another Only require id, other fields are optional",tC="object",rC={id:{description:"System defined primary key",type:"integer"},identifier:{description:"Identifier for this transfer. Must be unique",type:"string",maxLength:255,minLength:1},control_hash:{description:'Hash binding this transfer to the from_wallets transfer chain. It is calculated as sha256(latest_outgoing_hash + "-" + NEW.identifier)',type:["string","null"],maxLength:255},from_wallet_id:{description:"Foreign key to wallet funds originate from",type:"integer"},to_wallet_id:{description:"Foreign key to wallet where funds are going",type:"integer"},token_id:{description:"Foreign key to token this transfer refers to",type:"integer"},amount:{description:"The transfer amount",type:"number"},type:{description:"Type of the transfer",default:"transfer",$ref:"/db/consts.schema.json#/definitions/TransferType"},status:{description:"Status of the transfer",default:"finished",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},force:{description:"Set to true to force transfer without checking for negative balance constraints",default:!1,type:"boolean"},auto_hash:{description:"When set to true it will automatically calculate the control_hash",default:!1,type:"boolean"},created_at:{description:"Datetime when this transfer was created - can only be latest",type:"string",format:"date-time"},updated_at:{description:"Datetime when this transfer was updated - can only be latest",type:"string",format:"date-time"},metadata:{description:"Key/value object describing this transfer",type:["object","null"]},transfer_group_id:{description:"Foreign key pointing to the transfer_group this transfer belongs to",type:["integer","null"]},reverses_id:{description:"Foreign key pointing to the transfer this transfer reverses. Must be unique",type:["integer","null"]},status_finalized_at:{description:"DateTime transfer reached final status",type:["string","null"],format:"date-time"},group_validate:{description:"Boolean showing if the transfer_group has validate_final_balance_only",default:!1,type:"boolean"}},nC=!1,aC=["id"],wh={$schema:XS,$id:YS,title:ZS,description:eC,type:tC,properties:rC,additionalProperties:nC,required:aC};var sC="http://json-schema.org/draft-07/schema",iC="TransferGroupTableInput",oC="TransferGroupTableInput",pC="An entity collecting transfers into a group locked by status",fC="object",uC={identifier:{description:"Identifier for this transfer. Must be unique",type:"string",maxLength:255,minLength:1},status:{description:"Lifecycle status for transfer group",default:"open",$ref:"/db/consts.schema.json#/definitions/TransferGroupStatus"},transfer_status:{description:"Status of the transfer",default:"pending",$ref:"/db/consts.schema.json#/definitions/TransferStatusInput"},metadata:{description:"Key/value object describing this transfer_group",type:["object","null"]},reverses_id:{description:"Foreign key pointing to the transfer_group this transfer_group reverses",type:["integer","null"]},status_finalized_at:{description:"Time transfer_group was closed",type:["string","null"],format:"date-time"},transfer_status_finalized_at:{description:"Time transfer_status reached final state. Must be unique",type:["string","null"],format:"date-time"},type:{description:"Type of the transfer group",default:"regular",$ref:"/db/consts.schema.json#/definitions/TransferGroupType"}},dC=!1,lC=["identifier"],So={$schema:sC,$id:iC,title:oC,description:pC,type:fC,properties:uC,additionalProperties:dC,required:lC};var cC="http://json-schema.org/draft-07/schema",mC="TransferGroupTable",hC="TransferGroupTable",gC="An entity collecting transfers into a group locked by status",_C="object",TC={id:{description:"System defined primary key",type:"integer"},identifier:{description:"Identifier for this transfer. Must be unique",type:"string",maxLength:255,minLength:1},status:{description:"Lifecycle status for transfer group",default:"open",$ref:"/db/consts.schema.json#/definitions/TransferGroupStatus"},transfer_status:{description:"Status of the transfer",default:"pending",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},metadata:{description:"Key/value object describing this transfer_group",type:["object","null"]},created_at:{description:"Datetime when this transfer was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when this transfer was updated",type:"string",format:"date-time"},reverses_id:{description:"Foreign key pointing to the transfer_group this transfer_group reverses",type:["integer","null"]},status_finalized_at:{description:"Time transfer_group was closed",type:["string","null"],format:"date-time"},transfer_status_finalized_at:{description:"Time transfer_status reached final state. Must be unique",type:["string","null"],format:"date-time"},type:{description:"Type of the transfer group",default:"regular",$ref:"/db/consts.schema.json#/definitions/TransferGroupType"},validate_final_balance_only:{description:"Boolean if only the final balances of wallets should be validated",default:!1,type:"boolean"}},yC=!1,bC={TransferGroupTableAccessibleFields:{$id:"TransferGroupTableAccessibleFields",type:"string",enum:["id","identifier","status","transfer_status","metadata","reverses_id","status_finalized_at","transfer_status_finalized_at","type"]},TransferGroupTableFields:{$id:"TransferGroupTableFields",type:"string",enum:["id","identifier","status","transfer_status","metadata","created_at","updated_at","reverses_id","status_finalized_at","transfer_status_finalized_at","type","validate_final_balance_only"]},TransferGroupTableStringFields:{$id:"TransferGroupTableStringFields",type:"string",enum:["identifier","status","transfer_status","created_at","updated_at","status_finalized_at","transfer_status_finalized_at","type"]},TransferGroupTableObjectFields:{$id:"TransferGroupTableObjectFields",type:"string",enum:["metadata"]},TransferGroupTableNumberFields:{$id:"TransferGroupTableNumberFields",type:"string",enum:["id","reverses_id"]},TransferGroupTableBooleanFields:{$id:"TransferGroupTableBooleanFields",type:"string",enum:["validate_final_balance_only"]}},xC=["id","identifier","status","transfer_status","created_at","updated_at","type","validate_final_balance_only"],Co={$schema:cC,$id:mC,title:hC,description:gC,type:_C,properties:TC,additionalProperties:yC,definitions:bC,required:xC};var FC="http://json-schema.org/draft-07/schema",wC="TransferGroupTableOptional",$C="TransferGroupTableOptional",OC="An entity collecting transfers into a group locked by status Only require id, other fields are optional",vC="object",jC={id:{description:"System defined primary key",type:"integer"},identifier:{description:"Identifier for this transfer. Must be unique",type:"string",maxLength:255,minLength:1},status:{description:"Lifecycle status for transfer group",default:"open",$ref:"/db/consts.schema.json#/definitions/TransferGroupStatus"},transfer_status:{description:"Status of the transfer",default:"pending",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},metadata:{description:"Key/value object describing this transfer_group",type:["object","null"]},created_at:{description:"Datetime when this transfer was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when this transfer was updated",type:"string",format:"date-time"},reverses_id:{description:"Foreign key pointing to the transfer_group this transfer_group reverses",type:["integer","null"]},status_finalized_at:{description:"Time transfer_group was closed",type:["string","null"],format:"date-time"},transfer_status_finalized_at:{description:"Time transfer_status reached final state. Must be unique",type:["string","null"],format:"date-time"},type:{description:"Type of the transfer group",default:"regular",$ref:"/db/consts.schema.json#/definitions/TransferGroupType"},validate_final_balance_only:{description:"Boolean if only the final balances of wallets should be validated",default:!1,type:"boolean"}},IC=!1,kC=["id"],$h={$schema:FC,$id:wC,title:$C,description:OC,type:vC,properties:jC,additionalProperties:IC,required:kC};var SC="http://json-schema.org/draft-07/schema",CC="TransferLogTableInput",PC="TransferLogTableInput",GC="This table is readonly, so no input is valid",DC="READONLY",MC="object",WC={},EC=!1,Po={$schema:SC,$id:CC,title:PC,description:GC,$comment:DC,type:MC,properties:WC,additionalProperties:EC};var RC="http://json-schema.org/draft-07/schema",AC="TransferLogTable",UC="TransferLogTable",qC="Individual parts of a transfer, will be updated internally by db. Immutable",NC="READONLY",BC="object",LC={id:{description:"System defined primary key",type:"integer"},transfer_id:{description:"Foreign key pointing to the transfer this log belongs to",type:"integer"},wallet_id:{description:"Foreign key pointing to the wallet this log refers to",type:"integer"},token_id:{description:"Foreign key pointing to the token this log refers to",type:"integer"},type:{description:"Type of this log",$ref:"/db/consts.schema.json#/definitions/TransferType"},amount:{description:"The amount the wallet balance is changed by",type:"number"},pending_amount:{description:"The pending balance of wallet after this transfer_log",type:"number"},finished_amount:{description:"The finished balance of wallet after this transfer_log",type:"number"},status:{description:"Status of this log - same as Transfer.status",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},allow_negative:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be negative",default:!1,type:"boolean"},allow_positive:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be positive. Used for token balance to deny positive balance.",default:!0,type:"boolean"},force:{description:"Boolean indicating if the latest transfer from this wallet was forced to ignore negative balance checks",default:!1,type:"boolean"},created_at:{description:"Datetime this log was created",type:"string",format:"date-time"},latest_control_hash:{description:"Latest hash related to this wallet",type:["string","null"],maxLength:255},pending_amount_to:{description:"The incoming pending balance",type:"number"},pending_amount_from:{description:"The outgoing pending balance",type:"number"},group_balance:{description:"Running balance for the wallet in this group",type:["number","null"]},transfer_group_id:{description:"Foreign key pointing to the transfer_group this transfer_log belongs to",type:["integer","null"]},current:{description:"Boolean showing if this transfer_log is the latest for this wallet/token combination",default:!1,type:"boolean"},available_balance:{description:"Available balance that is sum of pending_amount_from and finished_amount",type:"number"},token_limit:{description:"If wallet = token.belongs_to and token has limit",type:["number","null"]}},VC=!1,HC={TransferLogTableAccessibleFields:{$id:"TransferLogTableAccessibleFields",type:"string",enum:["id","transfer_id","wallet_id","token_id","type","amount","pending_amount","finished_amount","status","created_at","pending_amount_to","pending_amount_from","available_balance","token_limit"]},TransferLogTableFields:{$id:"TransferLogTableFields",type:"string",enum:["id","transfer_id","wallet_id","token_id","type","amount","pending_amount","finished_amount","status","allow_negative","allow_positive","force","created_at","latest_control_hash","pending_amount_to","pending_amount_from","group_balance","current","available_balance","token_limit"]},TransferLogTableStringFields:{$id:"TransferLogTableStringFields",type:"string",enum:["type","status","created_at","latest_control_hash"]},TransferLogTableNumberFields:{$id:"TransferLogTableNumberFields",type:"string",enum:["id","transfer_id","wallet_id","token_id","amount","pending_amount","finished_amount","pending_amount_to","pending_amount_from","group_balance","available_balance","token_limit"]},TransferLogTableBooleanFields:{$id:"TransferLogTableBooleanFields",type:"string",enum:["allow_negative","allow_positive","force","current"]}},zC=["id","transfer_id","wallet_id","token_id","type","amount","pending_amount","finished_amount","status","allow_negative","allow_positive","force","created_at","pending_amount_to","pending_amount_from","current","available_balance"],Go={$schema:RC,$id:AC,title:UC,description:qC,$comment:NC,type:BC,properties:LC,additionalProperties:VC,definitions:HC,required:zC};var KC="http://json-schema.org/draft-07/schema",QC="TransferLogTableOptional",JC="TransferLogTableOptional",XC="Individual parts of a transfer, will be updated internally by db. Immutable Only require id, other fields are optional",YC="READONLY",ZC="object",eP={id:{description:"System defined primary key",type:"integer"},transfer_id:{description:"Foreign key pointing to the transfer this log belongs to",type:"integer"},wallet_id:{description:"Foreign key pointing to the wallet this log refers to",type:"integer"},token_id:{description:"Foreign key pointing to the token this log refers to",type:"integer"},type:{description:"Type of this log",$ref:"/db/consts.schema.json#/definitions/TransferType"},amount:{description:"The amount the wallet balance is changed by",type:"number"},pending_amount:{description:"The pending balance of wallet after this transfer_log",type:"number"},finished_amount:{description:"The finished balance of wallet after this transfer_log",type:"number"},status:{description:"Status of this log - same as Transfer.status",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},allow_negative:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be negative",default:!1,type:"boolean"},allow_positive:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be positive. Used for token balance to deny positive balance.",default:!0,type:"boolean"},force:{description:"Boolean indicating if the latest transfer from this wallet was forced to ignore negative balance checks",default:!1,type:"boolean"},created_at:{description:"Datetime this log was created",type:"string",format:"date-time"},latest_control_hash:{description:"Latest hash related to this wallet",type:["string","null"],maxLength:255},pending_amount_to:{description:"The incoming pending balance",type:"number"},pending_amount_from:{description:"The outgoing pending balance",type:"number"},group_balance:{description:"Running balance for the wallet in this group",type:["number","null"]},transfer_group_id:{description:"Foreign key pointing to the transfer_group this transfer_log belongs to",type:["integer","null"]},current:{description:"Boolean showing if this transfer_log is the latest for this wallet/token combination",default:!1,type:"boolean"},available_balance:{description:"Available balance that is sum of pending_amount_from and finished_amount",type:"number"},token_limit:{description:"If wallet = token.belongs_to and token has limit",type:["number","null"]}},tP=!1,rP=["id"],Oh={$schema:KC,$id:QC,title:JC,description:XC,$comment:YC,type:ZC,properties:eP,additionalProperties:tP,required:rP};var nP="http://json-schema.org/draft-07/schema",aP="WalletTableInput",sP="WalletTableInput",iP="Entities who can make transfers in this system",oP="object",pP={foreign:{description:"User provided key for wallet. Must be unique",type:"string",maxLength:64,minLength:1},name:{description:"Name of the wallet",type:["string","null"],maxLength:255},metadata:{description:"Key/value metadata object",type:["object","null"]},type:{description:"Type of the wallet",default:"regular",$ref:"/db/consts.schema.json#/definitions/WalletType"},status:{description:"Current status for the wallet",default:"active",$ref:"/db/consts.schema.json#/definitions/WalletStatus"}},fP=!1,uP=["foreign"],Do={$schema:nP,$id:aP,title:sP,description:iP,type:oP,properties:pP,additionalProperties:fP,required:uP};var dP="http://json-schema.org/draft-07/schema",lP="WalletTable",cP="WalletTable",mP="Entities who can make transfers in this system",hP="object",gP={id:{description:"System defined primary key",type:"integer"},foreign:{description:"User provided key for wallet. Must be unique",type:"string",maxLength:64,minLength:1},name:{description:"Name of the wallet",type:["string","null"],maxLength:255},metadata:{description:"Key/value metadata object",type:["object","null"]},type:{description:"Type of the wallet",default:"regular",$ref:"/db/consts.schema.json#/definitions/WalletType"},default_allow_negative:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be negative",default:!1,type:"boolean"},default_allow_positive:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be positive. Used for token balance to deny positive balance.",default:!0,type:"boolean"},created_at:{description:"Datetime when the wallet was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when the wallet was last updated",type:"string",format:"date-time"},status:{description:"Current status for the wallet",default:"active",$ref:"/db/consts.schema.json#/definitions/WalletStatus"},default_dtw_to:{description:"Bitmap indicating default what types of transfers can originate from wallet",default:"110",type:"string",maxLength:255,minLength:1},default_dtw_from:{description:"Bitmap indicating default what types of transfers can end to wallet",default:"011",type:"string",maxLength:255,minLength:1}},_P=!1,TP={WalletTableAccessibleFields:{$id:"WalletTableAccessibleFields",type:"string",enum:["id","foreign","name","metadata","type","status"]},WalletTableFields:{$id:"WalletTableFields",type:"string",enum:["id","foreign","name","metadata","type","default_allow_negative","default_allow_positive","created_at","updated_at","status"]},WalletTableStringFields:{$id:"WalletTableStringFields",type:"string",enum:["foreign","name","type","created_at","updated_at","status"]},WalletTableObjectFields:{$id:"WalletTableObjectFields",type:"string",enum:["metadata"]},WalletTableNumberFields:{$id:"WalletTableNumberFields",type:"string",enum:["id"]},WalletTableBooleanFields:{$id:"WalletTableBooleanFields",type:"string",enum:["default_allow_negative","default_allow_positive"]}},yP=["id","foreign","type","default_allow_negative","default_allow_positive","created_at","updated_at","status"],Mo={$schema:dP,$id:lP,title:cP,description:mP,type:hP,properties:gP,additionalProperties:_P,definitions:TP,required:yP};var bP="http://json-schema.org/draft-07/schema",xP="WalletTableOptional",FP="WalletTableOptional",wP="Entities who can make transfers in this system Only require id, other fields are optional",$P="object",OP={id:{description:"System defined primary key",type:"integer"},foreign:{description:"User provided key for wallet. Must be unique",type:"string",maxLength:64,minLength:1},name:{description:"Name of the wallet",type:["string","null"],maxLength:255},metadata:{description:"Key/value metadata object",type:["object","null"]},type:{description:"Type of the wallet",default:"regular",$ref:"/db/consts.schema.json#/definitions/WalletType"},default_allow_negative:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be negative",default:!1,type:"boolean"},default_allow_positive:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be positive. Used for token balance to deny positive balance.",default:!0,type:"boolean"},created_at:{description:"Datetime when the wallet was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when the wallet was last updated",type:"string",format:"date-time"},status:{description:"Current status for the wallet",default:"active",$ref:"/db/consts.schema.json#/definitions/WalletStatus"},default_dtw_to:{description:"Bitmap indicating default what types of transfers can originate from wallet",default:"110",type:"string",maxLength:255,minLength:1},default_dtw_from:{description:"Bitmap indicating default what types of transfers can end to wallet",default:"011",type:"string",maxLength:255,minLength:1}},vP=!1,jP=["id"],vh={$schema:bP,$id:xP,title:FP,description:wP,type:$P,properties:OP,additionalProperties:vP,required:jP};var IP="http://json-schema.org/draft-07/schema",kP="WalletTokenSettingTableInput",SP="WalletTokenSettingTableInput",CP="Settings between a wallet and token",PP="object",GP={},DP=!1,Wo={$schema:IP,$id:kP,title:SP,description:CP,type:PP,properties:GP,additionalProperties:DP};var MP="http://json-schema.org/draft-07/schema",WP="WalletTokenSettingTable",EP="WalletTokenSettingTable",RP="Settings between a wallet and token",AP="object",UP={id:{description:"System defined primary key",type:"integer"},wallet_id:{description:"Foreign key to wallet these settings refer to",type:"integer"},token_id:{description:"Foreign key to token these settings refer to",type:"integer"},allow_negative:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be negative",default:!1,type:"boolean"},allow_positive:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be positive. Used for token balance to deny positive balance.",default:!0,type:"boolean"},created_at:{description:"Datetime when the token was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when the token was last updated",type:"string",format:"date-time"},dtw_to:{description:"Bitmap indicating default what types of transfers can originate from wallet",default:"110",type:"string",maxLength:255,minLength:1},dtw_from:{description:"Bitmap indicating default what types of transfers can end to wallet",default:"011",type:"string",maxLength:255,minLength:1}},qP=!1,NP={WalletTokenSettingTableAccessibleFields:{$id:"WalletTokenSettingTableAccessibleFields",type:"string",enum:["id"]},WalletTokenSettingTableFields:{$id:"WalletTokenSettingTableFields",type:"string",enum:["id","wallet_id","token_id","allow_negative","allow_positive","created_at","updated_at"]},WalletTokenSettingTableStringFields:{$id:"WalletTokenSettingTableStringFields",type:"string",enum:["created_at","updated_at"]},WalletTokenSettingTableNumberFields:{$id:"WalletTokenSettingTableNumberFields",type:"string",enum:["id","wallet_id","token_id"]},WalletTokenSettingTableBooleanFields:{$id:"WalletTokenSettingTableBooleanFields",type:"string",enum:["allow_negative","allow_positive"]}},BP=["id","wallet_id","token_id","allow_negative","allow_positive","created_at","updated_at"],Eo={$schema:MP,$id:WP,title:EP,description:RP,type:AP,properties:UP,additionalProperties:qP,definitions:NP,required:BP};var LP="http://json-schema.org/draft-07/schema",VP="WalletTokenSettingTableOptional",HP="WalletTokenSettingTableOptional",zP="Settings between a wallet and token Only require id, other fields are optional",KP="object",QP={id:{description:"System defined primary key",type:"integer"},wallet_id:{description:"Foreign key to wallet these settings refer to",type:"integer"},token_id:{description:"Foreign key to token these settings refer to",type:"integer"},allow_negative:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be negative",default:!1,type:"boolean"},allow_positive:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be positive. Used for token balance to deny positive balance.",default:!0,type:"boolean"},created_at:{description:"Datetime when the token was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when the token was last updated",type:"string",format:"date-time"},dtw_to:{description:"Bitmap indicating default what types of transfers can originate from wallet",default:"110",type:"string",maxLength:255,minLength:1},dtw_from:{description:"Bitmap indicating default what types of transfers can end to wallet",default:"011",type:"string",maxLength:255,minLength:1}},JP=!1,XP=["id"],jh={$schema:LP,$id:VP,title:HP,description:zP,type:KP,properties:QP,additionalProperties:JP,required:XP};var YP="http://json-schema.org/draft-07/schema",ZP="WapiSettingTableInput",e0="WapiSettingTableInput",t0="Database settings",r0="object",n0={type:{description:"",default:"flag",$ref:"/db/consts.schema.json#/definitions/WapiSettingType"},name:{description:"name of setting. Must be unique",type:"string",maxLength:32,minLength:1},value:{description:"value of setting",type:"string",minLength:1},applied:{description:"is setting applied",default:!1,type:"boolean"}},a0=!1,s0=["name","value"],Ro={$schema:YP,$id:ZP,title:e0,description:t0,type:r0,properties:n0,additionalProperties:a0,required:s0};var i0="http://json-schema.org/draft-07/schema",o0="WapiSettingTable",p0="WapiSettingTable",f0="Database settings",u0="object",d0={id:{description:"System defined primary key",type:"integer"},type:{description:"",default:"flag",$ref:"/db/consts.schema.json#/definitions/WapiSettingType"},name:{description:"name of setting. Must be unique",type:"string",maxLength:32,minLength:1},value:{description:"value of setting",type:"string",minLength:1},applied:{description:"is setting applied",default:!1,type:"boolean"},created_at:{description:"Datetime when the flag was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when the flag was last updated",type:"string",format:"date-time"}},l0=!1,c0={WapiSettingTableAccessibleFields:{$id:"WapiSettingTableAccessibleFields",type:"string",enum:["id","type","name","value","applied"]},WapiSettingTableFields:{$id:"WapiSettingTableFields",type:"string",enum:["id","type","name","value","applied","created_at","updated_at"]},WapiSettingTableStringFields:{$id:"WapiSettingTableStringFields",type:"string",enum:["type","name","value","created_at","updated_at"]},WapiSettingTableNumberFields:{$id:"WapiSettingTableNumberFields",type:"string",enum:["id"]},WapiSettingTableBooleanFields:{$id:"WapiSettingTableBooleanFields",type:"string",enum:["applied"]}},m0=["id","type","name","value","applied","created_at","updated_at"],Ao={$schema:i0,$id:o0,title:p0,description:f0,type:u0,properties:d0,additionalProperties:l0,definitions:c0,required:m0};var h0="http://json-schema.org/draft-07/schema",g0="WapiSettingTableOptional",_0="WapiSettingTableOptional",T0="Database settings Only require id, other fields are optional",y0="object",b0={id:{description:"System defined primary key",type:"integer"},type:{description:"",default:"flag",$ref:"/db/consts.schema.json#/definitions/WapiSettingType"},name:{description:"name of setting. Must be unique",type:"string",maxLength:32,minLength:1},value:{description:"value of setting",type:"string",minLength:1},applied:{description:"is setting applied",default:!1,type:"boolean"},created_at:{description:"Datetime when the flag was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when the flag was last updated",type:"string",format:"date-time"}},x0=!1,F0=["id"],Ih={$schema:h0,$id:g0,title:_0,description:T0,type:y0,properties:b0,additionalProperties:x0,required:F0};var w0="http://json-schema.org/draft-07/schema",$0="AggregateTransfersFnInput",O0="AggregateTransfersFnInput",v0="Input for aggregateTransfers",j0="object",I0={wallet:{description:"Foreign of the wallet connected to transfers",type:["string","integer"]},token:{description:"Foreign of the token transferred",type:["string","integer"]},from_wallet:{description:"Foreign of the wallet transfers are made from",type:["string","integer"]},to_wallet:{description:"Foreign of the wallet transfers are made to",type:["string","integer"]},transfer_group:{description:"Foreign of the transfer_group the transfers are a part of",type:["string","integer"]},status:{description:"Status of the transfers",$ref:"/db/transfer/transfer.schema.input.json#/properties/status"},metadata:{description:"Metadata filter",$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"},aggregators:{type:"array",items:{$ref:"/txs/aggregate-transfer-many/aggregate-transfer-many.schema.input.json#/definitions/aggregate_transfer_many_aggregator"}},groups:{$ref:"/txs/aggregate-transfer-many/aggregate-transfer-many.schema.input.json#/definitions/aggregate_transfer_many_groups"},options:{$ref:"#/definitions/aggregate_transfers_fn_options"}},k0={aggregate_transfers_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/aggregate-transfer-many/aggregate-transfer-many.schema.input.json#/definitions/aggregate_transfer_many_tx_options"}]}},S0=!1,C0=!0,Uo={$schema:w0,$id:$0,title:O0,description:v0,type:j0,properties:I0,definitions:k0,additionalProperties:S0,$aggregateQueryBuilder:C0};var P0="http://json-schema.org/draft-07/schema",G0="AggregateTransfersFnOutput",D0="AggregateTransfersFnOutput",M0="Output of aggregateTransfers",W0="object",E0="/txs/aggregate-transfer-many/aggregate-transfer-many.schema.output.json",qo={$schema:P0,$id:G0,title:D0,description:M0,type:W0,$ref:E0};var R0="http://json-schema.org/draft-07/schema",A0="CreateAccessTokenFnInput",U0="CreateAccessTokenFnInput",q0="Input for createAccessToken",N0="object",B0={token:{anyOf:[{$ref:"/txs/create-access-token/create-access-token.schema.input.json#/definitions/create_access_token_limited"},{$ref:"/txs/create-access-token/create-access-token.schema.input.json#/definitions/create_access_token_admin"}]},options:{$ref:"#/definitions/create_access_token_fn_options"}},L0={create_access_token_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/create-access-token/create-access-token.schema.input.json#/definitions/create_access_token_tx_options"}]}},V0=!1,No={$schema:R0,$id:A0,title:U0,description:q0,type:N0,properties:B0,definitions:L0,additionalProperties:V0};var H0="http://json-schema.org/draft-07/schema",z0="CreateAccessTokenFnOutput",K0="CreateAccessTokenFnOutput",Q0="Output of createAccessToken",J0="object",X0="/txs/create-access-token/create-access-token.schema.output.json",Bo={$schema:H0,$id:z0,title:K0,description:Q0,type:J0,$ref:X0};var Y0="http://json-schema.org/draft-07/schema",Z0="CreateContractFnInput",eG="CreateContractFnInput",tG="Input for createContract",rG="object",nG=[{$ref:"#/definitions/create_contract_input"},{type:"object",properties:{options:{$ref:"#/definitions/create_contract_fn_options"}},$typescript:'{"additionalProperties": false}'}],aG={create_contract_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/create-contract/create-contract.schema.input.json#/definitions/create_contract_tx_options"}],$typescript:'{"additionalProperties": false}'},create_contract_input:{type:"object",properties:{foreign:{description:"Unique foreign of the created Contract",type:["string","integer"]},metadata:{allOf:[{$ref:"/db/token/token.schema.input.json#/properties/metadata"}]},value_token:{description:"Foreign of the token this contract is valued in",type:["string","integer"]},value_amount:{description:"Amount of value this Contract has",type:"number"},owner:{description:"Foreign of the wallet this contract should initially belong to",type:["string","integer"]},buyer:{allOf:[{$ref:"#/definitions/create_contract_buyer_input"}]}},required:["foreign","value_amount","value_token"],$typescript:'{"additionalProperties": false}'},create_contract_buyer_input:{type:"object",properties:{wallet:{description:"Foreign of the wallet buying this contract",type:["string","integer"]},token:{description:"Foreign of the token buyer will buy with, defaults to Contract value token",type:["string","integer"]},amount:{description:"Amount the buyer will pay, defaults to contract value amount",type:"number"},metadata:{allOf:[{$ref:"/db/token/token.schema.input.json#/properties/metadata"}]},latest_control_hash:{description:"Latest control_hash on the buyer wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]}},required:["wallet"],additionalProperties:!1}},sG='{"additionalProperties": false}',Lo={$schema:Y0,$id:Z0,title:eG,description:tG,type:rG,allOf:nG,definitions:aG,$typescript:sG};var iG="http://json-schema.org/draft-07/schema",oG="CreateContractFnOutput",pG="CreateContractFnOutput",fG="Output of createContract",uG="object",dG="/txs/create-contract/create-contract.schema.output.json",Vo={$schema:iG,$id:oG,title:pG,description:fG,type:uG,$ref:dG};var lG="http://json-schema.org/draft-07/schema",cG="CreateDepositFnInput",mG="CreateDepositFnInput",hG="Input for createDeposit",gG="object",_G=[{$ref:"#/definitions/create_deposit_input"},{type:"object",properties:{options:{$ref:"#/definitions/create_deposit_fn_options"}},$typescript:'{"additionalProperties": false}'}],TG={create_deposit_fn_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/create_deposit_fn_additional_options"}]},create_deposit_fn_additional_options:{type:"object",properties:{return_balance:{description:"return balance after deposit",type:"boolean",default:!1},create_wallet_if_not_exists:{type:"boolean",description:"If true then the wallet will be created if not found. Only valid with 'foreign'",default:!1}},$typescript:'{"additionalProperties": false}'},create_deposit_input:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Id of the token to deposit as",type:["string","integer"]},wallet:{description:"Id of the wallet to deposit to",type:["string","integer"]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},status:{description:"status of the deposit",enum:["pending","finished"],default:"finished"},transfer_group:{description:"Id of the transfer_group this deposit is linked to",type:["string"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["wallet","amount"],$typescript:'{"additionalProperties": false}'}},yG='{"additionalProperties": false}',Ho={$schema:lG,$id:cG,title:mG,description:hG,type:gG,allOf:_G,definitions:TG,$typescript:yG};var bG="http://json-schema.org/draft-07/schema",xG="CreateDepositFnOutput",FG="CreateDepositFnOutput",wG="Output of deposit",$G="/txs/create-deposit/create-deposit.schema.output.json",zo={$schema:bG,$id:xG,title:FG,description:wG,$ref:$G};var OG="http://json-schema.org/draft-07/schema",vG="CreateExchangeFnInput",jG="CreateExchangeFnInput",IG="Input for createExchange",kG="object",SG={identifier:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/identifier"},from_identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},from_wallet:{description:"Foreign of Wallet where from_token is debited from/to_token is credited to",type:["string","integer"]},from_token:{description:"Foreign of Token that is transferred from->to",type:["string","integer"]},from_amount:{description:"Amount of from_token transferred",$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},to_identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},to_wallet:{description:"Foreign of Wallet where from_token is credited to/to_token is debited from. If not specified then to_token.belongs_to is used",type:["string","integer"]},to_token:{description:"Foreign of Token that is transferred to->from",type:["string","integer"]},to_amount:{description:"Amount of to_token transferred. If not specified then from_amount is used",$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},status:{description:"The state at which the exchange is created",type:"string",enum:["pending","finished"]},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},options:{$ref:"#/definitions/create_exchange_fn_options"}},CG=["from_wallet","from_token","from_amount","to_token","to_wallet"],PG={create_exchange_fn_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/create_exchange_additional_options"}]},exchange_data:{type:"object",properties:{identifier:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/identifier"},from_identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},from_latest_control_hash:{description:"Latest control_hash on the from_wallet+from_token combo. Not required if no from_wallet specified",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},from_wallet:{description:"Wallet where from_token is debited from/to_token is credited to. If not specified then from_token.belongs_to is used",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},from_token:{description:"Token that is transferred from->to",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},from_amount:{description:"Amount of from_token transferred",$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},to_identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},to_latest_control_hash:{description:"Latest control_hash on the to_wallet+to_token combo. Not required if no to_wallet specified",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},to_wallet:{description:"Wallet where from_token is credited to/to_token is debited from. If not specified then to_token.belongs_to is used",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_token:{description:"Token that is transferred to->from",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},to_amount:{description:"Amount of to_token transferred. If not specified then from_amount is used",$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},status:{description:"The state at which the exchange is created",type:"string",enum:["pending","finished"]},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"}},additionalProperties:!1},create_exchange_additional_options:{description:"Optional flags for input",type:"object",default:{},$typescript:'{"additionalProperties":false}'}},GG=!1,Ko={$schema:OG,$id:vG,title:jG,description:IG,type:kG,properties:SG,required:CG,definitions:PG,additionalProperties:GG};var DG="http://json-schema.org/draft-07/schema",MG="CreateExchangeFnOutput",WG="CreateExchangeFnOutput",EG="Output of createExchange",RG=[{$ref:"/txs/create-transfer-group/create-transfer-group.schema.output.json"}],Qo={$schema:DG,$id:MG,title:WG,description:EG,allOf:RG};var AG="http://json-schema.org/draft-07/schema",UG="CreateTokenFnInput",qG="CreateTokenFnInput",NG="Input for createToken",BG=[{$ref:"#/definitions/create_token_fn_input_data"},{$ref:"#/definitions/create_token_fn_options_property"}],LG={create_token_fn_options:{allOf:[{$ref:"/txs/create-token/create-token.schema.input.json#/definitions/create_token_tx_options"}]},create_token_fn_options_property:{type:"object",properties:{options:{$ref:"#/definitions/create_token_fn_options"}},$typescript:'{"additionalProperties": false}'},create_token_fn_input_data:{type:"object",properties:{foreign:{$ref:"/db/token/token.schema.input.json#/properties/foreign"},public:{$ref:"/db/token/token.schema.input.json#/properties/public"},metadata:{$ref:"/db/token/token.schema.input.json#/properties/metadata"},divisor:{$ref:"/db/token/token.schema.input.json#/properties/divisor"},limit:{$ref:"/db/token/token.schema.input.json#/properties/limit"},belongs_to:{description:"Id of the wallet this token belongs_to",type:["string","integer"]}},required:["foreign"],$typescript:'{"additionalProperties": false}'}},VG='{"additionalProperties": false}',Jo={$schema:AG,$id:UG,title:qG,description:NG,allOf:BG,definitions:LG,$typescript:VG};var HG="http://json-schema.org/draft-07/schema",zG="CreateTokenFnOutput",KG="CreateTokenFnOutput",QG="Output of createToken",JG="/txs/create-token/create-token.schema.output.json",Xo={$schema:HG,$id:zG,title:KG,description:QG,$ref:JG};var XG="http://json-schema.org/draft-07/schema",YG="CreateTransferFnInput",ZG="CreateTransferFnInput",eD="Input for transfer",tD=[{$ref:"#/definitions/create_transfer_input"},{$ref:"#/definitions/create_transfer_withdrawal_input"},{$ref:"#/definitions/create_transfer_deposit_input"}],rD={create_transfer_fn_options:{$comment:"Using allOf so that references dont break",type:"object",allOf:[{$ref:"/txs/create-transfer/create-transfer.schema.input.json#/definitions/create_transfer_tx_options"}]},create_transfer_fn_options_property:{type:"object",properties:{options:{$ref:"#/definitions/create_transfer_fn_options"}},$typescript:'{"additionalProperties": false}'},create_transfer_input:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Foreign of the token to transfer as",type:["string","integer"]},from_wallet:{description:"Foreign of the wallet to deposit to",type:["string","integer"]},to_wallet:{description:"Foreign of the wallet to deposit to",type:["string","integer"]},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},type:{type:"string",enum:["transfer"]},status:{description:"status of the transfer",enum:["pending","finished"],default:"finished"},transfer_group:{description:"Id of the transfer_group this transfer is linked to",type:["string"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"},options:{$ref:"#/definitions/create_transfer_fn_options"}},required:["from_wallet","to_wallet","amount"],$typescript:'{"additionalProperties": false}'},create_transfer_withdrawal_input:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Foreign of the token to transfer as",type:["string","integer"]},wallet:{description:"Foreign of the wallet to withdraw from",type:["string","integer"]},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},type:{type:"string",enum:["withdrawal"]},status:{description:"status of the transfer",enum:["pending","finished"],default:"finished"},transfer_group:{description:"Id of the transfer_group this transfer is linked to",type:["string"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"},options:{$ref:"#/definitions/create_transfer_fn_options"}},required:["wallet","amount","type"],$typescript:'{"additionalProperties": false}'},create_transfer_deposit_input:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Foreign of the token to transfer as",type:["string","integer"]},wallet:{description:"Foreign of the wallet to deposit to",type:["string","integer"]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},type:{type:"string",enum:["deposit"]},status:{description:"status of the transfer",enum:["pending","finished"],default:"finished"},transfer_group:{description:"Id of the transfer_group this transfer is linked to",type:["string"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"},options:{$ref:"#/definitions/create_transfer_fn_options"}},required:["wallet","amount","type"],$typescript:'{"additionalProperties": false}'},create_transfer_wild_input:{anyOf:[{$ref:"#/definitions/create_transfer_input"},{$ref:"#/definitions/create_transfer_withdrawal_input"},{$ref:"#/definitions/create_transfer_deposit_input"}]}},nD='{"additionalProperties": false}',Yo={$schema:XG,$id:YG,title:ZG,description:eD,oneOf:tD,definitions:rD,$typescript:nD};var aD="http://json-schema.org/draft-07/schema",sD="CreateTransferFnOutput",iD="CreateTransferFnOutput",oD="Output of transfer",pD="/txs/create-transfer/create-transfer.schema.output.json",Zo={$schema:aD,$id:sD,title:iD,description:oD,$ref:pD};var fD="http://json-schema.org/draft-07/schema",uD="CreateTransferGroupFnInput",dD="CreateTransferGroupFnInput",lD="Input for createTransferGroup",cD="object",mD=[{$ref:"#/definitions/create_transfer_group_fn_input_data"},{$ref:"#/definitions/create_transfer_group_fn_options_property"}],hD={create_transfer_group_fn_options:{$comment:"Using allOf, because otherwise references break",type:"object",allOf:[{$ref:"/txs/create-transfer-group/create-transfer-group.schema.input.json#/definitions/create_transfer_group_tx_options"}]},create_transfer_group_fn_options_property:{type:"object",properties:{options:{$ref:"#/definitions/create_transfer_group_fn_options"}},$typescript:'{"additionalProperties": false}'},create_transfer_group_fn_input_data:{type:"object",properties:{identifier:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/identifier"},status:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/status"},transfer_status:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/transfer_status"},metadata:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/metadata"},children:{description:"Array of children",type:"array",items:{$ref:"#/definitions/child_transfer_data_fn"}}},$typescript:'{"additionalProperties": false}'},child_transfer_data_fn:{anyOf:[{$ref:"#/definitions/child_transfer_data_regular_fn"},{$ref:"#/definitions/child_transfer_data_withdrawal_fn"},{$ref:"#/definitions/child_transfer_data_deposit_fn"}]},child_transfer_data_regular_fn:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Foreign of the token to transfer as",type:["string","integer"]},from_wallet:{description:"Foreign of the wallet to deposit to",type:["string","integer"]},to_wallet:{description:"Foreign of the wallet to deposit to",type:["string","integer"]},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},type:{type:"string",enum:["transfer"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["from_wallet","to_wallet","amount"],$typescript:'{"additionalProperties": false}'},child_transfer_data_withdrawal_fn:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Foreign of the token to transfer as",type:["string","integer"]},wallet:{description:"Foreign of the wallet to withdraw from",type:["string","integer"]},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},type:{type:"string",enum:["withdrawal"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["wallet","amount","type"],$typescript:'{"additionalProperties": false}'},child_transfer_data_deposit_fn:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Foreign of the token to transfer as",type:["string","integer"]},wallet:{description:"Foreign of the wallet to deposit to",type:["string","integer"]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},type:{type:"string",enum:["deposit"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["wallet","amount","type"],$typescript:'{"additionalProperties": false}'}},gD='{"additionalProperties": false}',ep={$schema:fD,$id:uD,title:dD,description:lD,type:cD,allOf:mD,definitions:hD,$typescript:gD};var _D="http://json-schema.org/draft-07/schema",TD="CreateTransferGroupFnOutput",yD="CreateTransferGroupFnOutput",bD="Output of createTransferGroup",xD="object",FD="/txs/create-transfer-group/create-transfer-group.schema.output.json",tp={$schema:_D,$id:TD,title:yD,description:bD,type:xD,$ref:FD};var wD="http://json-schema.org/draft-07/schema",$D="CreateTransfersFnInput",OD="CreateTransfersFnInput",vD="Input for createTransfers",jD="object",ID={transfers:{type:"array",minItems:1,items:{$ref:"/fns/create-transfer/create-transfer.schema.input.json#/definitions/create_transfer_wild_input"}},options:{$ref:"#/definitions/create_transfers_fn_options"}},kD={create_transfers_fn_options:{allOf:[{$ref:"/txs/create-transfer-many/create-transfer-many.schema.input.json#/definitions/create_transfer_many_tx_options"}]}},SD=["transfers"],CD=!1,rp={$schema:wD,$id:$D,title:OD,description:vD,type:jD,properties:ID,definitions:kD,required:SD,additionalProperties:CD};var PD="http://json-schema.org/draft-07/schema",GD="CreateTransfersFnOutput",DD="CreateTransfersFnOutput",MD="Output of createTransfers",WD="/txs/create-transfer-many/create-transfer-many.schema.output.json",np={$schema:PD,$id:GD,title:DD,description:MD,$ref:WD};var ED="http://json-schema.org/draft-07/schema",RD="CreateWalletFnInput",AD="CreateWalletFnInput",UD="Input for createWallet",qD="object",ND=[{$ref:"#/definitions/create_wallet_fn_input_data"},{$ref:"#/definitions/create_wallet_fn_options_property"}],BD={create_wallet_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/create-wallet/create-wallet.schema.input.json#/definitions/create_wallet_tx_options"}]},create_wallet_fn_options_property:{type:"object",properties:{options:{$ref:"#/definitions/create_wallet_fn_options"}},$typescript:'{"additionalProperties": false}'},create_wallet_fn_input_data:{type:"object",properties:{foreign:{$ref:"/db/wallet/wallet.schema.input.json#/properties/foreign"},name:{$ref:"/db/wallet/wallet.schema.input.json#/properties/name"},metadata:{$ref:"/db/wallet/wallet.schema.input.json#/properties/metadata"},status:{$ref:"/db/wallet/wallet.schema.input.json#/properties/status"}},required:["foreign"],$typescript:'{"additionalProperties": false}'}},LD='{"additionalProperties": false}',ap={$schema:ED,$id:RD,title:AD,description:UD,type:qD,allOf:ND,definitions:BD,$typescript:LD};var VD="http://json-schema.org/draft-07/schema",HD="CreateWalletFnOutput",zD="CreateWalletFnOutput",KD="Output of createWallet",QD="object",JD="/txs/create-wallet/create-wallet.schema.output.json",sp={$schema:VD,$id:HD,title:zD,description:KD,type:QD,$ref:JD};var XD="http://json-schema.org/draft-07/schema",YD="CreateWithdrawalFnInput",ZD="CreateWithdrawalFnInput",eM="Input for withdraw",tM="object",rM=[{$ref:"#/definitions/create_withdrawal_input"},{type:"object",properties:{options:{$ref:"#/definitions/create_withdrawal_fn_options"}},$typescript:'{"additionalProperties": false}'}],nM={create_withdrawal_fn_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/create_withdrawal_fn_additional_options"}]},create_withdrawal_fn_additional_options:{type:"object",properties:{return_balance:{description:"Return balance after withdrawal",type:"boolean"}},default:{},$typescript:'{"additionalProperties": false}'},create_withdrawal_input:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Foreign of the token to deposit as",type:["string","integer"]},wallet:{description:"Foreign of the wallet to deposit to",type:["string","integer"]},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},status:{description:"status of the withdrawal",enum:["pending","finished"],default:"finished"},transfer_group:{description:"Id of the transfer_group this withdrawal is linked to",type:["string"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["wallet","amount"],$typescript:'{"additionalProperties": false}'}},aM='{"additionalProperties": false}',ip={$schema:XD,$id:YD,title:ZD,description:eM,type:tM,allOf:rM,definitions:nM,$typescript:aM};var sM="http://json-schema.org/draft-07/schema",iM="CreateWithdrawalFnOutput",oM="CreateWithdrawalFnOutput",pM="Output of withdraw",fM="/txs/create-withdrawal/create-withdrawal.schema.output.json",op={$schema:sM,$id:iM,title:oM,description:pM,$ref:fM};var uM="http://json-schema.org/draft-07/schema",dM="FindBalancesFnInput",lM="FindBalancesFnInput",cM="Input for findBalances",mM="object",hM={token:{description:"Id of the token to get balance",type:["string","integer"]},wallet:{description:"Id of the wallet to get balance from",type:["string","integer"]},options:{$ref:"#/definitions/find_balances_fn_options"}},gM={find_balances_fn_options:{description:"findBalances function options",allOf:[{$ref:"/fns/fn-consts.schema.json#/definitions/i_fn_find_options_extra"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"/txs/find-balance-many/find-balance-many.schema.input.json#/definitions/find_balance_many_ordering_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_select_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_deselect_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_options"}]}},_M=!0,TM=!1,pp={$schema:uM,$id:dM,title:lM,description:cM,type:mM,properties:hM,definitions:gM,$queryBuilder:_M,additionalProperties:TM};var yM="http://json-schema.org/draft-07/schema",bM="FindBalancesFnOutput",xM="FindBalancesFnOutput",FM="Output of findBalances",wM="object",$M="/txs/find-balance-many/find-balance-many.schema.output.json",fp={$schema:yM,$id:bM,title:xM,description:FM,type:wM,$ref:$M};var OM="http://json-schema.org/draft-07/schema",vM="FindTokensFnInput",jM="FindTokensFnInput",IM="Input for findTokens",kM="object",SM={foreign:{description:"Foreign of the token",type:["string","integer"]},type:{$ref:"/db/token/token.schema.json#/properties/type"},belongs_to:{description:"Foreign of the wallet connected to token",type:["string","integer"]},metadata:{description:"Metadata filter",$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"},options:{$ref:"#/definitions/find_tokens_fn_options"}},CM={find_tokens_fn_options:{description:"findtokens function options",allOf:[{$ref:"/fns/fn-consts.schema.json#/definitions/i_fn_find_options_extra"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"/txs/find-token-many/find-token-many.schema.input.json#/definitions/find_token_many_ordering_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_select_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_deselect_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_options"}]}},PM=!0,GM=!1,up={$schema:OM,$id:vM,title:jM,description:IM,type:kM,properties:SM,definitions:CM,$queryBuilder:PM,additionalProperties:GM};var DM="http://json-schema.org/draft-07/schema",MM="FindTokensFnOutput",WM="FindTokensFnOutput",EM="Output of findTokens",RM="object",AM="/txs/find-token-many/find-token-many.schema.output.json",dp={$schema:DM,$id:MM,title:WM,description:EM,type:RM,$ref:AM};var UM="http://json-schema.org/draft-07/schema",qM="FindTransferGroupsFnInput",NM="FindTransferGroupsFnInput",BM="Input for findTransferGroups",LM="object",VM={identifier:{description:"Identifier of the transfer_group",type:["string","integer"]},transfer_status:{description:"Status of the transfers",$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/transfer_status"},status:{description:"Status of the transfer_group",$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/status"},metadata:{description:"Metadata filter",$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"},reverses:{description:"Identifier of the transfer_group the transfer_group reverses",type:["string","integer"]},type:{description:"Type of the transfer group",$ref:"/db/consts.schema.json#/definitions/TransferGroupType"},options:{$ref:"#/definitions/find_transfer_groups_fn_options"}},HM={find_transfer_groups_fn_options:{description:"findTransferGroups function options",allOf:[{$ref:"/fns/fn-consts.schema.json#/definitions/i_fn_find_options_extra"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"/txs/find-transfer-group-many/find-transfer-group-many.schema.input.json#/definitions/find_transfer_group_many_ordering_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/find_transfer_groups_fn_extra_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_select_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_deselect_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_options"}]},find_transfer_groups_fn_extra_options:{description:"simplified options for findTransferGroups",type:"object",properties:{},$typescript:'{"additionalProperties":false}'}},zM=!0,KM=!1,lp={$schema:UM,$id:qM,title:NM,description:BM,type:LM,properties:VM,definitions:HM,$queryBuilder:zM,additionalProperties:KM};var QM="http://json-schema.org/draft-07/schema",JM="FindTransferGroupsFnOutput",XM="FindTransferGroupsFnOutput",YM="Output of findTransferGroups",ZM="object",eW="/txs/find-transfer-group-many/find-transfer-group-many.schema.output.json",cp={$schema:QM,$id:JM,title:XM,description:YM,type:ZM,$ref:eW};var tW="http://json-schema.org/draft-07/schema",rW="FindTransfersFnInput",nW="FindTransfersFnInput",aW="Input for findTransfers",sW="object",iW={wallet:{description:"Foreign of the wallet connected to transfers",type:["string","integer"]},token:{description:"Foreign of the token transferred",type:["string","integer"]},from_wallet:{description:"Foreign of the wallet transfers are made from",type:["string","integer"]},to_wallet:{description:"Foreign of the wallet transfers are made to",type:["string","integer"]},transfer_group:{description:"Foreign of the transfer_group the transfers are a part of",type:["string","integer"]},status:{description:"Status of the transfers",$ref:"/db/transfer/transfer.schema.input.json#/properties/status"},metadata:{description:"Metadata filter",$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"},options:{$ref:"#/definitions/find_transfers_fn_options"}},oW={find_transfers_fn_options:{description:"findTransfers function options",allOf:[{$ref:"/fns/fn-consts.schema.json#/definitions/i_fn_find_options_extra"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"/txs/find-transfer-many/find-transfer-many.schema.input.json#/definitions/find_transfer_many_ordering_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/find_transfers_fn_extra_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_select_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_deselect_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_options"}]},find_transfers_fn_extra_options:{description:"simplified options for findTransfers",type:"object",properties:{return_running_balance:{description:"return running balance for specified wallet under filter",type:"boolean"},return_signed_amount:{description:"return running balance for specified wallet under filter",type:"boolean"},return_running_balance_for_wallet:{description:"foreign key for which wallet should running balance be returned for",type:["string","integer"]},return_signed_amount_for_wallet:{description:"foreign key for which wallet should signed amounts be returned for",type:["string","integer"]}},$typescript:'{"additionalProperties":false}'}},pW=!0,fW=!1,mp={$schema:tW,$id:rW,title:nW,description:aW,type:sW,properties:iW,definitions:oW,$queryBuilder:pW,additionalProperties:fW};var uW="http://json-schema.org/draft-07/schema",dW="FindTransfersFnOutput",lW="FindTransfersFnOutput",cW="Output of findTransfers",mW="object",hW="/txs/find-transfer-many/find-transfer-many.schema.output.json",hp={$schema:uW,$id:dW,title:lW,description:cW,type:mW,$ref:hW};var gW="http://json-schema.org/draft-07/schema",_W="FindWalletsFnInput",TW="FindWalletsFnInput",yW="Input for findWallets",bW="object",xW={foreign:{$ref:"/db/wallet/wallet.schema.json#/properties/foreign"},name:{$ref:"/db/wallet/wallet.schema.json#/properties/name"},type:{$ref:"/db/wallet/wallet.schema.json#/properties/type"},status:{$ref:"/db/wallet/wallet.schema.json#/properties/status"},metadata:{description:"Metadata filter",$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"},options:{$ref:"#/definitions/find_wallets_fn_options"}},FW={find_wallets_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/fns/fn-consts.schema.json#/definitions/i_fn_find_options_extra"},{$ref:"/txs/find-wallet-many/find-wallet-many.schema.input.json#/definitions/find_wallet_many_tx_options"},{$ref:"#/definitions/find_wallets_fn_extra_options"}]},find_wallets_fn_extra_options:{type:"object",properties:{include_balance_for_token:{description:"Foreign of token to include balance for",type:["string","number"]}},$typescript:'{"additionalProperties":false}'}},wW=!0,$W=!1,gp={$schema:gW,$id:_W,title:TW,description:yW,type:bW,properties:xW,definitions:FW,$queryBuilder:wW,additionalProperties:$W};var OW="http://json-schema.org/draft-07/schema",vW="FindWalletsFnOutput",jW="FindWalletsFnOutput",IW="Output of findWallets",kW="object",SW="/txs/find-wallet-many/find-wallet-many.schema.output.json",_p={$schema:OW,$id:vW,title:jW,description:IW,type:kW,$ref:SW};var CW="http://json-schema.org/draft-07/schema",PW="FnConsts",GW="Generics used by functions",DW={i_fn_find_options:{description:"extended find options for client functions",allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_ordering_options"},{$ref:"#/definitions/i_fn_find_options_extra"}]},i_fn_find_options_extra:{description:"extra find options for client functions",$typescript:'{"additionalProperties":false}',type:"object",properties:{order_by:{description:"Ordering options in string format",type:"string"}}}},yp={$schema:CW,$id:PW,description:GW,definitions:DW};var MW="http://json-schema.org/draft-07/schema",WW="GetBalanceFnInput",EW="GetBalanceFnInput",RW="Input for Getbalance",AW="object",UW={token:{description:"Id of the token to get balance",type:["string","integer"]},wallet:{description:"Id of the wallet to get balance from",type:["string","integer"]},datetime:{description:"Date and time this balance should be got",type:"string"},options:{$ref:"#/definitions/get_balance_fn_options"}},qW={get_balance_fn_options:{allOf:[{$ref:"/txs/get-balance/get-balance.schema.input.json#/definitions/get_balance_tx_options"}]}},NW=["wallet"],BW=!1,bp={$schema:MW,$id:WW,title:EW,description:RW,type:AW,properties:UW,definitions:qW,required:NW,additionalProperties:BW};var LW="http://json-schema.org/draft-07/schema",VW="GetBalanceFnOutput",HW="GetBalanceFnOutput",zW="Output of balance",KW="object",QW="/txs/get-balance/get-balance.schema.output.json",xp={$schema:LW,$id:VW,title:HW,description:zW,type:KW,$ref:QW};var JW="http://json-schema.org/draft-07/schema",XW="GetBalanceHistoryFnInput",YW="GetBalanceHistoryFnInput",ZW="Input for getBalanceHistory",eE="object",tE={token:{description:"Id of the token to get balance",type:["string","integer"]},wallet:{description:"Id of the wallet to get balance from",type:["string","integer"]},options:{$ref:"#/definitions/get_balance_history_fn_options"}},rE={get_balance_history_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/get-balance-history/get-balance-history.schema.input.json#/definitions/get_balance_history_tx_options"}]}},nE=["wallet"],aE=!1,Fp={$schema:JW,$id:XW,title:YW,description:ZW,type:eE,properties:tE,definitions:rE,required:nE,additionalProperties:aE};var sE="http://json-schema.org/draft-07/schema",iE="GetBalanceHistoryFnOutput",oE="GetBalanceHistoryFnOutput",pE="Output of getBalanceHistory",fE="object",uE="/txs/get-balance-history/get-balance-history.schema.output.json",wp={$schema:sE,$id:iE,title:oE,description:pE,type:fE,$ref:uE};var dE="http://json-schema.org/draft-07/schema",lE="GetFlagsFnInput",cE="GetFlagsFnInput",mE="Input for getFlags",hE="object",gE={options:{$ref:"#/definitions/get_flags_fn_options"}},_E={},TE={get_flags_fn_options:{allOf:[{$ref:"/txs/get-flags/get-flags.schema.input.json#/definitions/get_flags_tx_options"}]}},yE=!1,$p={$schema:dE,$id:lE,title:cE,description:mE,type:hE,properties:gE,default:_E,definitions:TE,additionalProperties:yE};var bE="http://json-schema.org/draft-07/schema",xE="GetFlagsFnOutput",FE="GetFlagsFnOutput",wE="Output of getFlags",$E="/txs/get-flags/get-flags.schema.output.json",Op={$schema:bE,$id:xE,title:FE,description:wE,$ref:$E};var OE="http://json-schema.org/draft-07/schema",vE="GetStatisticsFnInput",jE="GetStatisticsFnInput",IE="Input for getStatistics",kE="object",SE={model:{$ref:"/txs/get-statistics/get-statistics.schema.input.json#/definitions/statistics_model"},groups:{$ref:"/txs/get-statistics/get-statistics.schema.input.json#/definitions/statistics_groups"},aggregator:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_aggregator"},filter:{$ref:"/txs/get-statistics/get-statistics.schema.input.json#/definitions/statistics_filter"},options:{$ref:"#/definitions/get_statistics_fn_options"}},CE={get_statistics_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/get-statistics/get-statistics.schema.input.json#/definitions/get_statistics_tx_options"}]}},PE=!1,vp={$schema:OE,$id:vE,title:jE,description:IE,type:kE,properties:SE,definitions:CE,additionalProperties:PE};var GE="http://json-schema.org/draft-07/schema",DE="GetStatisticsFnOutput",ME="GetStatisticsFnOutput",WE="Output of getStatistics",EE="object",RE="/txs/get-statistics/get-statistics.schema.output.json",jp={$schema:GE,$id:DE,title:ME,description:WE,type:EE,$ref:RE};var AE="http://json-schema.org/draft-07/schema",UE="GetTokenFnInput",qE="GetTokenFnInput",NE="Input for getToken",BE="object",LE={foreign:{$ref:"/db/token/token.schema.json#/properties/foreign"},options:{$ref:"#/definitions/get_token_fn_options"}},VE={get_token_fn_options:{allOf:[{$ref:"/txs/get-token/get-token.schema.input.json#/definitions/get_token_tx_options"}]}},HE=!1,Ip={$schema:AE,$id:UE,title:qE,description:NE,type:BE,properties:LE,definitions:VE,additionalProperties:HE};var zE="http://json-schema.org/draft-07/schema",KE="GetTokenFnOutput",QE="GetTokenFnOutput",JE="Output of getToken",XE="/txs/get-token/get-token.schema.output.json",kp={$schema:zE,$id:KE,title:QE,description:JE,$ref:XE};var YE="http://json-schema.org/draft-07/schema",ZE="GetTransferFnInput",eR="GetTransferFnInput",tR="Input for getTransfer",rR="object",nR={transfer:{description:"Transfer identifier",type:["string","integer"]},options:{$ref:"#/definitions/get_transfer_fn_options"}},aR={get_transfer_fn_options:{description:"Optional flags for input",allOf:[{$ref:"/txs/get-transfer/get-transfer.schema.input.json#/definitions/get_transfer_tx_options"}]}},sR=["transfer"],iR=!1,Sp={$schema:YE,$id:ZE,title:eR,description:tR,type:rR,properties:nR,definitions:aR,required:sR,additionalProperties:iR};var oR="http://json-schema.org/draft-07/schema",pR="GetTransferFnOutput",fR="GetTransferFnOutput",uR="Output of getTransfer",dR="object",lR="/txs/get-transfer/get-transfer.schema.output.json",Cp={$schema:oR,$id:pR,title:fR,description:uR,type:dR,$ref:lR};var cR="http://json-schema.org/draft-07/schema",mR="GetTransferGroupFnInput",hR="GetTransferGroupFnInput",gR="Input for getTransferGroup",_R="object",TR={transfer_group:{description:"identifier of the transfer group to reverse",type:["string","number"]},options:{$ref:"#/definitions/get_transfer_group_fn_options"}},yR={get_transfer_group_fn_options:{description:"Optional flags for input",allOf:[{$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/get_transfer_group_tx_options"}]}},bR=["transfer_group"],xR=!1,Pp={$schema:cR,$id:mR,title:hR,description:gR,type:_R,properties:TR,definitions:yR,required:bR,additionalProperties:xR};var FR="http://json-schema.org/draft-07/schema",wR="GetTransferGroupFnOutput",$R="GetTransferGroupFnOutput",OR="Output of getTransferGroup",vR="object",jR="/txs/get-transfer-group/get-transfer-group.schema.output.json",Gp={$schema:FR,$id:wR,title:$R,description:OR,type:vR,$ref:jR};var IR="http://json-schema.org/draft-07/schema",kR="GetWalletFnInput",SR="GetWalletFnInput",CR="Input for getWallet",PR="object",GR={wallet:{description:"Wallet foreign",type:["string","integer"]},options:{$ref:"#/definitions/get_wallet_fn_options"}},DR={get_wallet_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/get_wallet_tx_options"}]}},MR=["wallet"],WR=!1,Dp={$schema:IR,$id:kR,title:SR,description:CR,type:PR,properties:GR,definitions:DR,required:MR,additionalProperties:WR};var ER="http://json-schema.org/draft-07/schema",RR="GetWalletFnOutput",AR="GetWalletFnOutput",UR="Output of getWallet",qR="object",NR="/txs/get-wallet/get-wallet.schema.output.json",Mp={$schema:ER,$id:RR,title:AR,description:UR,type:qR,$ref:NR};var BR="http://json-schema.org/draft-07/schema",LR="ImportDataFnInput",VR="ImportDataFnInput",HR="Input for import",zR="object",KR={actions:{type:"array",items:{$ref:"#/definitions/import_data_fn_stream_chunk"}},options:{$ref:"#/definitions/import_data_fn_options"}},QR={import_data_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/import-actions/import-actions.schema.input.json#/definitions/import_actions_tx_options"}]},import_data_fn_stream_chunk:{type:"object",anyOf:[{$ref:"#/definitions/import_wallet"},{$ref:"#/definitions/import_token"},{$ref:"#/definitions/import_transfer_group"},{$ref:"#/definitions/import_transfer"},{$ref:"#/definitions/import_reverse_transfer"},{$ref:"#/definitions/import_reverse_transfer_group"}]},import_wallet:{type:"object",properties:{target:{description:"Target of the action",type:"string",enum:["wallet"]},data:{allOf:[{$ref:"/fns/create-wallet/create-wallet.schema.input.json#/definitions/create_wallet_fn_input_data"}]}},required:["target","data"],$typescript:'{"additionalProperties": false}'},import_token:{type:"object",properties:{target:{description:"Target of the action",type:"string",enum:["token"]},data:{allOf:[{$ref:"/fns/create-token/create-token.schema.input.json#/definitions/create_token_fn_input_data"}]}},required:["target","data"],$typescript:'{"additionalProperties": false}'},import_transfer_group_extension:{type:"object",properties:{created_at:{type:"string",format:"date-time"},status_finalized_at:{type:"string",format:"date-time"},transfer_status_finalized_at:{type:"string",format:"date-time"}},$typescript:'{"additionalProperties": false}'},import_transfer_group_data:{allOf:[{$ref:"/fns/create-transfer-group/create-transfer-group.schema.input.json#/definitions/create_transfer_group_fn_input_data"},{$ref:"#/definitions/import_transfer_group_extension"}]},import_transfer_group:{type:"object",properties:{target:{description:"Target of the action",type:"string",enum:["transfer_group"]},data:{allOf:[{$ref:"#/definitions/import_transfer_group_data"}]}},required:["target","data"],$typescript:'{"additionalProperties": false}'},import_transfer_extension:{type:"object",properties:{created_at:{type:"string",format:"date-time"},status_finalized_at:{type:"string",format:"date-time"}},$typescript:'{"additionalProperties": false}'},import_transfer_data:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Foreign of the token to transfer as",type:["string","integer"]},from_wallet:{description:"Foreign of the wallet to deposit to",type:["string","integer"]},to_wallet:{description:"Foreign of the wallet to deposit to",type:["string","integer"]},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},type:{type:"string",enum:["transfer"]},status:{description:"status of the transfer",enum:["pending","cancelled","finished"],default:"finished"},transfer_group:{description:"Id of the transfer_group this transfer is linked to",type:["string"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"},status_finalized_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/status_finalized_at"}},required:["from_wallet","to_wallet","amount"],$typescript:'{"additionalProperties": false}'},import_withdrawal_data:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Foreign of the token to transfer as",type:["string","integer"]},wallet:{description:"Foreign of the wallet to withdraw from",type:["string","integer"]},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},type:{type:"string",enum:["withdrawal"]},status:{description:"status of the transfer",enum:["pending","cancelled","finished"],default:"finished"},transfer_group:{description:"Id of the transfer_group this transfer is linked to",type:["string"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"},status_finalized_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/status_finalized_at"}},required:["wallet","amount","type"],$typescript:'{"additionalProperties": false}'},import_deposit_data:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Foreign of the token to transfer as",type:["string","integer"]},wallet:{description:"Foreign of the wallet to deposit to",type:["string","integer"]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},type:{type:"string",enum:["deposit"]},status:{description:"status of the transfer",enum:["pending","cancelled","finished"],default:"finished"},transfer_group:{description:"Id of the transfer_group this transfer is linked to",type:["string"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"},status_finalized_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/status_finalized_at"}},required:["wallet","amount","type"],$typescript:'{"additionalProperties": false}'},create_transfer_data_wild:{anyOf:[{$ref:"#/definitions/import_transfer_data"},{$ref:"#/definitions/import_withdrawal_data"},{$ref:"#/definitions/import_deposit_data"}]},import_transfer:{type:"object",properties:{target:{description:"Target of the action",type:"string",enum:["transfer"]},data:{allOf:[{$ref:"#/definitions/create_transfer_data_wild"}]}},required:["target","data"],$typescript:'{"additionalProperties": false}'},import_reverse_transfer_options:{type:"object",properties:{metadata_action:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action"}},$typescript:'{"additionalProperties": false}'},import_reverse_transfer_extension:{type:"object",properties:{options:{allOf:[{$ref:"#/definitions/import_reverse_transfer_options"}]}},$typescript:'{"additionalProperties": false}'},import_reverse_transfer_data:{allOf:[{$ref:"/fns/reverse-transfer/reverse-transfer.schema.input.json#/definitions/reverse_transfer_fn_input_data"},{$ref:"#/definitions/import_reverse_transfer_extension"}]},import_reverse_transfer:{type:"object",properties:{target:{description:"Target of the action",type:"string",enum:["reverse_transfer"]},data:{allOf:[{$ref:"#/definitions/import_reverse_transfer_data"}]}},required:["target","data"],$typescript:'{"additionalProperties": false}'},import_reverse_transfer_group_options:{type:"object",properties:{metadata_action:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action"},transfer_metadata_action:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action"}},$typescript:'{"additionalProperties": false}'},import_reverse_transfer_group_extension:{type:"object",properties:{options:{allOf:[{$ref:"#/definitions/import_reverse_transfer_group_options"}]}},$typescript:'{"additionalProperties": false}'},import_reverse_transfer_group_data:{allOf:[{$ref:"/fns/reverse-transfer-group/reverse-transfer-group.schema.input.json#/definitions/reverse_transfer_group_fn_input_data"},{$ref:"#/definitions/import_reverse_transfer_group_extension"}]},import_reverse_transfer_group:{type:"object",properties:{target:{description:"Target of the action",type:"string",enum:["reverse_transfer_group"]},data:{allOf:[{$ref:"#/definitions/import_reverse_transfer_group_data"}]}},required:["target","data"],$typescript:'{"additionalProperties": false}'}},JR="import_data_fn_stream_chunk",XR=!1,Ss={$schema:BR,$id:LR,title:VR,description:HR,type:zR,properties:KR,definitions:QR,$allowStreamInput:JR,additionalProperties:XR};var YR="http://json-schema.org/draft-07/schema",ZR="ImportDataFnOutput",eA="ImportDataFnOutput",tA="Output of import",rA="object",nA="/txs/import-actions/import-actions.schema.output.json",Wp={$schema:YR,$id:ZR,title:eA,description:tA,type:rA,$ref:nA};var aA="http://json-schema.org/draft-07/schema",sA="ReverseTransferFnInput",iA="ReverseTransferFnInput",oA="Input for reverseTransfer",pA=[{$ref:"#/definitions/reverse_transfer_fn_input_data"},{$ref:"#/definitions/reverse_transfer_fn_options_property"}],fA={reverse_transfer_fn_options:{allOf:[{$ref:"/txs/reverse-transfer/reverse-transfer.schema.input.json#/definitions/reverse_transfer_tx_options"}]},reverse_transfer_fn_options_property:{type:"object",properties:{options:{$ref:"#/definitions/reverse_transfer_fn_options"}},$typescript:'{"additionalProperties": false}'},reverse_transfer_fn_input_data:{type:"object",properties:{transfer:{description:"Transfer identifier",type:["string","integer"]},status:{description:"Status of the created transfer",$ref:"/db/transfer/transfer.schema.input.json#/properties/status"},identifier:{description:"Identifier for the created transfer",$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},force:{description:"Force create the reverse transfer ignoring balance",$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{description:"Metadata for the reversed transfers",$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},extend_metadata:{description:"Key value object to extend metadata with on created transfer",$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/metadata"}},required:["transfer"],$typescript:'{"additionalProperties": false}'}},uA='{"additionalProperties": false}',Ep={$schema:aA,$id:sA,title:iA,description:oA,allOf:pA,definitions:fA,$typescript:uA};var dA="http://json-schema.org/draft-07/schema",lA="ReverseTransferFnOutput",cA="ReverseTransferFnOutput",mA="Output of reverseTransfer",hA="/txs/reverse-transfer/reverse-transfer.schema.output.json",Rp={$schema:dA,$id:lA,title:cA,description:mA,$ref:hA};var gA="http://json-schema.org/draft-07/schema",_A="ReverseTransferGroupFnInput",TA="ReverseTransferGroupFnInput",yA="Input for reverseTransferGroup",bA=[{$ref:"#/definitions/reverse_transfer_group_fn_input_data"},{$ref:"#/definitions/reverse_transfer_group_fn_options_property"}],xA={reverse_transfer_group_fn_options:{allOf:[{$ref:"/txs/reverse-transfer-group/reverse-transfer-group.schema.input.json#/definitions/reverse_transfer_group_tx_options"}]},reverse_transfer_group_fn_options_property:{type:"object",properties:{options:{$ref:"#/definitions/reverse_transfer_group_fn_options"}},$typescript:'{"additionalProperties": false}'},reverse_transfer_group_fn_input_data:{type:"object",properties:{transfer_group:{description:"identifier of the transfer group to reverse",type:["string","number"]},status:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/status"},transfer_status:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/transfer_status"},identifier:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/identifier"},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/metadata"},transfer_metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},extend_metadata:{description:"Key value object to extend metadata with on created transfer",$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/metadata"},transfer_extend_metadata:{description:"Key value object to extend metadata with on created transfer",$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"}},required:["transfer_group"],$typescript:'{"additionalProperties": false}'}},FA='{"additionalProperties": false}',Ap={$schema:gA,$id:_A,title:TA,description:yA,allOf:bA,definitions:xA,$typescript:FA};var wA="http://json-schema.org/draft-07/schema",$A="ReverseTransferGroupFnOutput",OA="ReverseTransferGroupFnOutput",vA="Output of reverseTransferGroup",jA="/txs/reverse-transfer-group/reverse-transfer-group.schema.output.json",Up={$schema:wA,$id:$A,title:OA,description:vA,$ref:jA};var IA="http://json-schema.org/draft-07/schema",kA="ReverseTransfersFnInput",SA="ReverseTransfersFnInput",CA="Input for reverseTransfers",PA="object",GA={wallet:{description:"Foreign of the wallet connected to transfers",type:["string","integer"]},token:{description:"Foreign of the token transferred",type:["string","integer"]},from_wallet:{description:"Foreign of the wallet transfers are made from",type:["string","integer"]},to_wallet:{description:"Foreign of the wallet transfers are made to",type:["string","integer"]},transfer_group:{description:"Foreign of the transfer_group the transfers are a part of",type:["string","integer"]},status:{description:"Status of the transfers",$ref:"/db/transfer/transfer.schema.input.json#/properties/status"},metadata:{description:"Metadata filter",$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"},reverse:{$ref:"/txs/reverse-transfer-many/reverse-transfer-many.schema.input.json#/definitions/reverse_transfer_many_modifications"},options:{$ref:"#/definitions/reverse_transfers_fn_options"}},DA={reverse_transfers_fn_options:{description:"findTransfers function options",allOf:[{$ref:"/txs/reverse-transfer-many/reverse-transfer-many.schema.input.json#/definitions/reverse_transfer_many_tx_options"}]},reverse_transfers_fn_modifications:{description:"In case the transfer will be made then apply these modifications",allOf:[{$ref:"/txs/reverse-transfer-many/reverse-transfer-many.schema.input.json#/definitions/reverse_transfer_many_modifications"}]}},MA=!0,WA=!1,qp={$schema:IA,$id:kA,title:SA,description:CA,type:PA,properties:GA,definitions:DA,$reverseQueryBuilder:MA,additionalProperties:WA};var EA="http://json-schema.org/draft-07/schema",RA="ReverseTransfersFnOutput",AA="ReverseTransfersFnOutput",UA="Output of reverseTransfers",qA="object",NA="/txs/reverse-transfer-many/reverse-transfer-many.schema.output.json",Np={$schema:EA,$id:RA,title:AA,description:UA,type:qA,$ref:NA};var BA="http://json-schema.org/draft-07/schema",LA="SetFlagsFnInput",VA="SetFlagsFnInput",HA="Input for setFlags",zA=[{$ref:"#/definitions/set_flags_properties"}],KA={set_flags_fn_options:{allOf:[{$ref:"/txs/set-flags/set-flags.schema.input.json#/definitions/set_flags_tx_options"}]},set_flags_properties:{allOf:[{$ref:"/db/consts.schema.json#/definitions/Flags"},{$ref:"#/definitions/set_flags_options_property"}]},set_flags_options_property:{type:"object",properties:{options:{$ref:"#/definitions/set_flags_fn_options"}},$typescript:'{"additionalProperties": false}'}},QA='{"additionalProperties": false}',Bp={$schema:BA,$id:LA,title:VA,description:HA,allOf:zA,definitions:KA,$typescript:QA};var JA="http://json-schema.org/draft-07/schema",XA="SetFlagsFnOutput",YA="SetFlagsFnOutput",ZA="Output of setFlags",eU="/txs/set-flags/set-flags.schema.output.json",Lp={$schema:JA,$id:XA,title:YA,description:ZA,$ref:eU};var tU="http://json-schema.org/draft-07/schema",rU="UpdateTokenFnInput",nU="UpdateTokenFnInput",aU="Input for updateToken",sU="object",iU={token:{description:"Token foreign",type:["string","number"]},metadata:{$ref:"/db/token/token.schema.json#/properties/metadata"},public:{$ref:"/db/token/token.schema.json#/properties/public"},status:{$ref:"/db/token/token.schema.json#/properties/status"},options:{$ref:"#/definitions/update_token_fn_options"}},oU={update_token_fn_fields:{description:"Updateable fields",type:"object",allOf:[{$ref:"/txs/update-token/update-token.schema.input.json#/definitions/update_token_fields"}]},update_token_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/update-token/update-token.schema.input.json#/definitions/update_token_tx_options"}]}},pU=!1,fU=["token"],Vp={$schema:tU,$id:rU,title:nU,description:aU,type:sU,properties:iU,definitions:oU,additionalProperties:pU,required:fU};var uU="http://json-schema.org/draft-07/schema",dU="UpdateTokenFnOutput",lU="UpdateTokenFnOutput",cU="Output of updateToken",mU="object",hU="/txs/update-token/update-token.schema.output.json",Hp={$schema:uU,$id:dU,title:lU,description:cU,type:mU,$ref:hU};var gU="http://json-schema.org/draft-07/schema",_U="UpdateTransferFnInput",TU="UpdateTransferFnInput",yU="Input for updateTransfer",bU="object",xU={transfer:{description:"Transfer identifier",type:["string","integer"]},status:{description:"Status the transfer should be set to",enum:["finished","cancelled"]},metadata:{$ref:"/db/transfer/transfer.schema.json#/properties/metadata"},options:{$ref:"#/definitions/update_transfer_fn_options"}},FU={update_transfer_fn_options:{allOf:[{$ref:"/txs/update-transfer/update-transfer.schema.input.json#/definitions/update_transfer_tx_options"}]}},wU=!1,$U=["transfer"],zp={$schema:gU,$id:_U,title:TU,description:yU,type:bU,properties:xU,definitions:FU,additionalProperties:wU,required:$U};var OU="http://json-schema.org/draft-07/schema",vU="UpdateTransferFnOutput",jU="UpdateTransferFnOutput",IU="Output of updateTransfer",kU="object",SU="/txs/update-transfer/update-transfer.schema.output.json",Kp={$schema:OU,$id:vU,title:jU,description:IU,type:kU,$ref:SU};var CU="http://json-schema.org/draft-07/schema",PU="UpdateTransferGroupFnInput",GU="UpdateTransferGroupFnInput",DU="Input for updateTransferGroup",MU=[{$ref:"#/definitions/update_transfer_group_fn_status"},{$ref:"#/definitions/update_transfer_group_fn_transfer_status"}],WU={update_transfer_group_fn_options:{$comment:"Using allOf so that references dont break",type:"object",allOf:[{$ref:"/txs/update-transfer-group/update-transfer-group.schema.input.json#/definitions/update_transfer_group_tx_options"}]},update_transfer_group_fn_status:{type:"object",properties:{transfer_group:{description:"identifier of the transfer group to reverse",type:["string","number"]},status:{description:"Lifecycle status of the TransferGroup",$ref:"/db/consts.schema.json#/definitions/TransferGroupStatus"},transfer_status:{description:"Status all the transfers should be set at.",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},options:{$ref:"#/definitions/update_transfer_group_fn_options"}},required:["transfer_group","status"],$typescript:'{"additionalProperties": false}'},update_transfer_group_fn_transfer_status:{type:"object",properties:{transfer_group:{description:"identifier of the transfer group to reverse",type:["string","number"]},status:{description:"Lifecycle status of the TransferGroup",$ref:"/db/consts.schema.json#/definitions/TransferGroupStatus"},transfer_status:{description:"Status all the transfers should be set at.",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},options:{$ref:"#/definitions/update_transfer_group_fn_options"}},required:["transfer_group","transfer_status"],$typescript:'{"additionalProperties": false}'}},Qp={$schema:CU,$id:PU,title:GU,description:DU,anyOf:MU,definitions:WU};var EU="http://json-schema.org/draft-07/schema",RU="UpdateTransferGroupFnOutput",AU="UpdateTransferGroupFnOutput",UU="Output of updateTransferGroup",qU="object",NU="/txs/update-transfer-group/update-transfer-group.schema.output.json",Jp={$schema:EU,$id:RU,title:AU,description:UU,type:qU,$ref:NU};var BU="http://json-schema.org/draft-07/schema",LU="UpdateTransferGroupsFnInput",VU="UpdateTransferGroupsFnInput",HU="Input for updateTransferGroups",zU="object",KU={transfer_status:{description:"Status of the transfers",$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/transfer_status"},status:{description:"Status of the transfer_group",$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/status"},metadata:{description:"Metadata filter",$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"},reverses:{description:"Identifier of the transfer_group the transfer_group reverses",type:["string","integer"]},type:{description:"Type of the transfer group",$ref:"/db/consts.schema.json#/definitions/TransferGroupType"},update:{$ref:"#/definitions/update_transfer_groups_fn_update_fields"},options:{$ref:"#/definitions/update_transfer_groups_fn_options"}},QU={update_transfer_groups_fn_update_fields:{type:"object",allOf:[{$ref:"/txs/update-transfer-group/update-transfer-group.schema.input.json#/definitions/update_transfer_group_data"}]},update_transfer_groups_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/update-transfer-group/update-transfer-group.schema.input.json#/definitions/update_transfer_group_tx_options"}]}},JU=!0,XU=!1,Xp={$schema:BU,$id:LU,title:VU,description:HU,type:zU,properties:KU,definitions:QU,$updateQueryBuilder:JU,additionalProperties:XU};var YU="http://json-schema.org/draft-07/schema",ZU="UpdateTransferGroupsFnOutput",eq="UpdateTransferGroupsFnOutput",tq="Output of updateTransferGroups",rq="object",nq="/txs/update-transfer-group-many/update-transfer-group-many.schema.output.json",Yp={$schema:YU,$id:ZU,title:eq,description:tq,type:rq,$ref:nq};var aq="http://json-schema.org/draft-07/schema",sq="UpdateTransfersFnInput",iq="UpdateTransfersFnInput",oq="Input for updateTransfers",pq="object",fq={wallet:{description:"Foreign of the wallet connected to transfers",type:["string","integer"]},token:{description:"Foreign of the token transferred",type:["string","integer"]},from_wallet:{description:"Foreign of the wallet transfers are made from",type:["string","integer"]},to_wallet:{description:"Foreign of the wallet transfers are made to",type:["string","integer"]},transfer_group:{description:"Foreign of the transfer_group the transfers are a part of",type:["string","integer"]},status:{description:"Status of the transfers",$ref:"/db/transfer/transfer.schema.input.json#/properties/status"},metadata:{description:"Metadata filter",$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"},update:{$ref:"/txs/update-transfer/update-transfer.schema.input.json#/definitions/update_transfer_fields"},options:{$ref:"#/definitions/update_transfers_fn_options"}},uq={update_transfers_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/update-transfer-many/update-transfer-many.schema.input.json#/definitions/update_transfer_many_tx_options"}]},update_transfers_fn_update_fields:{type:"object",allOf:[{$ref:"/txs/update-transfer/update-transfer.schema.input.json#/definitions/update_transfer_fields"}]}},dq=!0,lq=!1,Zp={$schema:aq,$id:sq,title:iq,description:oq,type:pq,properties:fq,definitions:uq,$updateQueryBuilder:dq,additionalProperties:lq};var cq="http://json-schema.org/draft-07/schema",mq="UpdateTransfersFnOutput",hq="UpdateTransfersFnOutput",gq="Output of updateTransfers",_q="object",Tq="/txs/update-transfer-many/update-transfer-many.schema.output.json",ef={$schema:cq,$id:mq,title:hq,description:gq,type:_q,$ref:Tq};var yq="http://json-schema.org/draft-07/schema",bq="UpdateWalletFnInput",xq="UpdateWalletFnInput",Fq="Input for updateWallet",wq="object",$q={wallet:{description:"Wallet foreign",type:["string","integer"]},metadata:{$ref:"/db/wallet/wallet.schema.json#/properties/metadata"},name:{$ref:"/db/wallet/wallet.schema.input.json#/properties/name"},status:{$ref:"/db/wallet/wallet.schema.input.json#/properties/status"},options:{$ref:"#/definitions/update_wallet_fn_options"}},Oq={update_wallet_fn_fields:{description:"Updatable fields",type:"object",allOf:[{$ref:"/txs/update-wallet/update-wallet.schema.input.json#/definitions/update_wallet_fields"}]},update_wallet_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/update-wallet/update-wallet.schema.input.json#/definitions/update_wallet_tx_options"}]}},vq=!1,jq=["wallet"],tf={$schema:yq,$id:bq,title:xq,description:Fq,type:wq,properties:$q,definitions:Oq,additionalProperties:vq,required:jq};var Iq="http://json-schema.org/draft-07/schema",kq="UpdateWalletFnOutput",Sq="UpdateWalletFnOutput",Cq="Output of updateWallet",Pq="object",Gq="/txs/update-wallet/update-wallet.schema.output.json",rf={$schema:Iq,$id:kq,title:Sq,description:Cq,type:Pq,$ref:Gq};var Dq="http://json-schema.org/draft-07/schema",Mq="AggregateTransferManyTxInput",Wq="AggregateTransferManyTxInput",Eq="Input for aggregateTransferMany",Rq="object",Aq={transfer:{$ref:"/txs/find-transfer-many/find-transfer-many.schema.input.json#/definitions/find_transfer_many_filter"},aggregators:{description:"Array of aggregators to apply",type:"array",items:{$ref:"#/definitions/aggregate_transfer_many_aggregator"}},groups:{$ref:"#/definitions/aggregate_transfer_many_groups"},options:{$ref:"#/definitions/aggregate_transfer_many_tx_options"}},Uq={aggregate_transfer_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/aggregate_transfer_many_additional_options"}]},aggregate_transfer_many_additional_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags to aggregate data",type:"object",properties:{return_all_intervals:{description:"Add empty values for each interval if no matching data",type:"object",properties:{start_time:{type:"string"},end_time:{type:"string"}},additionalProperties:!1,required:["start_time","end_time"]}}},aggregate_transfer_many_groups:{type:"array",maxItems:5,items:{$ref:"#/definitions/aggregate_transfer_many_group"}},aggregate_transfer_many_group:{anyOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_group_period"},{$ref:"#/definitions/aggregate_transfer_many_group_field"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_group_metadata_field"}]},aggregate_transfer_many_group_field:{type:"object",properties:{type:{type:"string",enum:["field"]},field:{$ref:"#/definitions/aggregate_transfer_many_group_by_fields"},alias:{type:"string"}},required:["type","field"],additionalProperties:!1},aggregate_transfer_many_group_by_fields:{type:"string",enum:["type","status","from_wallet","to_wallet","wallet","token","transfer_group"]},aggregate_transfer_many_aggregator:{description:"Aggregator description",anyOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_aggregator_simple"},{$ref:"#/definitions/aggregate_transfer_many_aggregator_complex"}]},aggregate_transfer_many_aggregator_complex:{description:"Function and field to group",type:"object",properties:{function:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_aggregator_simple"},field:{description:"Field to group by",type:"string",enum:["from.amount","to.amount","amount","abs.amount","transfer_group","from_wallet","to_wallet","wallet","token","id"]},alias:{description:"Alias to group under",type:"string"}},$typescript:'{"additionalProperties":false}'}},qq=!1,nf={$schema:Dq,$id:Mq,title:Wq,description:Eq,type:Rq,properties:Aq,definitions:Uq,additionalProperties:qq};var Nq="http://json-schema.org/draft-07/schema",Bq="AggregateTransferManyTxOutput",Lq="AggregateTransferManyTxOutput",Vq="Output of aggregateTransferMany",Hq="object",zq={rows:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_aggregate_results"},metadata:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_aggregating_metadata"}},Kq=!1,af={$schema:Nq,$id:Bq,title:Lq,description:Vq,type:Hq,properties:zq,additionalProperties:Kq};var Qq="http://json-schema.org/draft-07/schema",Jq="AuthenticationCheckTxInput",Xq="AuthenticationCheckTxInput",Yq="Input for authenticationCheck",Zq="object",e1={options:{$ref:"#/definitions/authentication_check_tx_options"}},t1={authentication_check_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/authentication_check_additional_options"}]},authentication_check_additional_options:{description:"Optional flags for input",type:"object",default:{},$typescript:'{"additionalProperties":false}'}},r1=!1,sf={$schema:Qq,$id:Jq,title:Xq,description:Yq,type:Zq,properties:e1,definitions:t1,additionalProperties:r1};var n1="http://json-schema.org/draft-07/schema",a1="AuthenticationCheckTxOutput",s1="AuthenticationCheckTxOutput",i1="Output of authenticationCheck",o1="object",p1={},f1=!1,of={$schema:n1,$id:a1,title:s1,description:i1,type:o1,properties:p1,additionalProperties:f1};var u1="http://json-schema.org/draft-07/schema",d1="CreateAccessTokenTxInput",l1="CreateAccessTokenTxInput",c1="Input for createAccessToken",m1="object",h1={token:{anyOf:[{$ref:"#/definitions/create_access_token_limited"},{$ref:"#/definitions/create_access_token_admin"}]},options:{$ref:"#/definitions/create_access_token_tx_options"}},g1={create_access_token_limited:{type:"object",properties:{type:{enum:["limited"]},scopes:{type:"array",items:{type:"string",enum:["aggregateTransferMany","findBalanceMany","findTokenMany","findTransferGroupMany","findTransferMany","findWalletMany","getBalance","getBalanceHistory","getStatistics","getToken","getTokenMany","getTransfer","getTransferGroup","getWallet","getWalletMany"]}},filters:{description:"Forced filters for requests",type:"object",$ref:"#/definitions/create_access_token_forced_filters"},expiresIn:{description:"JWT expiration time in minutes",type:"number"},options:{$ref:"#/definitions/create_access_token_tx_options"}},required:["scopes","type","expiresIn"],additionalProperties:!1},create_access_token_admin:{type:"object",properties:{type:{enum:["admin"]},expiresIn:{description:"JWT expiration time in minutes",type:"number"},options:{$ref:"#/definitions/create_access_token_tx_options"}},required:["type","expiresIn"],additionalProperties:!1},create_access_token_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/create_access_token_additional_options"}]},create_access_token_additional_options:{description:"Optional flags for input",type:"object",default:{},$typescript:'{"additionalProperties":false}'},create_access_token_forced_filters:{type:"object",properties:{wallet_foreign:{type:"string"},from_wallet_foreign:{type:"string"},to_wallet_foreign:{type:"string"},token_foreign:{type:"string"}},additionalProperties:!1}},_1=!1,pf={$schema:u1,$id:d1,title:l1,description:c1,type:m1,properties:h1,definitions:g1,additionalProperties:_1};var T1="http://json-schema.org/draft-07/schema",y1="CreateAccessTokenTxOutput",b1="CreateAccessTokenTxOutput",x1="Output of createAccessToken",F1="object",w1={authToken:{type:"string"}},$1=["token"],O1=!1,ff={$schema:T1,$id:y1,title:b1,description:x1,type:F1,properties:w1,required:$1,additionalProperties:O1};var v1="http://json-schema.org/draft-07/schema",j1="CreateContractTxInput",I1="CreateContractTxInput",k1="Input for createContract",S1="object",C1={token:{allOf:[{$ref:"#/definitions/create_contract_token"}]},exchange:{allOf:[{$ref:"#/definitions/create_contract_exchange"}]},options:{$ref:"#/definitions/create_contract_tx_options"}},P1={create_contract_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/create_contract_additional_options"}]},create_contract_additional_options:{description:"Optional flags for input",type:"object",default:{},$typescript:'{"additionalProperties":false}'},create_contract_token:{type:"object",properties:{foreign:{allOf:[{$ref:"/db/token/token.schema.input.json#/properties/foreign"}]},metadata:{allOf:[{$ref:"/db/token/token.schema.input.json#/properties/metadata"}]},deposits:{allOf:[{$ref:"#/definitions/create_contract_deposits"}]},owner:{description:"The inital owner of the contract, defaults to foreign = 'house'",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}},additionalProperties:!1,required:["foreign","deposits"]},create_contract_deposit:{type:"object",properties:{token:{description:"Token that is moved",allOf:[{$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"}]},amount:{allOf:[{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"}]}},additionalProperties:!1,required:["token","amount"]},create_contract_deposits:{type:"array",items:{allOf:[{$ref:"#/definitions/create_contract_deposit"}]},minItems:1},create_contract_exchange:{type:"object",properties:{from_wallet:{description:"Wallet the contract will belong to at the end (buyer)",allOf:[{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}]},from_latest_control_hash:{description:"Latest control_hash on the from_wallet+from_token combo",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},from_token:{description:"Token that is transferred from from_wallet in exchange of the contract",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},to_wallet:{description:"Wallet the payment for the contract is sent to (seller)",allOf:[{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}]},amount:{allOf:[{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"}]},status:{description:"The state at which the exchange is created",type:"string",enum:["pending","finished"]},force:{allOf:[{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"}]},metadata:{allOf:[{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"}]}},additionalProperties:!1,required:["from_wallet","amount"]}},G1=["token"],D1=!1,uf={$schema:v1,$id:j1,title:I1,description:k1,type:S1,properties:C1,definitions:P1,required:G1,additionalProperties:D1};var M1="http://json-schema.org/draft-07/schema",W1="CreateContractTxOutput",E1="CreateContractTxOutput",R1="Output of createContract",A1="object",U1={token:{$ref:"/db/token/token.schema.json"},exchange:{description:"Created exchange for the Contract",allOf:[{$ref:"/txs/create-transfer-group/create-transfer-group.schema.output.json"}]}},q1=["token"],N1=!1,df={$schema:M1,$id:W1,title:E1,description:R1,type:A1,properties:U1,required:q1,additionalProperties:N1};var B1="http://json-schema.org/draft-07/schema",L1="CreateDepositTxInput",V1="CreateDepositTxInput",H1="Input for createDeposit",z1="object",K1={deposit:{$ref:"/txs/create-transfer/create-transfer.schema.input.json#/definitions/transfer_data_deposit"},options:{$ref:"#/definitions/create_deposit_tx_options"}},Q1={create_deposit_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"/txs/create-transfer/create-transfer.schema.input.json#/definitions/create_transfer_additional_options"}]}},J1=!1,X1=["deposit"],lf={$schema:B1,$id:L1,title:V1,description:H1,type:z1,properties:K1,definitions:Q1,additionalProperties:J1,required:X1};var Y1="http://json-schema.org/draft-07/schema",Z1="CreateDepositTxOutput",eN="CreateDepositTxOutput",tN="The transfer of funds and optionally the destination wallet balance",rN=[{$ref:"/txs/create-transfer/create-transfer.schema.output.json"}],cf={$schema:Y1,$id:Z1,title:eN,description:tN,allOf:rN};var nN="http://json-schema.org/draft-07/schema",aN="CreateDistributionTxInput",sN="CreateDistributionTxInput",iN="Input for createDistribution",oN="object",pN={distribution:{$ref:"#/definitions/distribution"},options:{$ref:"#/definitions/create_distribution_tx_options"}},fN={create_distribution_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/create_distribution_additional_options"}]},create_distribution_additional_options:{description:"Optional flags for input",type:"object",default:{dryrun:!1},properties:{dryrun:{type:"boolean",default:!1}},$typescript:'{"additionalProperties":false}'},leftover_target:{type:"object",properties:{rule:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_distributor_leftover_rule"}]},target:{type:"object",properties:{wallet:{allOf:[{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}]},metadata:{allOf:[{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"}]}},required:["wallet"],additionalProperties:!1}},required:["rule"],additionalProperties:!1},distribution:{description:"Distribute funds from one wallet between multiple wallets",type:"object",properties:{identifier:{description:"Unique identifier for this distribution",type:"string"},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},from_wallet:{description:"Wallet where funds are debited",allOf:[{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}]},token:{description:"Token that is moved",allOf:[{$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"}]},amount:{allOf:[{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"}]},status:{allOf:[{$ref:"/db/transfer/transfer.schema.input.json#/properties/status"}]},force:{allOf:[{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"}]},metadata:{allOf:[{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"}]},copy_wallet_metadata_fields:{description:"Copy metadata information from Wallet metadata to transfer metadata",type:"array",items:{$ref:"#/definitions/copy_metadata_field"}},transfer_group:{description:"TransferGroup the transfer belongs to",allOf:[{$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"}]},targets:{anyOf:[{$ref:"#/definitions/target_wallets"},{$ref:"#/definitions/target_token"}]},leftover:{allOf:[{$ref:"#/definitions/leftover_target"}]}},required:["identifier","from_wallet","token","amount","targets","leftover"],additionalProperties:!1},copy_metadata_field:{description:"Copy metadata info from property to property",type:"object",properties:{from_property:{type:"string"},to_property:{type:"string"}},required:["from_property"],additionalProperties:!1},target_token:{description:"Wallets will receive funds based on their balance of this token",allOf:[{$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"}]},target_wallet:{type:"object",properties:{wallet:{description:"Wallet where funds are credited",allOf:[{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}]},portion:{description:"Number specifying the portion of funds to be credited",type:["string","number"]},metadata:{allOf:[{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"}]}},required:["wallet"],additionalProperties:!1},target_wallets:{type:"array",items:{$ref:"#/definitions/target_wallet"},minItems:1}},uN=["distribution"],dN=!1,mf={$schema:nN,$id:aN,title:sN,description:iN,type:oN,properties:pN,definitions:fN,required:uN,additionalProperties:dN};var lN="http://json-schema.org/draft-07/schema",cN="CreateDistributionTxOutput",mN="CreateDistributionTxOutput",hN="Output of createDistribution",gN="object",_N={transfer_group:{description:"Created distribution transfer group",allOf:[{$ref:"/db/transfer-group/transfer-group.schema.json"}]},transfers:{description:"Created transfers",type:"array",items:{$ref:"/db/transfer/transfer.schema.json"}}},TN=["transfer_group","transfers"],yN=!1,hf={$schema:lN,$id:cN,title:mN,description:hN,type:gN,properties:_N,required:TN,additionalProperties:yN};var bN="http://json-schema.org/draft-07/schema",xN="CreateTokenTxInput",FN="CreateTokenTxInput",wN="Input for createToken function",$N="object",ON={token:{$ref:"#/definitions/create_token_input"},options:{$ref:"#/definitions/create_token_tx_options"}},vN={create_token_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"}]},create_token_input:{type:"object",properties:{foreign:{$ref:"/db/token/token.schema.json#/properties/foreign"},public:{$ref:"/db/token/token.schema.json#/properties/public"},metadata:{$ref:"/db/token/token.schema.json#/properties/metadata"},divisor:{$ref:"/db/token/token.schema.json#/properties/divisor"},limit:{$ref:"/db/token/token.schema.json#/properties/limit"},type:{$ref:"/db/token/token.schema.json#/properties/type"},belongs_to:{description:"Wallet this token belongs_to",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}},additionalProperties:!1,required:["foreign"]}},jN=["token"],IN=!1,gf={$schema:bN,$id:xN,title:FN,description:wN,type:$N,properties:ON,definitions:vN,required:jN,additionalProperties:IN};var kN="http://json-schema.org/draft-07/schema",SN="CreateTokenTxOutput",CN="CreateTokenTxOutput",PN="The created token and respective wallet",GN="object",DN={token:{$ref:"/db/token/token.schema.json"},wallet:{$ref:"/db/wallet/wallet.schema.json"}},MN=!1,WN=["token","wallet"],_f={$schema:kN,$id:SN,title:CN,description:PN,type:GN,properties:DN,additionalProperties:MN,required:WN};var EN="http://json-schema.org/draft-07/schema",RN="CreateTransferTxInput",AN="CreateTransferTxInput",UN="Input for createTransfer",qN="object",NN={transfer:{$ref:"#/definitions/transfer_data"},options:{$ref:"#/definitions/create_transfer_tx_options"}},BN={create_transfer_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/create_transfer_additional_options"}]},create_transfer_additional_options:{description:"Additional flags to determine the return",type:"object",default:{},properties:{return_from_balance:{$id:"return_from_balance",description:"Whether the request should also return from wallet balance",type:"boolean",default:!1},return_to_balance:{$id:"return_to_balance",description:"Whether the request should also return to wallet balance",type:"boolean",default:!1},create_to_wallet_if_not_exists:{type:"boolean",description:"If true then the wallet will be created if not found. Only valid with 'foreign'",default:!1}},$typescript:'{"additionalProperties": false}'},transfer_data:{anyOf:[{$ref:"#/definitions/transfer_data_regular"},{$ref:"#/definitions/transfer_data_deposit"},{$ref:"#/definitions/transfer_data_withdrawal"}]},transfer_data_regular:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},from_wallet:{description:"Wallet where funds are debited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_wallet:{description:"Wallet where funds are credited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{description:"Token that is moved",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},amount:{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},type:{description:"Type of transfer",enum:["transfer"]},status:{$ref:"/db/transfer/transfer.schema.input.json#/properties/status"},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},transfer_group:{description:"TransferGroup the transfer belongs to",$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["from_wallet","to_wallet","token","amount","type"],$typescript:'{"additionalProperties": false}'},transfer_data_deposit:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},from_wallet:{description:"Wallet where funds are debited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_wallet:{description:"Wallet where funds are credited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{description:"Token that is moved",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},amount:{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},type:{description:"Type of transfer",enum:["deposit"]},status:{$ref:"/db/transfer/transfer.schema.input.json#/properties/status"},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},transfer_group:{description:"TransferGroup the transfer belongs to",$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["to_wallet","token","amount"],$typescript:'{"additionalProperties": false}'},transfer_data_withdrawal:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},from_wallet:{description:"Wallet where funds are debited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_wallet:{description:"Wallet where funds are credited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{description:"Token that is moved",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},amount:{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},type:{description:"Type of transfer",enum:["withdrawal"]},status:{$ref:"/db/transfer/transfer.schema.input.json#/properties/status"},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},transfer_group:{description:"TransferGroup the transfer belongs to",$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["from_wallet","token","amount"],$typescript:'{"additionalProperties": false}'}},LN=["transfer"],VN=!1,Tf={$schema:EN,$id:RN,title:AN,description:UN,type:qN,properties:NN,definitions:BN,required:LN,additionalProperties:VN};var HN="http://json-schema.org/draft-07/schema",zN="CreateTransferTxOutput",KN="CreateTransferTxOutput",QN="Output of createTransfer",JN="object",XN={transfer:{description:"Created transfer object",$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"},from_balance:{description:"Debited wallet balance",$ref:"/txs/get-balance/get-balance.schema.output.json#/definitions/balance"},to_balance:{description:"Credited wallet balance",$ref:"/txs/get-balance/get-balance.schema.output.json#/definitions/balance"}},YN=!1,ZN=["transfer"],yf={$schema:HN,$id:zN,title:KN,description:QN,type:JN,properties:XN,additionalProperties:YN,required:ZN};var eB="http://json-schema.org/draft-07/schema",tB="CreateTransferGroupTxInput",rB="CreateTransferGroupTxInput",nB="Input for createTransferGroup",aB="object",sB={transfer_group:{$ref:"#/definitions/transfer_group_data"},options:{$ref:"#/definitions/create_transfer_group_tx_options"}},iB={create_transfer_group_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/create_transfer_group_additional_options"}]},create_transfer_group_additional_options:{description:"Optional flags for input",type:"object",default:{},properties:{create_to_wallet_if_not_exists:{type:"boolean",description:"If true then the wallet will be created if not found. Only valid with 'foreign'",default:!1},validate_final_balance_only:{type:"boolean",description:"If true then transfers within a group will ignore balance restrictions. Only final transfers for wallets are checked. Only valid with transfer_status_lock",default:!1}},$typescript:'{"additionalProperties": false}'},transfer_group_data:{type:"object",description:"Input for the transferGroup to create",properties:{identifier:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/identifier"},status:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/status"},transfer_status:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/transfer_status"},metadata:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/metadata"},children:{description:"Array of children",type:"array",items:{$ref:"#/definitions/child_transfer_data"}}},additionalProperties:!1},child_transfer_data:{anyOf:[{$ref:"#/definitions/child_transfer_data_regular"},{$ref:"#/definitions/child_transfer_data_deposit"},{$ref:"#/definitions/child_transfer_data_withdrawal"}]},child_transfer_data_regular:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},from_wallet:{description:"Wallet where funds are debited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_wallet:{description:"Wallet where funds are credited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{description:"Token that is moved",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},amount:{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},type:{description:"Type of transfer",enum:["transfer"]},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["from_wallet","to_wallet","token","amount","type"],$typescript:'{"additionalProperties": false}'},child_transfer_data_deposit:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},from_wallet:{description:"Wallet where funds are debited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_wallet:{description:"Wallet where funds are credited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{description:"Token that is moved",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},amount:{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},type:{description:"Type of transfer",enum:["deposit"]},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["to_wallet","token","amount"],$typescript:'{"additionalProperties": false}'},child_transfer_data_withdrawal:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},from_wallet:{description:"Wallet where funds are debited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_wallet:{description:"Wallet where funds are credited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{description:"Token that is moved",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},amount:{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},type:{description:"Type of transfer",enum:["withdrawal"]},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["from_wallet","token","amount"],$typescript:'{"additionalProperties": false}'}},oB=[],pB=!1,bf={$schema:eB,$id:tB,title:rB,description:nB,type:aB,properties:sB,definitions:iB,required:oB,additionalProperties:pB};var fB="http://json-schema.org/draft-07/schema",uB="CreateTransferGroupTxOutput",dB="CreateTransferGroupTxOutput",lB="Output of createTransferGroup",cB="object",mB={transfer_group:{$ref:"/db/transfer-group/transfer-group.schema.json"},transfers:{description:"Created transfer objects",type:"array",items:{$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"}}},hB=["transfer_group"],gB=!1,xf={$schema:fB,$id:uB,title:dB,description:lB,type:cB,properties:mB,required:hB,additionalProperties:gB};var _B="http://json-schema.org/draft-07/schema",TB="CreateTransferManyTxInput",yB="CreateTransferManyTxInput",bB="Input for CreateTransferMany",xB="object",FB={transfers:{description:"An array of transfers",type:"array",items:{$ref:"/txs/create-transfer/create-transfer.schema.input.json#/definitions/transfer_data"}},options:{$ref:"#/definitions/create_transfer_many_tx_options"}},wB={create_transfer_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/create_transfer_many_additional_options"}]},create_transfer_many_additional_options:{description:"Optional flags for input",type:"object",default:{},properties:{return_from_balance:{$id:"return_from_balance",description:"Whether the request should also return from wallet balance",type:"boolean",default:!1},return_to_balance:{$id:"return_to_balance",description:"Whether the request should also return to wallet balance",type:"boolean",default:!1},create_to_wallet_if_not_exists:{type:"boolean",description:"If true then the wallet will be created if not found. Only valid with 'foreign'",default:!1}},$typescript:'{"additionalProperties": false}'}},$B=["transfers"],OB=!1,Ff={$schema:_B,$id:TB,title:yB,description:bB,type:xB,properties:FB,definitions:wB,required:$B,additionalProperties:OB};var vB="http://json-schema.org/draft-07/schema",jB="CreateTransferManyTxOutput",IB="CreateTransferManyTxOutput",kB="Output of CreateTransferMany",SB="object",CB={transfers:{description:"Created transfer objects",type:"array",items:{$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"}},from_balances:{description:"Debited wallet balances",type:"array",items:{$ref:"/txs/get-balance/get-balance.schema.output.json#/definitions/balance"}},to_balances:{description:"Credited wallet balances",type:"array",items:{$ref:"/txs/get-balance/get-balance.schema.output.json#/definitions/balance"}}},PB=["transfers"],GB=!1,wf={$schema:vB,$id:jB,title:IB,description:kB,type:SB,properties:CB,required:PB,additionalProperties:GB};var DB="http://json-schema.org/draft-07/schema",MB="CreateWalletTxInput",WB="CreateWalletTxInput",EB="Input for createWallet",RB="object",AB={wallet:{$ref:"/db/wallet/wallet.schema.input.json"},options:{$ref:"#/definitions/create_wallet_tx_options"}},UB={create_wallet_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"}]}},qB=!1,NB=["wallet"],$f={$schema:DB,$id:MB,title:WB,description:EB,type:RB,properties:AB,definitions:UB,additionalProperties:qB,required:NB};var BB="http://json-schema.org/draft-07/schema",LB="CreateWalletTxOutput",VB="CreateWalletTxOutput",HB="The created wallet",zB="object",KB={wallet:{$ref:"/db/wallet/wallet.schema.json"}},QB=!1,JB=["wallet"],Of={$schema:BB,$id:LB,title:VB,description:HB,type:zB,properties:KB,additionalProperties:QB,required:JB};var XB="http://json-schema.org/draft-07/schema",YB="CreateWithdrawalTxInput",ZB="CreateWithdrawalTxInput",eL="Input for createWithdrawal",tL="object",rL={withdrawal:{$ref:"/txs/create-transfer/create-transfer.schema.input.json#/definitions/transfer_data_withdrawal"},options:{$ref:"#/definitions/create_withdrawal_tx_options"}},nL={create_withdrawal_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"/txs/create-transfer/create-transfer.schema.input.json#/definitions/create_transfer_additional_options"}]}},aL=["withdrawal"],sL=!1,vf={$schema:XB,$id:YB,title:ZB,description:eL,type:tL,properties:rL,definitions:nL,required:aL,additionalProperties:sL};var iL="http://json-schema.org/draft-07/schema",oL="CreateWithdrawalTxOutput",pL="CreateWithdrawalTxOutput",fL="Output of createWithdrawal",uL=[{$ref:"/txs/create-transfer/create-transfer.schema.output.json"}],jf={$schema:iL,$id:oL,title:pL,description:fL,allOf:uL};var dL="http://json-schema.org/draft-07/schema",lL="ExportDatabaseTxInput",cL="ExportDatabaseTxInput",mL="Input for exportDatabase",hL="object",gL={export_name:{description:"Name of the created export file",type:"string"}},_L={},TL=!1,If={$schema:dL,$id:lL,title:cL,description:mL,type:hL,properties:gL,definitions:_L,additionalProperties:TL};var yL="http://json-schema.org/draft-07/schema",bL="ExportDatabaseTxOutput",xL="ExportDatabaseTxOutput",FL="Output of exportDatabase",wL="object",$L={message:{type:"string"}},OL=!1,kf={$schema:yL,$id:bL,title:xL,description:FL,type:wL,properties:$L,additionalProperties:OL};var vL="http://json-schema.org/draft-07/schema",jL="FindBalanceManyTxInput",IL="FindBalanceManyTxInput",kL="Input for findBalanceMany",SL="object",CL={balance:{$ref:"#/definitions/find_balance_many_filter"},options:{$ref:"#/definitions/find_balance_many_tx_options"}},PL={find_balance_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"#/definitions/find_balance_many_ordering_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/find_balance_many_additional_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_select_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_deselect_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_options"}]},find_balance_many_additional_options:{description:"Optional flags for input",type:"object",default:{},$typescript:'{"additionalProperties":false}'},find_balance_many_ordering_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags for input ordering",type:"object",properties:{order:{description:"Ordering options",type:"array",items:{$ref:"#/definitions/find_balance_many_ordering_input"}}}},find_balance_many_ordering_input:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_ordering_input"},{$ref:"#/definitions/find_balance_many_ordering_input_field"}]},find_balance_many_ordering_input_field:{type:"object",properties:{field:{$ref:"/db/transfer-log/transfer-log.schema.json#/definitions/TransferLogTableFields"}},$typescript:'{"additionalProperties": false}'},balance_filter_foreign_fields:{type:"string",enum:["wallet","token"]},advanced_balance_filter_fields_foreign:{type:"object",properties:{field:{$ref:"#/definitions/balance_filter_foreign_fields"}},required:["field"],$typescript:'{"additionalProperties": false}'},balance_filter:{type:"object",properties:{wallet:{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},transfer:{$ref:"/txs/get-transfer/get-transfer.schema.input.json#/definitions/unique_transfer_filter"},type:{$ref:"/db/transfer-log/transfer-log.schema.json#/properties/type"},amount:{$ref:"/db/transfer-log/transfer-log.schema.json#/properties/amount"},pending_amount:{$ref:"/db/transfer-log/transfer-log.schema.json#/properties/pending_amount"},finished_amount:{$ref:"/db/transfer-log/transfer-log.schema.json#/properties/finished_amount"},status:{$ref:"/db/transfer-log/transfer-log.schema.json#/properties/status"},metadata:{$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"}},$typescript:'{"additionalProperties": false}'},advanced_balance_filter_inner:{type:"object",properties:{inner:{type:"array",items:{$ref:"#/definitions/advanced_balance_filter"}}},$typescript:'{"additionalProperties":false}'},advanced_balance_filter_where_inner:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereInner"},{$ref:"#/definitions/advanced_balance_filter_inner"}]},advanced_balance_filter_where_primitive:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWherePrimitive"},{$ref:"#/definitions/advanced_balance_filter_fields"}]},advanced_balance_filter_where_primitive_foreign:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWherePrimitiveForeign"},{$ref:"#/definitions/advanced_balance_filter_fields_foreign"}]},advanced_balance_filter_where_object:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereObject"},{$ref:"#/definitions/advanced_balance_filter_values"}]},advanced_balance_filter_where_in:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereIns"},{$ref:"#/definitions/advanced_balance_filter_fields_w_foreign"}]},advanced_balance_filter_where_null:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereNulls"},{$ref:"#/definitions/advanced_balance_filter_fields"}]},advanced_balance_filter_fields:{type:"object",properties:{field:{type:"string",enum:["type","amount","pending_amount","finished_amount","status","metadata","updated_at"]}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_balance_filter_fields_w_foreign:{type:"object",properties:{field:{anyOf:[{$ref:"/db/transfer-log/transfer-log.schema.json#/definitions/TransferLogTableFields"},{$ref:"#/definitions/balance_filter_foreign_fields"}]}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_balance_filter_values:{type:"object",properties:{value:{$ref:"#/definitions/balance_filter"}},required:["value"],$typescript:'{"additionalProperties": false}'},advanced_balance_filter:{anyOf:[{$ref:"#/definitions/advanced_balance_filter_where_inner"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataIns"},{$ref:"#/definitions/advanced_balance_filter_where_object"},{$ref:"#/definitions/advanced_balance_filter_where_primitive"},{$ref:"#/definitions/advanced_balance_filter_where_primitive_foreign"},{$ref:"#/definitions/advanced_balance_filter_where_in"},{$ref:"#/definitions/advanced_balance_filter_where_null"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataNulls"}]},advanced_balance_filter_array:{type:"array",items:{$ref:"#/definitions/advanced_balance_filter"}},find_balance_many_filter:{oneOf:[{$ref:"#/definitions/balance_filter"},{$ref:"#/definitions/advanced_balance_filter_array"}]}},GL=!1,Sf={$schema:vL,$id:jL,title:IL,description:kL,type:SL,properties:CL,definitions:PL,additionalProperties:GL};var DL="http://json-schema.org/draft-07/schema",ML="FindBalanceManyTxOutput",WL="FindBalanceManyTxOutput",EL="Output of findBalanceMany",RL="object",AL={balances:{description:"Found balances",type:"array",items:{$ref:"/txs/get-balance/get-balance.schema.output.json#/definitions/balance"}},metadata:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_find_metadata"}},UL=["balances","metadata"],qL=!1,Cf={$schema:DL,$id:ML,title:WL,description:EL,type:RL,properties:AL,required:UL,additionalProperties:qL};var NL="http://json-schema.org/draft-07/schema",BL="FindTokenManyTxInput",LL="FindTokenManyTxInput",VL="Input for findTokenMany",HL="object",zL={token:{$ref:"#/definitions/find_token_many_filter"},options:{$ref:"#/definitions/find_token_many_tx_options"}},KL={find_token_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"#/definitions/find_token_many_ordering_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/find_token_many_additional_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_select_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_deselect_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_options"}]},find_token_many_additional_options:{description:"Optional flags for input",type:"object",default:{},$typescript:'{"additionalProperties":false}'},find_token_many_ordering_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags for input ordering",type:"object",properties:{order:{description:"Ordering options",type:"array",items:{$ref:"#/definitions/find_token_many_ordering_input"}}}},find_token_many_ordering_input:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_ordering_input"},{$ref:"#/definitions/find_token_many_ordering_input_field"}]},find_token_many_ordering_input_field:{type:"object",properties:{field:{$ref:"/db/token/token.schema.json#/definitions/TokenTableFields"}},$typescript:'{"additionalProperties": false}'},token_filter_foreign_fields:{type:"string",enum:["belongs_to"]},token_filter:{type:"object",properties:{foreign:{description:"Foreign of token to return",$ref:"/db/token/token.schema.json#/properties/foreign"},type:{$ref:"/db/token/token.schema.json#/properties/type"},metadata:{$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"},belongs_to:{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}},$typescript:'{"additionalProperties": false}'},advanced_token_filter_inner:{type:"object",properties:{inner:{type:"array",items:{$ref:"#/definitions/advanced_token_filter"}}},$typescript:'{"additionalProperties":false}'},advanced_token_filter_where_inner:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereInner"},{$ref:"#/definitions/advanced_token_filter_inner"}]},advanced_token_filter_where_primitive:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWherePrimitive"},{$ref:"#/definitions/advanced_token_filter_fields"}]},advanced_token_filter_where_primitive_foreign:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWherePrimitiveForeign"},{$ref:"#/definitions/advanced_token_filter_fields_foreign"}]},advanced_token_filter_where_object:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereObject"},{$ref:"#/definitions/advanced_token_filter_values"}]},advanced_token_filter_where_in:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereIns"},{$ref:"#/definitions/advanced_token_filter_fields_w_foreign"}]},advanced_token_filter_where_null:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereNulls"},{$ref:"#/definitions/advanced_token_filter_fields"}]},advanced_token_filter_fields:{type:"object",properties:{field:{$ref:"/db/token/token.schema.json#/definitions/TokenTableFields"}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_token_filter_fields_foreign:{type:"object",properties:{field:{$ref:"#/definitions/token_filter_foreign_fields"}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_token_filter_fields_w_foreign:{type:"object",properties:{field:{anyOf:[{$ref:"/db/token/token.schema.json#/definitions/TokenTableFields"},{$ref:"#/definitions/token_filter_foreign_fields"}]}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_token_filter_values:{type:"object",properties:{value:{$ref:"#/definitions/token_filter"}},required:["value"],$typescript:'{"additionalProperties": false}'},advanced_token_filter:{anyOf:[{$ref:"#/definitions/advanced_token_filter_where_inner"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataIns"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataPrimitive"},{$ref:"#/definitions/advanced_token_filter_where_object"},{$ref:"#/definitions/advanced_token_filter_where_primitive"},{$ref:"#/definitions/advanced_token_filter_where_primitive_foreign"},{$ref:"#/definitions/advanced_token_filter_where_in"},{$ref:"#/definitions/advanced_token_filter_where_null"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataNulls"}]},advanced_token_filter_array:{type:"array",items:{$ref:"#/definitions/advanced_token_filter"}},find_token_many_filter:{oneOf:[{$ref:"#/definitions/token_filter"},{$ref:"#/definitions/advanced_token_filter_array"}]}},QL=!1,Pf={$schema:NL,$id:BL,title:LL,description:VL,type:HL,properties:zL,definitions:KL,additionalProperties:QL};var JL="http://json-schema.org/draft-07/schema",XL="FindTokenManyTxOutput",YL="FindTokenManyTxOutput",ZL="Output of findTokenMany",eV="object",tV={tokens:{description:"Found tokens",type:"array",items:{$ref:"/txs/get-token/get-token.schema.output.json#/definitions/token"}},metadata:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_find_metadata"}},rV=["tokens","metadata"],nV=!1,Gf={$schema:JL,$id:XL,title:YL,description:ZL,type:eV,properties:tV,required:rV,additionalProperties:nV};var aV="http://json-schema.org/draft-07/schema",sV="FindTransferGroupManyTxInput",iV="FindTransferGroupManyTxInput",oV="Input for findTransferGroupMany",pV="object",fV={transfer_group:{$ref:"#/definitions/find_transfer_group_many_filter"},options:{$ref:"#/definitions/find_transfer_group_many_tx_options"}},uV={find_transfer_group_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"#/definitions/find_transfer_group_many_ordering_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/find_transfer_group_many_additional_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_select_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_deselect_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_options"}]},find_transfer_group_many_additional_options:{$typescript:'{"additionalProperties":false}',type:"object",properties:{return_transfers:{description:"Return running balance for each transfer_group for wallet in question",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}}},find_transfer_group_many_ordering_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags for input ordering",type:"object",properties:{order:{description:"Ordering options",type:"array",items:{$ref:"#/definitions/find_transfer_group_many_ordering_input"}}}},find_transfer_group_many_ordering_input:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_ordering_input"},{$ref:"#/definitions/find_transfer_group_many_ordering_input_field"}]},find_transfer_group_many_ordering_input_field:{type:"object",properties:{field:{$ref:"/db/transfer-group/transfer-group.schema.json#/definitions/TransferGroupTableFields"}},$typescript:'{"additionalProperties": false}'},transfer_group_filter_identifier_fields:{type:"string",enum:["transfer_group","reverses"]},advanced_transfer_group_filter_fields_identifier:{type:"object",properties:{field:{$ref:"#/definitions/transfer_group_filter_identifier_fields"}},required:["field"],$typescript:'{"additionalProperties": false}'},transfer_group_filter:{type:"object",properties:{identifier:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/identifier"},status:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/status"},type:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/type"},transfer_status:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/transfer_status"},reverses:{$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"},metadata:{$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"}},$typescript:'{"additionalProperties": false}'},advanced_transfer_group_filter_inner:{type:"object",properties:{inner:{type:"array",items:{$ref:"#/definitions/advanced_transfer_group_filter"}}},$typescript:'{"additionalProperties":false}'},advanced_transfer_group_filter_where_inner:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereInner"},{$ref:"#/definitions/advanced_transfer_group_filter_inner"}]},advanced_transfer_group_filter_where_primitive:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWherePrimitive"},{$ref:"#/definitions/advanced_transfer_group_filter_fields"}]},advanced_transfer_group_filter_where_primitive_identifier:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWherePrimitiveIdentifier"},{$ref:"#/definitions/advanced_transfer_group_filter_fields_identifier"}]},advanced_transfer_group_filter_where_object:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereObject"},{$ref:"#/definitions/advanced_transfer_group_filter_values"}]},advanced_transfer_group_filter_where_in:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereIns"},{$ref:"#/definitions/advanced_transfer_group_filter_fields_w_foreign"}]},advanced_transfer_group_filter_where_null:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereNulls"},{$ref:"#/definitions/advanced_transfer_group_filter_fields"}]},advanced_transfer_group_filter_fields:{type:"object",properties:{field:{$ref:"/db/transfer-group/transfer-group.schema.json#/definitions/TransferGroupTableFields"}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_transfer_group_filter_fields_w_foreign:{type:"object",properties:{field:{anyOf:[{$ref:"/db/transfer-group/transfer-group.schema.json#/definitions/TransferGroupTableFields"},{$ref:"#/definitions/transfer_group_filter_identifier_fields"}]}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_transfer_group_filter_values:{type:"object",properties:{value:{$ref:"#/definitions/transfer_group_filter"}},required:["value"],$typescript:'{"additionalProperties": false}'},advanced_transfer_group_filter:{anyOf:[{$ref:"#/definitions/advanced_transfer_group_filter_where_inner"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataIns"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataPrimitive"},{$ref:"#/definitions/advanced_transfer_group_filter_where_object"},{$ref:"#/definitions/advanced_transfer_group_filter_where_primitive"},{$ref:"#/definitions/advanced_transfer_group_filter_where_primitive_identifier"},{$ref:"#/definitions/advanced_transfer_group_filter_where_in"},{$ref:"#/definitions/advanced_transfer_group_filter_where_null"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataNulls"}]},advanced_transfer_group_filter_array:{type:"array",items:{$ref:"#/definitions/advanced_transfer_group_filter"}},find_transfer_group_many_filter:{oneOf:[{$ref:"#/definitions/transfer_group_filter"},{$ref:"#/definitions/advanced_transfer_group_filter_array"}]}},dV=["transfer_group"],lV=!1,Df={$schema:aV,$id:sV,title:iV,description:oV,type:pV,properties:fV,definitions:uV,required:dV,additionalProperties:lV};var cV="http://json-schema.org/draft-07/schema",mV="FindTransferGroupManyTxOutput",hV="FindTransferGroupManyTxOutput",gV="Output of find-transfer-group-many",_V="object",TV={transfer_groups:{description:"Found transfers",type:"array",items:{$ref:"/txs/get-transfer-group/get-transfer-group.schema.output.json#/definitions/transfer_group"}},metadata:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_find_metadata"}},yV=["transfer_groups","metadata"],bV=!1,Mf={$schema:cV,$id:mV,title:hV,description:gV,type:_V,properties:TV,required:yV,additionalProperties:bV};var xV="http://json-schema.org/draft-07/schema",FV="FindTransferManyTxInput",wV="FindTransferManyTxInput",$V="Input for findTransferMany",OV="object",vV={transfer:{$ref:"#/definitions/find_transfer_many_filter"},options:{$ref:"#/definitions/find_transfer_many_tx_options"}},jV={find_transfer_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"#/definitions/find_transfer_many_ordering_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/find_transfer_many_additional_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_select_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_deselect_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_options"}]},find_transfer_many_additional_options:{$typescript:'{"additionalProperties":false}',type:"object",properties:{return_running_balance_for_wallet:{description:"Return running balance for each transfer for wallet in question",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},return_signed_amount_for_wallet:{description:"Return amount as signed value for each transfer for wallet in question",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}}},find_transfer_many_ordering_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags for input ordering",type:"object",properties:{order:{description:"Ordering options",type:"array",items:{$ref:"#/definitions/find_transfer_many_ordering_input"}}}},find_transfer_many_ordering_input:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_ordering_input"},{$ref:"#/definitions/find_transfer_many_ordering_input_field"}]},find_transfer_many_ordering_input_field:{type:"object",properties:{field:{$ref:"/db/transfer/transfer.schema.json#/definitions/TransferTableAccessibleFields"}},$typescript:'{"additionalProperties": false}'},transfer_filter_foreign_fields:{type:"string",enum:["from_wallet","to_wallet","wallet","token"]},transfer_filter_identifier_fields:{type:"string",enum:["transfer_group"]},transfer_filter:{type:"object",properties:{from_wallet:{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_wallet:{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},wallet:{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},status:{$ref:"/db/transfer/transfer.schema.json#/properties/status"},transfer_group:{$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"},metadata:{$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"}},$typescript:'{"additionalProperties": false}'},advanced_transfer_filter_inner:{type:"object",properties:{inner:{type:"array",items:{$ref:"#/definitions/advanced_transfer_filter"}}},$typescript:'{"additionalProperties":false}'},advanced_transfer_filter_where_inner:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereInner"},{$ref:"#/definitions/advanced_transfer_filter_inner"}]},advanced_transfer_filter_where_primitive:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWherePrimitive"},{$ref:"#/definitions/advanced_transfer_filter_fields"}]},advanced_transfer_filter_where_primitive_foreign:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWherePrimitiveForeign"},{$ref:"#/definitions/advanced_transfer_filter_fields_foreign"}]},advanced_transfer_filter_where_primitive_identifier:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWherePrimitiveIdentifier"},{$ref:"#/definitions/advanced_transfer_filter_fields_identifier"}]},advanced_transfer_filter_where_object:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereObject"},{$ref:"#/definitions/advanced_transfer_filter_values"}]},advanced_transfer_filter_where_in:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereIns"},{$ref:"#/definitions/advanced_transfer_filter_fields_w_foreign"}]},advanced_transfer_filter_where_null:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereNulls"},{$ref:"#/definitions/advanced_transfer_filter_fields"}]},advanced_transfer_filter_fields:{type:"object",properties:{field:{$ref:"/db/transfer/transfer.schema.json#/definitions/TransferTableAccessibleFields"}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_transfer_filter_fields_foreign:{type:"object",properties:{field:{$ref:"#/definitions/transfer_filter_foreign_fields"}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_transfer_filter_fields_identifier:{type:"object",properties:{field:{$ref:"#/definitions/transfer_filter_identifier_fields"}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_transfer_filter_fields_w_foreign:{type:"object",properties:{field:{anyOf:[{$ref:"/db/transfer/transfer.schema.json#/definitions/TransferTableAccessibleFields"},{$ref:"#/definitions/transfer_filter_foreign_fields"}]}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_transfer_filter_values:{type:"object",properties:{value:{$ref:"#/definitions/transfer_filter"}},required:["value"],$typescript:'{"additionalProperties": false}'},advanced_transfer_filter:{anyOf:[{$ref:"#/definitions/advanced_transfer_filter_where_inner"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataIns"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataPrimitive"},{$ref:"#/definitions/advanced_transfer_filter_where_object"},{$ref:"#/definitions/advanced_transfer_filter_where_primitive"},{$ref:"#/definitions/advanced_transfer_filter_where_primitive_foreign"},{$ref:"#/definitions/advanced_transfer_filter_where_primitive_identifier"},{$ref:"#/definitions/advanced_transfer_filter_where_in"},{$ref:"#/definitions/advanced_transfer_filter_where_null"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataNulls"}]},advanced_transfer_filter_array:{type:"array",items:{$ref:"#/definitions/advanced_transfer_filter"}},find_transfer_many_filter:{oneOf:[{$ref:"#/definitions/transfer_filter"},{$ref:"#/definitions/advanced_transfer_filter_array"}]}},IV=["transfer"],kV=!1,Wf={$schema:xV,$id:FV,title:wV,description:$V,type:OV,properties:vV,definitions:jV,required:IV,additionalProperties:kV};var SV="http://json-schema.org/draft-07/schema",CV="FindTransferManyTxOutput",PV="FindTransferManyTxOutput",GV="Output of findTransferMany",DV="object",MV={transfers:{description:"Found transfers",type:"array",items:{$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"}},metadata:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_find_metadata"}},WV=["transfers","metadata"],EV=!1,Ef={$schema:SV,$id:CV,title:PV,description:GV,type:DV,properties:MV,required:WV,additionalProperties:EV};var RV="http://json-schema.org/draft-07/schema",AV="FindWalletManyTxInput",UV="FindWalletManyTxInput",qV="Input for findWalletMany",NV="object",BV={wallet:{$ref:"#/definitions/find_wallet_many_filter"},options:{$ref:"#/definitions/find_wallet_many_tx_options"}},LV={find_wallet_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"#/definitions/find_wallet_many_ordering_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/find_wallet_many_additional_options"},{$ref:"#/definitions/find_wallet_many_select_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_options"}]},find_wallet_many_additional_options:{description:"Optional flags for input",type:"object",properties:{include_balance_for_token:{description:"If specified each wallet will have its balance included",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"}},default:{},$typescript:'{"additionalProperties":false}'},find_wallet_many_ordering_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags for input ordering",type:"object",properties:{order:{description:"Ordering options",type:"array",items:{$ref:"#/definitions/find_wallet_many_ordering_input"}}}},find_wallet_many_ordering_input:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_ordering_input"},{$ref:"#/definitions/find_wallet_many_ordering_input_field"}]},find_wallet_many_ordering_input_field:{type:"object",properties:{field:{$ref:"#/definitions/advanced_wallet_filter_fields"}},$typescript:'{"additionalProperties": false}'},find_wallet_many_filter:{oneOf:[{$ref:"#/definitions/wallet_filter"},{$ref:"#/definitions/advanced_wallet_filter_array"}]},wallet_filter:{type:"object",properties:{foreign:{$ref:"/db/wallet/wallet.schema.json#/properties/foreign"},name:{$ref:"/db/wallet/wallet.schema.json#/properties/name"},type:{$ref:"/db/wallet/wallet.schema.json#/properties/type"},status:{$ref:"/db/wallet/wallet.schema.json#/properties/status"},metadata:{$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"}},$typescript:'{"additionalProperties":false}'},advanced_wallet_filter_where_inner:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereInner"},{$ref:"#/definitions/advanced_wallet_filter_inner"}]},advanced_wallet_filter_inner:{type:"object",properties:{inner:{type:"array",items:{$ref:"#/definitions/advanced_wallet_filter"}}},$typescript:'{"additionalProperties":false}'},advanced_wallet_filter_where_primitive:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWherePrimitive"},{$ref:"#/definitions/advanced_wallet_filter_fields_object"}]},advanced_wallet_filter_where_object:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereObject"},{$ref:"#/definitions/advanced_wallet_filter_values"}]},advanced_wallet_filter_where_in:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereIns"},{$ref:"#/definitions/advanced_wallet_filter_fields_object"}]},advanced_wallet_filter_where_null:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereNulls"},{$ref:"#/definitions/advanced_wallet_filter_fields_object"}]},advanced_wallet_filter_fields_object:{type:"object",properties:{field:{$ref:"#/definitions/advanced_wallet_filter_fields"}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_wallet_filter_fields:{type:"string",enum:["id","balance_pending_amount","balance_finished_amount","balance_available_balance","foreign","name","type","status","created_at"]},advanced_wallet_filter_string_fields:{type:"string",enum:["foreign","name","type","status","created_at"]},advanced_wallet_filter_number_fields:{type:"string",enum:["id","balance_pending_amount","balance_finished_amount","balance_available_balance"]},advanced_wallet_filter_values:{type:"object",properties:{value:{$ref:"#/definitions/wallet_filter"}},required:["value"],$typescript:'{"additionalProperties": false}'},advanced_wallet_filter:{anyOf:[{$ref:"#/definitions/advanced_wallet_filter_where_inner"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataIns"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataPrimitive"},{$ref:"#/definitions/advanced_wallet_filter_where_primitive"},{$ref:"#/definitions/advanced_wallet_filter_where_object"},{$ref:"#/definitions/advanced_wallet_filter_where_in"},{$ref:"#/definitions/advanced_wallet_filter_where_null"}]},advanced_wallet_filter_array:{type:"array",items:{$ref:"#/definitions/advanced_wallet_filter"}},find_wallet_many_select_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags to limit search result",type:"object",properties:{select:{description:"Select options",type:"array",items:{$ref:"/txs/find-wallet-many/find-wallet-many.schema.output.json#/definitions/wallet_with_balance_fields"}}}}},VV=!1,Rf={$schema:RV,$id:AV,title:UV,description:qV,type:NV,properties:BV,definitions:LV,additionalProperties:VV};var HV="http://json-schema.org/draft-07/schema",zV="FindWalletManyTxOutput",KV="FindWalletManyTxOutput",QV="Output of findWalletMany",JV="object",XV={wallets:{type:"array",items:{anyOf:[{$ref:"/db/wallet/wallet.schema.json"},{type:"null"},{$ref:"#/definitions/wallet_with_balance"}]}},metadata:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_find_metadata"}},YV={wallet_with_balance:{type:"object",properties:{id:{description:"System defined primary key",type:"integer"},foreign:{description:"User provided key for wallet. Must be unique",type:"string"},name:{description:"Name of the wallet",type:["string","null"]},metadata:{description:"Key/value metadata object",type:["object","null"]},type:{description:"Type of the wallet",default:"regular",$ref:"/db/consts.schema.json#/definitions/WalletType"},status:{description:"Current status for the wallet",default:"active",type:"string"},default_allow_negative:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be negative",default:!1,type:"boolean"},default_allow_positive:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be positive. Used for token balance to deny positive balance.",default:!0,type:"boolean"},created_at:{description:"Datetime when the wallet was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when the wallet was last updated",type:"string",format:"date-time"},balance_transfer_id:{description:"Latest transfer id",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/transfer_id"},balance_token_id:{description:"Token ID of balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/token_id"},balance_token_foreign:{description:"Token Foreign of balance",$ref:"/db/token/token.schema.json#/properties/foreign"},balance_pending_amount:{description:"Current pending balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/pending_amount"},balance_pending_amount_to:{description:"Sum of incoming pending transfers",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/pending_amount_to"},balance_pending_amount_from:{description:"Sum of outgoing pending transfers",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/pending_amount_from"},balance_finished_amount:{description:"Current finished balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/finished_amount"},balance_amount:{description:"Current finished and pending balance sum",type:"number"},balance_available_balance:{description:"Available balance that is sum of pending_amount_from and finished_amount",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/available_balance"},balance_latest_control_hash:{description:"Latest control_hash associated with wallet token combination",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/latest_control_hash"},balance_updated_at:{description:"Last modification date of balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/created_at"}},additionalProperties:!1},wallet_with_balance_fields:{type:"string",enum:["id","foreign","name","metadata","type","status","default_allow_negative","default_allow_positive","created_at","updated_at","balance_transfer_id","balance_token_id","balance_token_foreign","balance_pending_amount","balance_pending_amount_to","balance_pending_amount_from","balance_finished_amount","balance_amount","balance_latest_control_hash","balance_updated_at","balance_available_balance"]}},ZV=["wallets","metadata"],eH=!1,Af={$schema:HV,$id:zV,title:KV,description:QV,type:JV,properties:XV,definitions:YV,required:ZV,additionalProperties:eH};var tH="http://json-schema.org/draft-07/schema",rH="FinishTransactionTxInput",nH="FinishTransactionTxInput",aH="Input for finishTransaction",sH="object",iH={action:{description:"Finish transaction with commit/rollback",default:"commit",type:"string",enum:["commit","rollback"]},options:{$ref:"#/definitions/finish_transaction_tx_options"}},oH={finish_transaction_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/finish_transaction_additional_options"}]},finish_transaction_additional_options:{type:"object",properties:{transaction_id:{description:"Id of the transaction context to run the query in",type:"string"}},required:["transaction_id"],$typescript:'{"additionalProperties": false}'}},pH=["action","options"],fH=!1,Uf={$schema:tH,$id:rH,title:nH,description:aH,type:sH,properties:iH,definitions:oH,required:pH,additionalProperties:fH};var uH="http://json-schema.org/draft-07/schema",dH="FinishTransactionTxOutput",lH="FinishTransactionTxOutput",cH="Output of finishTransaction",mH="object",hH={success:{type:"boolean"},message:{description:"Error message when success is false",type:"string"}},gH=["success"],_H=!1,qf={$schema:uH,$id:dH,title:lH,description:cH,type:mH,properties:hH,required:gH,additionalProperties:_H};var TH="http://json-schema.org/draft-07/schema",yH="GetBalanceTxInput",bH="GetBalanceTxInput",xH="Input for getBalance",FH="object",wH={balance:{$ref:"#/definitions/unique_balance_filter"},options:{$ref:"#/definitions/get_balance_tx_options"}},$H={get_balance_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/get_balance_additional_options"}]},get_balance_additional_options:{description:"Optional flags for input",type:"object",properties:{create_wallet_if_not_exists:{type:"boolean",description:"If true then the missing wallet will be created if not found. Only valid with 'foreign'",default:!1},create_token_if_not_exists:{type:"boolean",description:"If true then the missing token will be created if not found. Only valid with 'foreign'",default:!1},create_if_not_exists:{type:"boolean",description:"If true then the missing balance will be created if not found. ",default:!1}},default:{},$typescript:'{"additionalProperties": false}'},unique_balance_filter:{type:"object",properties:{wallet:{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},datetime:{description:"Time the balance should be retrieved at",type:"string"}},required:["wallet","token"],additionalProperties:!1}},OH=["balance"],vH=!1,Nf={$schema:TH,$id:yH,title:bH,description:xH,type:FH,properties:wH,definitions:$H,required:OH,additionalProperties:vH};var jH="http://json-schema.org/draft-07/schema",IH="GetBalanceTxOutput",kH="GetBalanceTxOutput",SH="Output of getBalance",CH="object",PH={balance:{description:"requested balance",$ref:"#/definitions/balance"}},GH={balance:{type:"object",properties:{transfer_id:{description:"Latest transfer id",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/transfer_id"},token_id:{description:"Token ID of balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/token_id"},token_foreign:{description:"Token Foreign of balance",$ref:"/db/token/token.schema.json#/properties/foreign"},wallet_id:{description:"Wallet ID of balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/wallet_id"},wallet_foreign:{description:"Wallet Foreign of balance",$ref:"/db/wallet/wallet.schema.json#/properties/foreign"},pending_amount:{description:"Current pending balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/pending_amount"},pending_amount_to:{description:"Sum of incoming pending transfers",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/pending_amount_to"},pending_amount_from:{description:"Sum of outgoing pending transfers",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/pending_amount_from"},available_balance:{description:"Available balance that is sum of pending_amount_from and finished_amount",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/available_balance"},finished_amount:{description:"Current finished balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/finished_amount"},amount:{description:"Current finished and pending balance sum",type:"number"},latest_control_hash:{description:"Latest control_hash associated with wallet token combination",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/latest_control_hash"},updated_at:{description:"Last modification date of balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/created_at"}},required:["token_id","token_foreign","wallet_id","wallet_foreign","pending_amount","finished_amount","amount","latest_control_hash","updated_at"],additionalProperties:!1},balance_fields:{description:"Fields on the balance object",type:"string",enum:["transfer_id","token_id","token_foreign","wallet_id","wallet_foreign","pending_amount","pending_amount_to","pending_amount_from","finished_amount","available_balance","amount","latest_control_hash","updated_at"]}},DH=!1,Bf={$schema:jH,$id:IH,title:kH,description:SH,type:CH,properties:PH,definitions:GH,additionalProperties:DH};var MH="http://json-schema.org/draft-07/schema",WH="GetBalanceHistoryTxInput",EH="GetBalanceHistoryTxInput",RH="Input for getBalanceHistory",AH="object",UH={balance:{$ref:"/txs/get-balance/get-balance.schema.input.json#/definitions/unique_balance_filter"},options:{$ref:"#/definitions/get_balance_history_tx_options"}},qH={get_balance_history_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/get_balance_history_additional_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"#/definitions/get_balance_history_ordering_options"},{$ref:"#/definitions/balance_history_select_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_options"}]},get_balance_history_additional_options:{description:"Optional flags for input",type:"object",properties:{create_wallet_if_not_exists:{type:"boolean",description:"If true then the missing wallet will be created if not found. Only valid with 'foreign'",default:!1},create_token_if_not_exists:{type:"boolean",description:"If true then the missing token will be created if not found. Only valid with 'foreign'",default:!1}},default:{},$typescript:'{"additionalProperties":false}'},get_balance_history_ordering_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags for input ordering",type:"object",properties:{order:{description:"Ordering options",type:"string",enum:["asc","desc"]}}},balance_history_select_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags to limit search result",type:"object",properties:{select:{description:"Select options",type:"array",items:{$ref:"/txs/get-balance-history/get-balance-history.schema.output.json#/definitions/balance_history_fields"}}}}},NH=!1,Lf={$schema:MH,$id:WH,title:EH,description:RH,type:AH,properties:UH,definitions:qH,additionalProperties:NH};var BH="http://json-schema.org/draft-07/schema",LH="GetBalanceHistoryTxOutput",VH="GetBalanceHistoryTxOutput",HH="Output of getBalanceHistory",zH="object",KH={balances:{description:"Resolved balance change objects",type:"array",items:{$ref:"#/definitions/balance_history"}},metadata:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_find_metadata"}},QH={balance_history:{type:"object",properties:{balance_id:{description:"The internal ID of the balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/id"},token_id:{description:"Token ID of balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/token_id"},token_foreign:{description:"Token Foreign of balance",$ref:"/db/token/token.schema.json#/properties/foreign"},wallet_id:{description:"Wallet ID of balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/wallet_id"},wallet_foreign:{description:"Wallet Foreign of balance",$ref:"/db/wallet/wallet.schema.json#/properties/foreign"},pending_amount:{description:"Current pending balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/pending_amount"},pending_amount_to:{description:"Sum of incoming pending transfers",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/pending_amount_to"},pending_amount_from:{description:"Sum of outgoing pending transfers",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/pending_amount_from"},available_balance:{description:"Available balance that is sum of pending_amount_from and finished_amount",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/available_balance"},finished_amount:{description:"Current finished balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/finished_amount"},amount:{description:"Current finished and pending balance sum",type:"number"},latest_control_hash:{description:"Latest control_hash associated with wallet token combination",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/latest_control_hash"},updated_at:{description:"Last modification date of balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/created_at"},transfer_id:{$ref:"/db/transfer/transfer.schema.json#/properties/id"},transfer_identifier:{$ref:"/db/transfer/transfer.schema.json#/properties/identifier"},transfer_control_hash:{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},transfer_from_wallet_id:{$ref:"/db/transfer/transfer.schema.json#/properties/from_wallet_id"},transfer_from_wallet_foreign:{$ref:"/db/wallet/wallet.schema.json#/properties/foreign"},transfer_to_wallet_id:{$ref:"/db/transfer/transfer.schema.json#/properties/to_wallet_id"},transfer_to_wallet_foreign:{$ref:"/db/wallet/wallet.schema.json#/properties/foreign"},transfer_amount:{$ref:"/db/transfer/transfer.schema.json#/properties/amount"},transfer_type:{$ref:"/db/transfer/transfer.schema.json#/properties/type"},transfer_status:{$ref:"/db/transfer/transfer.schema.json#/properties/status"},transfer_force:{$ref:"/db/transfer/transfer.schema.json#/properties/force"},transfer_created_at:{$ref:"/db/transfer/transfer.schema.json#/properties/created_at"},transfer_updated_at:{$ref:"/db/transfer/transfer.schema.json#/properties/updated_at"},transfer_metadata:{$ref:"/db/transfer/transfer.schema.json#/properties/metadata"},transfer_transfer_group_id:{$ref:"/db/transfer/transfer.schema.json#/properties/transfer_group_id"},transfer_transfer_group_identifier:{description:"Transfer Group identifier if transfer belongs to a group",type:"string"},transfer_reverses_id:{$ref:"/db/transfer/transfer.schema.json#/properties/reverses_id"},transfer_reverses_identifier:{description:"Reverses identifier if transfer reverses another transfer",type:"string"},transfer_status_finalized_at:{description:"DateTime transfer reached final status",type:["string","null"],format:"date-time"}},$typescript:'{"additionalProperties": false}'},balance_history_fields:{type:"string",enum:["transfer_id","transfer_identifier","transfer_control_hash","transfer_from_wallet_id","transfer_from_wallet_foreign","transfer_to_wallet_id","transfer_to_wallet_foreign","transfer_amount","transfer_type","transfer_status","transfer_force","transfer_created_at","transfer_updated_at","transfer_metadata","transfer_transfer_group_id","transfer_transfer_group_identifier","transfer_reverses_id","transfer_reverses_identifier","transfer_status_finalized_at","balance_id","token_id","token_foreign","wallet_id","wallet_foreign","pending_amount","pending_amount_to","pending_amount_from","finished_amount","amount","latest_control_hash","updated_at","status"]}},JH=!1,Vf={$schema:BH,$id:LH,title:VH,description:HH,type:zH,properties:KH,definitions:QH,additionalProperties:JH};var XH="http://json-schema.org/draft-07/schema",YH="GetDatabaseExportProgressTxInput",ZH="GetDatabaseExportProgressTxInput",e2="Input for getDatabaseExportProgress",t2="object",r2={options:{$ref:"#/definitions/get_database_backup_progress_tx_options"}},n2={get_database_backup_progress_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/get_database_backup_progress_additional_options"}]},get_database_backup_progress_additional_options:{description:"Optional flags for input",type:"object",default:{},$typescript:'{"additionalProperties":false}'}},a2=!1,Hf={$schema:XH,$id:YH,title:ZH,description:e2,type:t2,properties:r2,definitions:n2,additionalProperties:a2};var s2="http://json-schema.org/draft-07/schema",i2="GetDatabaseExportProgressTxOutput",o2="GetDatabaseExportProgressTxOutput",p2="Output of getDatabaseExportProgress",f2="object",u2={size:{type:"number",description:"Size of a exported backup in MB"},started:{type:"boolean",description:"Boolean indicating if export has started"},finished:{type:"boolean",description:"Boolean indicating if export has finished"}},d2=!1,zf={$schema:s2,$id:i2,title:o2,description:p2,type:f2,properties:u2,additionalProperties:d2};var l2="http://json-schema.org/draft-07/schema",c2="GetDatabaseImportProgressTxInput",m2="GetDatabaseImportProgressTxInput",h2="Input for GetDatabaseImportProgress",g2="object",_2={options:{$ref:"#/definitions/import_database_progress_tx_options"}},T2={import_database_progress_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"}]}},y2=!1,Kf={$schema:l2,$id:c2,title:m2,description:h2,type:g2,properties:_2,definitions:T2,additionalProperties:y2};var b2="http://json-schema.org/draft-07/schema",x2="GetDatabaseImportProgressTxOutput",F2="GetDatabaseImportProgressTxOutput",w2="Output of GetDatabaseImportProgress",$2="object",O2={progress:{type:"number",description:"Percentage of imported database"}},v2=!1,Qf={$schema:b2,$id:x2,title:F2,description:w2,type:$2,properties:O2,additionalProperties:v2};var j2="http://json-schema.org/draft-07/schema",I2="GetFlagsTxInput",k2="GetFlagsTxInput",S2="Input for getFlags",C2="object",P2={options:{$ref:"#/definitions/get_flags_tx_options"}},G2={get_flags_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options_without_tx"}]}},D2=!1,Jf={$schema:j2,$id:I2,title:k2,description:S2,type:C2,properties:P2,definitions:G2,additionalProperties:D2};var M2="http://json-schema.org/draft-07/schema",W2="GetFlagsTxOutput",E2="GetFlagsTxOutput",R2="Output of getFlags",A2="object",U2={flags:{$ref:"/db/consts.schema.json#/definitions/Flags"}},q2=!1,Xf={$schema:M2,$id:W2,title:E2,description:R2,type:A2,properties:U2,additionalProperties:q2};var N2="http://json-schema.org/draft-07/schema",B2="GetStatisticsTxInput",L2="GetStatisticsTxInput",V2="Input for getStatistics",H2="object",z2={model:{$ref:"#/definitions/statistics_model"},groups:{$ref:"#/definitions/statistics_groups"},aggregator:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_aggregator"},filter:{$ref:"#/definitions/statistics_filter"},options:{$ref:"#/definitions/get_statistics_tx_options"}},K2={get_statistics_tx_options:{description:"Optional flags for input",type:"object",default:{},properties:{tracking_id:{description:"User provided id added to logs for debugging",type:"string"}},additionalProperties:!1},statistics_groups:{type:"array",maxItems:5,items:{$ref:"#/definitions/statistics_group"}},statistics_group:{anyOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_group"},{$ref:"#/definitions/statistics_group_field"}]},statistics_group_field:{type:"object",properties:{type:{type:"string",enum:["field"]},value:{$ref:"#/definitions/statistics_field"},alias:{type:"string"}},required:["type","value"],additionalProperties:!1},statistics_model:{description:"Model to return statistics about",type:"string",enum:["Transfer","TransferGroup","Wallet","Token"],default:"Transfer"},statistics_field:{description:"Field to group statistics about. Only used with group_by_field type",type:"string",enum:["type","status","transfer_status"],default:"type"},statistics_filter:{anyOf:[{$ref:"#/definitions/statistics_general_filter"},{$ref:"#/definitions/statistics_transfer_filter"}]},statistics_general_filter:{type:"object",properties:{start_time:{type:"string",format:"date-time"},end_time:{type:"string",format:"date-time"}},$typescript:'{"additionalProperties":false}'},statistics_transfer_filter:{type:"object",properties:{status:{$ref:"/db/transfer/transfer.schema.json#/properties/status"},start_time:{type:"string",format:"date-time"},end_time:{type:"string",format:"date-time"}},$typescript:'{"additionalProperties":false}'}},Q2=!1,Yf={$schema:N2,$id:B2,title:L2,description:V2,type:H2,properties:z2,definitions:K2,additionalProperties:Q2};var J2="http://json-schema.org/draft-07/schema",X2="GetStatisticsTxOutput",Y2="GetStatisticsTxOutput",Z2="Output of getStatistics",e7="object",t7={rows:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_aggregate_results"}},r7={},n7=["rows"],a7=!1,Zf={$schema:J2,$id:X2,title:Y2,description:Z2,type:e7,properties:t7,definitions:r7,required:n7,additionalProperties:a7};var s7="http://json-schema.org/draft-07/schema",i7="GetTokenTxInput",o7="GetTokenTxInput",p7="Input for getToken",f7="object",u7={token:{$ref:"#/definitions/unique_token_filter"},options:{$ref:"#/definitions/get_token_tx_options"}},d7={get_token_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/get_token_additional_options"}]},get_token_additional_options:{description:"Optional flags for input",type:"object",properties:{ignore_cache:{type:"boolean",default:!1},create_if_not_exists:{type:"boolean",description:"If true then the token will be created if not found. Only valid with 'foreign'",default:!1},return_only_id:{type:"boolean",description:"If true then the returning object is only guaranteed to have id",default:!1}},default:{},$typescript:'{"additionalProperties": false}'},unique_token_filter:{description:"UNIQUE filtering options for token",anyOf:[{$ref:"#/definitions/unique_token_filter_id"},{$ref:"#/definitions/unique_token_filter_foreign"}]},unique_token_filter_id:{type:"object",description:"ID based filter for token",properties:{id:{description:"Id of wallet to return",$ref:"/db/wallet/wallet.schema.json#/properties/id"},foreign:{description:"Foreign of wallet to return",$ref:"/db/wallet/wallet.schema.json#/properties/name"}},required:["id"],additionalProperties:!1},unique_token_filter_foreign:{type:"object",description:"Foreign based filter for token",properties:{id:{description:"Id of wallet to return",$ref:"/db/wallet/wallet.schema.json#/properties/id"},foreign:{description:"Foreign of wallet to return",$ref:"/db/wallet/wallet.schema.json#/properties/name"}},required:["foreign"],additionalProperties:!1}},l7=["token"],c7=!1,eu={$schema:s7,$id:i7,title:o7,description:p7,type:f7,properties:u7,definitions:d7,required:l7,additionalProperties:c7};var m7="http://json-schema.org/draft-07/schema",h7="GetTokenTxOutput",g7="GetTokenTxOutput",_7="Output of getToken",T7="object",y7={token:{description:"requested token",$ref:"#/definitions/token"}},b7={token:{properties:{id:{$ref:"/db/token/token.schema.json#/properties/id"},foreign:{$ref:"/db/token/token.schema.json#/properties/foreign"},public:{$ref:"/db/token/token.schema.json#/properties/public"},belongs_to:{$ref:"/db/token/token.schema.json#/properties/belongs_to"},created_at:{$ref:"/db/token/token.schema.json#/properties/created_at"},updated_at:{$ref:"/db/token/token.schema.json#/properties/updated_at"},metadata:{$ref:"/db/token/token.schema.json#/properties/metadata"},divisor:{$ref:"/db/token/token.schema.json#/properties/divisor"},limit:{$ref:"/db/token/token.schema.json#/properties/limit"},type:{$ref:"/db/token/token.schema.json#/properties/type"},belongs_to_foreign:{description:"Foreign of the belongs_to wallet if exists",type:["string","null"]}},required:["id"],additionalProperties:!1}},x7=!1,tu={$schema:m7,$id:h7,title:g7,description:_7,type:T7,properties:y7,definitions:b7,additionalProperties:x7};var F7="http://json-schema.org/draft-07/schema",w7="GetTokenManyTxInput",$7="GetTokenManyTxInput",O7="Input for getTokenMany",v7="object",j7={tokens:{type:"array",items:{$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"}},options:{$ref:"#/definitions/get_token_many_tx_options"}},I7={get_token_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/get_token_many_additional_options"}]},get_token_many_additional_options:{description:"Optional flags for input",type:"object",properties:{ignore_cache:{type:"boolean",default:!1},create_if_not_exists:{type:"boolean",description:"If true then the token will be created if not found. Only valid with 'foreign'",default:!1},return_only_id:{type:"boolean",description:"If true then the returning object is only guaranteed to have id",default:!1}},default:{},$typescript:'{"additionalProperties": false}'}},k7=["tokens"],S7=!1,ru={$schema:F7,$id:w7,title:$7,description:O7,type:v7,properties:j7,definitions:I7,required:k7,additionalProperties:S7};var C7="http://json-schema.org/draft-07/schema",P7="GetTokenManyTxOutput",G7="GetTokenManyTxOutput",D7="Output of getTokenMany",M7="object",W7={tokens:{type:"array",items:{$ref:"#/definitions/TokenResult"}}},E7={TokenResult:{anyOf:[{$ref:"/db/token/token.schema.json"},{$ref:"/db/token/token.schema.optional.json"},{type:"null"}]}},R7=["tokens"],A7=!1,nu={$schema:C7,$id:P7,title:G7,description:D7,type:M7,properties:W7,definitions:E7,required:R7,additionalProperties:A7};var U7="http://json-schema.org/draft-07/schema",q7="GetTransferTxInput",N7="GetTransferTxInput",B7="Input for getTransfer",L7="object",V7={transfer:{$ref:"#/definitions/unique_transfer_filter"},options:{$ref:"#/definitions/get_transfer_tx_options"}},H7={get_transfer_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"}]},unique_transfer_filter:{description:"UNIQUE filtering options for transfer",anyOf:[{$ref:"#/definitions/unique_transfer_filter_id"},{$ref:"#/definitions/unique_transfer_filter_identifier"}]},unique_transfer_filter_id:{type:"object",description:"ID based filter of transfer",properties:{id:{description:"Id of transfer to return",$ref:"/db/transfer/transfer.schema.json#/properties/id"},identifier:{description:"Identifier of transfer to return",$ref:"/db/transfer/transfer.schema.json#/properties/identifier"}},required:["id"],additionalProperties:!1},unique_transfer_filter_identifier:{type:"object",description:"identifier based filter of transfer",properties:{id:{description:"Id of transfer to return",$ref:"/db/transfer/transfer.schema.json#/properties/id"},identifier:{description:"Identifier of transfer to return",$ref:"/db/transfer/transfer.schema.json#/properties/identifier"}},required:["identifier"],additionalProperties:!1}},z7=["transfer"],K7=!1,au={$schema:U7,$id:q7,title:N7,description:B7,type:L7,properties:V7,definitions:H7,required:z7,additionalProperties:K7};var Q7="http://json-schema.org/draft-07/schema",J7="GetTransferTxOutput",X7="GetTransferTxOutput",Y7="Output of getTransfer",Z7="object",ez={transfer:{$ref:"#/definitions/transfer"}},tz={transfer:{type:"object",description:"requested transfer",properties:{id:{$ref:"/db/transfer/transfer.schema.json#/properties/id"},identifier:{$ref:"/db/transfer/transfer.schema.json#/properties/identifier"},control_hash:{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},from_wallet_id:{$ref:"/db/transfer/transfer.schema.json#/properties/from_wallet_id"},from_wallet_foreign:{$ref:"/db/wallet/wallet.schema.json#/properties/foreign"},to_wallet_id:{$ref:"/db/transfer/transfer.schema.json#/properties/to_wallet_id"},to_wallet_foreign:{$ref:"/db/wallet/wallet.schema.json#/properties/foreign"},token_id:{$ref:"/db/transfer/transfer.schema.json#/properties/token_id"},token_foreign:{$ref:"/db/token/token.schema.json#/properties/foreign"},amount:{$ref:"/db/transfer/transfer.schema.json#/properties/amount"},type:{$ref:"/db/transfer/transfer.schema.json#/properties/type"},status:{$ref:"/db/transfer/transfer.schema.json#/properties/status"},force:{$ref:"/db/transfer/transfer.schema.json#/properties/force"},auto_hash:{$ref:"/db/transfer/transfer.schema.json#/properties/auto_hash"},created_at:{$ref:"/db/transfer/transfer.schema.json#/properties/created_at"},updated_at:{$ref:"/db/transfer/transfer.schema.json#/properties/updated_at"},metadata:{$ref:"/db/transfer/transfer.schema.json#/properties/metadata"},transfer_group_id:{$ref:"/db/transfer/transfer.schema.json#/properties/transfer_group_id"},transfer_group_identifier:{description:"Transfer Group identifier if transfer belongs to a group",type:"string"},reverses_id:{$ref:"/db/transfer/transfer.schema.json#/properties/reverses_id"},reverses_identifier:{description:"Reverses identifier if transfer reverses another transfer",type:"string"},balance_id:{description:"Iterator marking the position of the balance in the continuum",type:["number","null"]},balance_pending:{description:"Wallet pending balance after transfer",type:["number","null"]},balance_pending_to:{description:"Wallet pending_to balance after transfer",type:["number","null"]},balance_pending_from:{description:"Wallet pending_from balance after transfer",type:["number","null"]},balance_finished:{description:"Wallet finished balance after transfer",type:["number","null"]},signed_amount:{description:"amount with a sign according to transfer direction",type:["number","null"]},status_finalized_at:{description:"DateTime transfer reached final status",type:["string","null"],format:"date-time"}},additionalProperties:!1,required:["id","identifier","from_wallet_id","from_wallet_foreign","to_wallet_id","to_wallet_foreign","token_id","token_foreign","amount","type","status","force","created_at"]},transfer_optional:{type:"object",description:"requested transfer",properties:{id:{$ref:"/db/transfer/transfer.schema.json#/properties/id"},identifier:{$ref:"/db/transfer/transfer.schema.json#/properties/identifier"},control_hash:{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},from_wallet_id:{$ref:"/db/transfer/transfer.schema.json#/properties/from_wallet_id"},from_wallet_foreign:{$ref:"/db/wallet/wallet.schema.json#/properties/foreign"},to_wallet_id:{$ref:"/db/transfer/transfer.schema.json#/properties/to_wallet_id"},to_wallet_foreign:{$ref:"/db/wallet/wallet.schema.json#/properties/foreign"},token_id:{$ref:"/db/transfer/transfer.schema.json#/properties/token_id"},token_foreign:{$ref:"/db/token/token.schema.json#/properties/foreign"},amount:{$ref:"/db/transfer/transfer.schema.json#/properties/amount"},type:{$ref:"/db/transfer/transfer.schema.json#/properties/type"},status:{$ref:"/db/transfer/transfer.schema.json#/properties/status"},force:{$ref:"/db/transfer/transfer.schema.json#/properties/force"},auto_hash:{$ref:"/db/transfer/transfer.schema.json#/properties/auto_hash"},created_at:{$ref:"/db/transfer/transfer.schema.json#/properties/created_at"},updated_at:{$ref:"/db/transfer/transfer.schema.json#/properties/updated_at"},metadata:{$ref:"/db/transfer/transfer.schema.json#/properties/metadata"},transfer_group_id:{$ref:"/db/transfer/transfer.schema.json#/properties/transfer_group_id"},transfer_group_identifier:{description:"Transfer Group identifier if transfer belongs to a group",type:"string"},reverses_id:{$ref:"/db/transfer/transfer.schema.json#/properties/reverses_id"},balance_id:{description:"Iterator marking the position of the balance in the continuum",type:["number","null"]},balance_pending:{description:"Wallet pending balance after transfer",type:["number","null"]},balance_pending_to:{description:"Wallet pending_to balance after transfer",type:["number","null"]},balance_pending_from:{description:"Wallet pending_from balance after transfer",type:["number","null"]},balance_finished:{description:"Wallet finished balance after transfer",type:["number","null"]},signed_amount:{description:"amount with a sign according to transfer direction",type:["number","null"]},status_finalized_at:{description:"DateTime transfer reached final status",type:["string","null"],format:"date-time"}},additionalProperties:!1}},rz=!1,su={$schema:Q7,$id:J7,title:X7,description:Y7,type:Z7,properties:ez,definitions:tz,additionalProperties:rz};var nz="http://json-schema.org/draft-07/schema",az="GetTransferGroupTxInput",sz="GetTransferGroupTxInput",iz="Input for getTransferGroup",oz="object",pz={transfer_group:{$ref:"#/definitions/unique_transfer_group_filter"},options:{$ref:"#/definitions/get_transfer_group_tx_options"}},fz={get_transfer_group_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/get_transfer_group_additional_options"}]},get_transfer_group_additional_options:{description:"Optional flags for input",type:"object",properties:{create_if_not_exists:{type:"boolean",description:"If true then the transfer_group will be created if not found. Only valid with 'identifier'",default:!1},return_only_id:{type:"boolean",description:"If true then the returning object is only guaranteed to have id",default:!1}},default:{},$typescript:'{"additionalProperties": false}'},unique_transfer_group_filter:{description:"UNIQUE filtering options for transfer",anyOf:[{$ref:"#/definitions/unique_transfer_group_filter_id"},{$ref:"#/definitions/unique_transfer_group_filter_identifier"}]},unique_transfer_group_filter_id:{type:"object",description:"ID based filter of transfer",properties:{id:{description:"Id of transfer_group to return",$ref:"/db/transfer-group/transfer-group.schema.json#/properties/id"},identifier:{description:"Identifier of transfer_group to return",$ref:"/db/transfer-group/transfer-group.schema.json#/properties/identifier"}},required:["id"],additionalProperties:!1},unique_transfer_group_filter_identifier:{type:"object",description:"identifier based filter of transfer",properties:{id:{description:"Id of transfer_group to return",$ref:"/db/transfer-group/transfer-group.schema.json#/properties/id"},identifier:{description:"Identifier of transfer_group to return",$ref:"/db/transfer-group/transfer-group.schema.json#/properties/identifier"}},required:["identifier"],additionalProperties:!1}},uz=["transfer_group"],dz=!1,iu={$schema:nz,$id:az,title:sz,description:iz,type:oz,properties:pz,definitions:fz,required:uz,additionalProperties:dz};var lz="http://json-schema.org/draft-07/schema",cz="GetTransferGroupTxOutput",mz="GetTransferGroupTxOutput",hz="Output of getTransferGroup",gz="object",_z={transfer_group:{$ref:"#/definitions/transfer_group"}},Tz={transfer_group:{description:"requested transfer_group",properties:{id:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/id"},identifier:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/identifier"},status:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/status"},transfer_status:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/transfer_status"},metadata:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/metadata"},created_at:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/created_at"},updated_at:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/updated_at"},reverses_id:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/reverses_id"},status_finalized_at:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/status_finalized_at"},transfer_status_finalized_at:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/transfer_status_finalized_at"},type:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/type"},validate_final_balance_only:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/validate_final_balance_only"},reverses_identifier:{description:"Identifier of the transfer group this reverses",type:["string","null"]}},additionalProperties:!1,required:["id"]}},yz=!1,ou={$schema:lz,$id:cz,title:mz,description:hz,type:gz,properties:_z,definitions:Tz,additionalProperties:yz};var bz="http://json-schema.org/draft-07/schema",xz="GetWalletTxInput",Fz="GetWalletTxInput",wz="Input for getWallet",$z="object",Oz={wallet:{$ref:"#/definitions/unique_wallet_filter"},options:{$ref:"#/definitions/get_wallet_tx_options"}},vz={get_wallet_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/get_wallet_additional_options"}]},get_wallet_additional_options:{description:"Optional flags for input",type:"object",properties:{ignore_cache:{type:"boolean",default:!1},create_if_not_exists:{type:"boolean",description:"If true then the wallet will be created if not found. Only valid with 'foreign'",default:!1},return_only_id:{type:"boolean",description:"If true then the returning object is only guaranteed to have id",default:!1}},default:{},$typescript:'{"additionalProperties": false}'},unique_wallet_filter:{type:"object",description:"UNIQUE filtering options for wallet",anyOf:[{$ref:"#/definitions/unique_wallet_filter_id"},{$ref:"#/definitions/unique_wallet_filter_foreign"}]},unique_wallet_filter_id:{type:"object",description:"ID based filter for wallet",properties:{id:{description:"Id of wallet to return",$ref:"/db/wallet/wallet.schema.json#/properties/id"},foreign:{description:"Foreign of wallet to return",$ref:"/db/wallet/wallet.schema.json#/properties/name"}},required:["id"],additionalProperties:!1},unique_wallet_filter_foreign:{type:"object",description:"Foreign based filter for wallet",properties:{id:{description:"Id of wallet to return",$ref:"/db/wallet/wallet.schema.json#/properties/id"},foreign:{description:"Foreign of wallet to return",$ref:"/db/wallet/wallet.schema.json#/properties/name"}},required:["foreign"],additionalProperties:!1}},jz=["wallet"],Iz=!1,pu={$schema:bz,$id:xz,title:Fz,description:wz,type:$z,properties:Oz,definitions:vz,required:jz,additionalProperties:Iz};var kz="http://json-schema.org/draft-07/schema",Sz="GetWalletTxOutput",Cz="GetWalletTxOutput",Pz="Output of getWallet",Gz="object",Dz={wallet:{description:"requested wallet",anyOf:[{$ref:"/db/wallet/wallet.schema.json"},{$ref:"/db/wallet/wallet.schema.optional.json"}]}},Mz=!1,fu={$schema:kz,$id:Sz,title:Cz,description:Pz,type:Gz,properties:Dz,additionalProperties:Mz};var Wz="http://json-schema.org/draft-07/schema",Ez="GetWalletManyTxInput",Rz="GetWalletManyTxInput",Az="Input for getWalletMany",Uz="object",qz={wallets:{type:"array",items:{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}},options:{$ref:"#/definitions/get_wallet_many_tx_options"}},Nz={get_wallet_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/get_wallet_many_additional_options"}]},get_wallet_many_additional_options:{description:"Optional flags for input",type:"object",properties:{ignore_cache:{type:"boolean",default:!1},create_if_not_exists:{type:"boolean",description:"If true then the wallet will be created if not found. Only valid with 'foreign'",default:!1},return_only_id:{type:"boolean",description:"If true then the returning object is only guaranteed to have id",default:!1}},default:{},$typescript:'{"additionalProperties": false}'}},Bz=!1,uu={$schema:Wz,$id:Ez,title:Rz,description:Az,type:Uz,properties:qz,definitions:Nz,additionalProperties:Bz};var Lz="http://json-schema.org/draft-07/schema",Vz="GetWalletManyTxOutput",Hz="GetWalletManyTxOutput",zz="Output of getWalletMany",Kz="object",Qz={wallets:{type:"array",items:{$ref:"#/definitions/WalletResult"}}},Jz={WalletResult:{anyOf:[{$ref:"/db/wallet/wallet.schema.json"},{$ref:"/db/wallet/wallet.schema.optional.json"},{type:"null"}]}},Xz=["wallets"],Yz=!1,du={$schema:Lz,$id:Vz,title:Hz,description:zz,type:Kz,properties:Qz,definitions:Jz,required:Xz,additionalProperties:Yz};var Zz="http://json-schema.org/draft-07/schema",eK="ImportActionsTxInput",tK="ImportActionsTxInput",rK="Input for importActions",nK="object",aK={actions:{type:"array",items:{$ref:"#/definitions/import_actions_tx_stream_chunk"}},options:{$ref:"#/definitions/import_actions_tx_options"}},sK=["actions"],iK={import_actions_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"}]},import_actions_tx_stream_chunk:{type:"object",anyOf:[{$ref:"#/definitions/import_action_wallet"},{$ref:"#/definitions/import_action_token"},{$ref:"#/definitions/import_action_transfer_group"},{$ref:"#/definitions/import_action_transfer"}]},import_action_wallet:{type:"object",properties:{target:{description:"Target of the action",type:"string",enum:["wallet"]},data:{$ref:"/db/wallet/wallet.schema.input.json"}},required:["target","data"],additionalProperties:!1},import_action_token:{type:"object",properties:{target:{description:"Target of the action",type:"string",enum:["token"]},data:{$ref:"/txs/create-token/create-token.schema.input.json#/definitions/create_token_input"}},required:["target","data"],additionalProperties:!1},import_action_transfer_group_extension:{type:"object",properties:{created_at:{type:"string",format:"date-time"},status_finalized_at:{type:"string",format:"date-time"},transfer_status_finalized_at:{type:"string",format:"date-time"}},$typescript:'{"additionalProperties": false}'},import_action_transfer_group_data:{allOf:[{$ref:"/txs/create-transfer-group/create-transfer-group.schema.input.json#/definitions/transfer_group_data"},{$ref:"#/definitions/import_action_transfer_group_extension"}]},import_action_transfer_group:{type:"object",properties:{target:{description:"Target of the action",type:"string",enum:["transfer_group"]},data:{allOf:[{$ref:"#/definitions/import_action_transfer_group_data"}]}},required:["target","data"],additionalProperties:!1},import_action_transfer_data:{anyOf:[{$ref:"#/definitions/import_action_transfer_data_regular"},{$ref:"#/definitions/import_action_transfer_data_deposit"},{$ref:"#/definitions/import_action_transfer_data_withdrawal"}]},import_action_transfer_data_regular:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},from_wallet:{description:"Wallet where funds are debited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_wallet:{description:"Wallet where funds are credited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{description:"Token that is moved",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},amount:{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},type:{description:"Type of transfer",enum:["transfer"]},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},status:{$ref:"/db/consts.schema.json#/definitions/TransferStatus"},transfer_group:{description:"TransferGroup the transfer belongs to",$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"},created_at:{type:"string",format:"date-time"},status_finalized_at:{type:"string",format:"date-time"}},required:["from_wallet","to_wallet","token","amount","type"],$typescript:'{"additionalProperties": false}'},import_action_transfer_data_deposit:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},from_wallet:{description:"Wallet where funds are debited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_wallet:{description:"Wallet where funds are credited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{description:"Token that is moved",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},amount:{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},type:{description:"Type of transfer",enum:["deposit"]},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},status:{$ref:"/db/consts.schema.json#/definitions/TransferStatus"},transfer_group:{description:"TransferGroup the transfer belongs to",$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"},created_at:{type:"string",format:"date-time"},status_finalized_at:{type:"string",format:"date-time"}},required:["to_wallet","token","amount"],$typescript:'{"additionalProperties": false}'},import_action_transfer_data_withdrawal:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},from_wallet:{description:"Wallet where funds are debited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_wallet:{description:"Wallet where funds are credited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{description:"Token that is moved",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},amount:{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},type:{description:"Type of transfer",enum:["withdrawal"]},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},status:{$ref:"/db/consts.schema.json#/definitions/TransferStatus"},transfer_group:{description:"TransferGroup the transfer belongs to",$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"},created_at:{type:"string",format:"date-time"},status_finalized_at:{type:"string",format:"date-time"}},required:["from_wallet","token","amount"],$typescript:'{"additionalProperties": false}'},import_action_transfer:{type:"object",properties:{target:{description:"Target of the action",type:"string",enum:["transfer"]},data:{allOf:[{$ref:"#/definitions/import_action_transfer_data"}]}},required:["target","data"],additionalProperties:!1}},oK="import_actions_tx_stream_chunk",pK=!1,Us={$schema:Zz,$id:eK,title:tK,description:rK,type:nK,properties:aK,required:sK,definitions:iK,$allowStreamInput:oK,additionalProperties:pK};var fK="http://json-schema.org/draft-07/schema",uK="ImportActionsTxOutput",dK="ImportActionsTxOutput",lK="Output of importActions",cK="object",mK={progress:{type:"array"},erroneous:{type:"array"}},hK=!1,lu={$schema:fK,$id:uK,title:dK,description:lK,type:cK,properties:mK,additionalProperties:hK};var gK="http://json-schema.org/draft-07/schema",_K="ImportDatabaseTxInput",TK="ImportDatabaseTxInput",yK="Input for importDatabase",bK="object",xK={name:{type:"string"}},FK={},wK=!1,cu={$schema:gK,$id:_K,title:TK,description:yK,type:bK,properties:xK,definitions:FK,additionalProperties:wK};var $K="http://json-schema.org/draft-07/schema",OK="ImportDatabaseTxOutput",vK="ImportDatabaseTxOutput",jK="Output of importDatabase",IK="object",kK={message:{type:"string"}},SK=!1,mu={$schema:$K,$id:OK,title:vK,description:jK,type:IK,properties:kK,additionalProperties:SK};var CK="http://json-schema.org/draft-07/schema",PK="ListDatabaseBackupsTxInput",GK="ListDatabaseBackupsTxInput",DK="Input for listDatabaseBackups",MK="object",WK={},EK={},RK=!1,hu={$schema:CK,$id:PK,title:GK,description:DK,type:MK,properties:WK,definitions:EK,additionalProperties:RK};var AK="http://json-schema.org/draft-07/schema",UK="ListDatabaseBackupsTxOutput",qK="ListDatabaseBackupsTxOutput",NK="Output of listDatabaseBackups",BK="object",LK={backups:{type:"array",items:{type:"string"}}},VK=!1,gu={$schema:AK,$id:UK,title:qK,description:NK,type:BK,properties:LK,additionalProperties:VK};var HK="http://json-schema.org/draft-07/schema",zK="QueryTxInput",KK="QueryTxInput",QK="Input for query",JK="object",XK={query:{description:"SELECT query",type:"string"},params:{description:"Parameters for the query",type:"array"},options:{$ref:"#/definitions/query_tx_options"}},YK={query_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options_without_tx"}]}},ZK=["query","params"],e3=!1,_u={$schema:HK,$id:zK,title:KK,description:QK,type:JK,properties:XK,definitions:YK,required:ZK,additionalProperties:e3};var t3="http://json-schema.org/draft-07/schema",r3="QueryTxOutput",n3="QueryTxOutput",a3="Output of query",s3="object",i3={results:{description:"The query results",type:"array"}},o3=["results"],p3=!1,Tu={$schema:t3,$id:r3,title:n3,description:a3,type:s3,properties:i3,required:o3,additionalProperties:p3};var f3="http://json-schema.org/draft-07/schema",u3="QueryLogsTxInput",d3="QueryLogsTxInput",l3="Input for queryLogs",c3="object",m3={startTime:{description:"Log entries start time",type:"string"},endTime:{description:"Log entries end time",type:"string"},tracking_id:{type:"string"},level:{type:"string",enum:["debug","info","warning","error"]},options:{$ref:"#/definitions/query_logs_tx_options"}},h3={query_logs_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/query_logs_additional_options"}]},query_logs_additional_options:{description:"Optional flags for input",type:"object",default:{exact_level:!1},properties:{exact_level:{description:"Should query be limited to exactly defined level or greater than",type:"boolean"}},$typescript:'{"additionalProperties":false}'}},g3=!1,yu={$schema:f3,$id:u3,title:d3,description:l3,type:c3,properties:m3,definitions:h3,additionalProperties:g3};var _3="http://json-schema.org/draft-07/schema",T3="QueryLogsTxOutput",y3="QueryLogsTxOutput",b3="Output of queryLogs",x3="object",F3={logs:{type:"array",items:{$ref:"#/definitions/query_log_entry"}}},w3={query_log_entry:{type:"object",properties:{level:{description:"Log level",type:"string",enum:["debug","info","warning","error"]},timestamp:{description:"Timestamp when log was created",type:"string"},payload:{description:"Log payload",type:"object"}},additionalProperties:!1}},$3=["logs"],O3=!1,bu={$schema:_3,$id:T3,title:y3,description:b3,type:x3,properties:F3,definitions:w3,required:$3,additionalProperties:O3};var v3="http://json-schema.org/draft-07/schema",j3="ResetDatabaseTxInput",I3="ResetDatabaseTxInput",k3="Input for resetDatabase",S3="object",C3={confirmation:{description:"hash to confirm database delete",type:"string"},version:{description:"target semver for the database",type:"string"},options:{$ref:"#/definitions/reset_database_tx_options"}},P3={reset_database_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options_without_tx"}]}},G3=!1,xu={$schema:v3,$id:j3,title:I3,description:k3,type:S3,properties:C3,definitions:P3,additionalProperties:G3};var D3="http://json-schema.org/draft-07/schema",M3="ResetDatabaseTxOutput",W3="ResetDatabaseTxOutput",E3="Output of resetDatabase",R3="object",A3={message:{description:"Message about operation",type:"string"},confirmation:{description:"confirmation hash to resend",type:"string"}},U3=!1,Fu={$schema:D3,$id:M3,title:W3,description:E3,type:R3,properties:A3,additionalProperties:U3};var q3="http://json-schema.org/draft-07/schema",N3="ReverseTransferTxInput",B3="ReverseTransferTxInput",L3="Input for reverseTransfer",V3="object",H3={transfer:{$ref:"/txs/get-transfer/get-transfer.schema.input.json#/definitions/unique_transfer_filter"},reverse:{$ref:"#/definitions/transfer_reverse_modifications"},options:{$ref:"#/definitions/reverse_transfer_tx_options"}},z3={reverse_transfer_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/reverse_transfer_additional_options"}]},reverse_transfer_additional_options:{description:"Optional flags for input",type:"object",default:{},properties:{reverse_deposit:{$id:"reverse_deposit",description:"Whether to create withdrawal transaction for deposit (will default to pending)",type:"boolean",default:!1},reverse_withdrawal:{$id:"reverse_withdrawal",description:"Whether to create deposit transaction for withdrawal (will default to pending)",type:"boolean",default:!1},return_from_balance:{$id:"return_from_balance",description:"Whether the request should also return from wallet balance",type:"boolean",default:!1},return_to_balance:{$id:"return_to_balance",description:"Whether the request should also return to wallet balance",type:"boolean",default:!1},metadata_action:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action_for_reverse"}},$typescript:'{"additionalProperties": false}'},transfer_reverse_modifications:{description:"In case the transfer will be made then apply these modifications",type:"object",properties:{status:{$ref:"/db/transfer/transfer.schema.input.json#/properties/status"},identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},extend_metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"}},default:{},additionalProperties:!1}},K3=["transfer"],Q3=!1,wu={$schema:q3,$id:N3,title:B3,description:L3,type:V3,properties:H3,definitions:z3,required:K3,additionalProperties:Q3};var J3="http://json-schema.org/draft-07/schema",X3="ReverseTransferTxOutput",Y3="ReverseTransferTxOutput",Z3="Output of reverseTransfer",e5=[{$ref:"/txs/update-transfer/update-transfer.schema.output.json"}],$u={$schema:J3,$id:X3,title:Y3,description:Z3,allOf:e5};var t5="http://json-schema.org/draft-07/schema",r5="ReverseTransferGroupTxInput",n5="ReverseTransferGroupTxInput",a5="Input for reverseTransferGroup",s5="object",i5={transfer_group:{$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"},reverse:{$ref:"#/definitions/reverse_transfer_group_modifications"},options:{$ref:"#/definitions/reverse_transfer_group_tx_options"}},o5={reverse_transfer_group_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/reverse_transfer_group_additional_options"}]},reverse_transfer_group_additional_options:{description:"Optional flags for input",type:"object",default:{},properties:{reverse_deposit:{$id:"reverse_deposit",description:"Whether to create withdrawal transaction for deposits (will default to pending)",type:"boolean",default:!1},reverse_withdrawal:{$id:"reverse_withdrawal",description:"Whether to create deposit transaction for withdrawals (will default to pending)",type:"boolean",default:!1},return_transfers:{description:"Should the update return all transfers belonging to group",type:"boolean"},validate_final_balance_only:{type:"boolean",description:"If true then transfers within a group will ignore balance restrictions. Only final transfers for wallets are checked.",default:!1},metadata_action:{$id:"metadata_action",$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action_for_reverse"},transfer_metadata_action:{$id:"transfer_metadata_action",$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action_for_reverse"}},$typescript:'{"additionalProperties": false}'},reverse_transfer_group_modifications:{description:"In case the transferGroup will be made then apply these modifications",type:"object",properties:{status:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/status"},transfer_status:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/transfer_status"},identifier:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/identifier"},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/metadata"},transfer_metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},extend_metadata:{description:"Key value object to be merged with existing metadata",$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/metadata"},transfer_extend_metadata:{description:"Key value object to be merged with each transfers existing metadata",$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"}},default:{},additionalProperties:!1}},p5=!1,Ou={$schema:t5,$id:r5,title:n5,description:a5,type:s5,properties:i5,definitions:o5,additionalProperties:p5};var f5="http://json-schema.org/draft-07/schema",u5="ReverseTransferGroupTxOutput",d5="ReverseTransferGroupTxOutput",l5="Output of reverseTransferGroup",c5="object",m5={transfer_group:{$ref:"/db/transfer-group/transfer-group.schema.json"},transfers:{description:"Created transfer objects",type:"array",items:{$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"}}},h5=!1,vu={$schema:f5,$id:u5,title:d5,description:l5,type:c5,properties:m5,additionalProperties:h5};var g5="http://json-schema.org/draft-07/schema",_5="ReverseTransferGroupManyTxInput",T5="ReverseTransferGroupManyTxInput",y5="Input for reverseTransferGroupMany",b5="object",x5={transfer_group:{$ref:"/txs/find-transfer-group-many/find-transfer-group-many.schema.input.json#/definitions/find_transfer_group_many_filter"},reverse:{$ref:"#/definitions/reverse_transfer_group_many_modifications"},options:{$ref:"#/definitions/reverse_transfer_group_many_tx_options"}},F5={reverse_transfer_group_many_modifications:{description:"In case the transferGroup will be made then apply these modifications",type:"object",properties:{status:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/status"},transfer_status:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/transfer_status"},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/metadata"},transfer_metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},extend_metadata:{description:"Key value object to be merged with existing metadata",$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/metadata"},transfer_extend_metadata:{description:"Key value object to be merged with each transfers existing metadata",$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"}},default:{},additionalProperties:!1},reverse_transfer_group_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"/txs/reverse-transfer-group/reverse-transfer-group.schema.input.json#/definitions/reverse_transfer_group_additional_options"}]},reverse_transfer_group_many_additional_options:{description:"Optional flags for input",type:"object",default:{},$typescript:'{"additionalProperties":false}'}},w5=["transfer_group"],$5=!1,ju={$schema:g5,$id:_5,title:T5,description:y5,type:b5,properties:x5,definitions:F5,required:w5,additionalProperties:$5};var O5="http://json-schema.org/draft-07/schema",v5="ReverseTransferGroupManyTxOutput",j5="ReverseTransferGroupManyTxOutput",I5="Output of reverseTransferGroupMany",k5="object",S5={transfer_groups:{description:"Reversed transfer groups",type:"array",items:{$ref:"/db/transfer-group/transfer-group.schema.json"}},transfers:{description:"Created transfer objects",type:"array",items:{$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"}}},C5=!1,Iu={$schema:O5,$id:v5,title:j5,description:I5,type:k5,properties:S5,additionalProperties:C5};var P5="http://json-schema.org/draft-07/schema",G5="ReverseTransferManyTxInput",D5="ReverseTransferManyTxInput",M5="Input for reverseTransferMany",W5="object",E5={transfer:{$ref:"/txs/find-transfer-many/find-transfer-many.schema.input.json#/definitions/find_transfer_many_filter"},reverse:{$ref:"#/definitions/reverse_transfer_many_modifications"},options:{$ref:"#/definitions/reverse_transfer_many_tx_options"}},R5={reverse_transfer_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/reverse_transfer_many_additional_options"}]},reverse_transfer_many_additional_options:{description:"Optional flags for input",type:"object",default:{},properties:{reverse_deposit:{$id:"reverse_deposit",description:"Whether to create withdrawal transaction for deposit (will default to pending)",type:"boolean",default:!1},reverse_withdrawal:{$id:"reverse_withdrawal",description:"Whether to create deposit transaction for withdrawal (will default to pending)",type:"boolean",default:!1},metadata_action:{$id:"metadata_action",$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action_for_reverse"}},$typescript:'{"additionalProperties": false}'},reverse_transfer_many_modifications:{description:"In case the transfer will be made then apply these modifications",type:"object",properties:{status:{$ref:"/db/transfer/transfer.schema.input.json#/properties/status"},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"}},default:{},additionalProperties:!1}},A5=["transfer"],U5=!1,ku={$schema:P5,$id:G5,title:D5,description:M5,type:W5,properties:E5,definitions:R5,required:A5,additionalProperties:U5};var q5="http://json-schema.org/draft-07/schema",N5="ReverseTransferManyTxOutput",B5="ReverseTransferManyTxOutput",L5="Output of reverseTransferMany",V5={transfers:{description:"Created transfer array",type:"array",items:{$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"}}},H5=!1,Su={$schema:q5,$id:N5,title:B5,description:L5,properties:V5,additionalProperties:H5};var z5="http://json-schema.org/draft-07/schema",K5="SetFlagsTxInput",Q5="SetFlagsTxInput",J5="Input for setFlags",X5="object",Y5={flags:{$ref:"/db/consts.schema.json#/definitions/Flags"},options:{$ref:"#/definitions/set_flags_tx_options"}},Z5={set_flags_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options_without_tx"}]}},eQ=["flags"],tQ=!1,Cu={$schema:z5,$id:K5,title:Q5,description:J5,type:X5,properties:Y5,definitions:Z5,required:eQ,additionalProperties:tQ};var rQ="http://json-schema.org/draft-07/schema",nQ="SetFlagsTxOutput",aQ="SetFlagsTxOutput",sQ="Output of setFlags",iQ="object",oQ={flags:{$ref:"/db/consts.schema.json#/definitions/Flags"},message:{description:"optional message",type:"string"}},pQ=["flags"],fQ=!1,Pu={$schema:rQ,$id:nQ,title:aQ,description:sQ,type:iQ,properties:oQ,required:pQ,additionalProperties:fQ};var uQ="http://json-schema.org/draft-07/schema",dQ="StartTransactionTxInput",lQ="StartTransactionTxInput",cQ="Input for startTransaction",mQ="object",hQ={options:{$ref:"#/definitions/start_transaction_tx_options"}},gQ={start_transaction_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options_without_tx"}]}},_Q=!1,Gu={$schema:uQ,$id:dQ,title:lQ,description:cQ,type:mQ,properties:hQ,definitions:gQ,additionalProperties:_Q};var TQ="http://json-schema.org/draft-07/schema",yQ="StartTransactionTxOutput",bQ="StartTransactionTxOutput",xQ="Output of startTransaction",FQ="object",wQ={transaction_id:{type:"string"}},$Q=!1,Du={$schema:TQ,$id:yQ,title:bQ,description:xQ,type:FQ,properties:wQ,additionalProperties:$Q};var OQ="http://json-schema.org/draft-07/schema",vQ="TxConsts",jQ="Generics used by functions",IQ={i_tx_general_options_without_tx:{description:"Generic flags for input",type:"object",default:{},properties:{tracking_id:{description:"User provided id added to logs for debugging",type:"string"}},$typescript:'{"additionalProperties":false}'},i_tx_general_options:{description:"Generic flags for input",type:"object",default:{},properties:{transaction_id:{description:"Id of the transaction context to run the query in",type:"string"},tracking_id:{description:"User provided id added to logs for debugging",type:"string"}},$typescript:'{"additionalProperties":false}'},i_tx_metadata_options:{description:"Metadata flags for input",type:"object",default:{},properties:{return_metadata_total:{description:"Return the total rows count in metadata",type:"boolean"}},$typescript:'{"additionalProperties":false}'},i_tx_limiting_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags for input limiting",type:"object",properties:{limit:{description:"Number of records to return",type:"integer"},offset:{description:"Number of records to omit from the beginning",type:"integer"}},default:{limit:20,offset:0}},i_tx_ordering_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags for input ordering",type:"object",properties:{order:{description:"Ordering options",type:"array",items:{$ref:"#/definitions/i_tx_ordering_input"}}}},i_tx_select_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags to limit search result",type:"object",properties:{select:{description:"Select options",type:"array",items:{type:"string"}}}},i_tx_deselect_options:{$typescript:'{"additionalProperties":false}',description:"Optional flag to remove field from select",type:"object",properties:{deselect:{description:"Deselect options",type:"array",items:{type:"string"}}}},i_tx_aggregating_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags to aggregate data",type:"object",properties:{aggregator:{$ref:"#/definitions/i_tx_aggregator"},aggregators:{type:"array",items:{$ref:"#/definitions/i_tx_aggregator"}},groups:{$ref:"#/definitions/i_tx_groups"}}},i_tx_find_metadata:{description:"Metadata about the search",type:"object",properties:{total:{description:"Total number of records matching the query",type:"integer"},offset:{description:"Current query offset",type:"integer"},limit:{description:"Current query limit",type:"integer"},more_rows:{description:"Boolean showing if there would be more rows to return with a higher offset/limit",type:"boolean"},order:{description:"Ordering options",type:"array",items:{$ref:"#/definitions/i_tx_ordering_input"}}},required:["offset","limit","more_rows"],additionalProperties:!1},i_tx_aggregating_metadata:{description:"Metadata about the aggregation",type:"object",properties:{aggregators:{type:"array",items:{$ref:"#/definitions/i_tx_aggregator"}},groups:{$ref:"#/definitions/i_tx_groups"}},required:["aggregators"],additionalProperties:!1},i_tx_ordering_input:{description:"Input for orderBy",type:"object",properties:{field:{description:"Field to order by",type:"string"},direction:{description:"Direction to order",default:"asc",type:"string",enum:["asc","desc"]},nulls:{description:"Should nulls be first or last",type:"string",enum:["first","last"]}},required:["field"],additionalProperties:!1},i_tx_groups:{type:"array",maxItems:5,items:{$ref:"#/definitions/i_tx_group"}},i_tx_group:{anyOf:[{$ref:"#/definitions/i_tx_group_period"},{$ref:"#/definitions/i_tx_group_field"},{$ref:"#/definitions/i_tx_group_metadata_field"}]},i_tx_group_period:{type:"object",properties:{type:{type:"string",enum:["period"]},field:{$ref:"#/definitions/i_tx_period"},alias:{type:"string"}},required:["type","field"],additionalProperties:!1},i_tx_group_field:{type:"object",properties:{type:{type:"string",enum:["field"]},field:{type:"string"},alias:{type:"string"}},required:["type","field"],additionalProperties:!1},i_tx_group_metadata_field:{type:"object",properties:{type:{type:"string",enum:["metadata_field"]},field:{type:"string"},alias:{type:"string"}},required:["type","field"],additionalProperties:!1},i_tx_period:{anyOf:[{$ref:"#/definitions/i_tx_period_simple"},{$ref:"#/definitions/i_tx_period_timezone"}]},i_tx_period_simple:{description:"Time period rows should be grouped by",type:"string",enum:["year","month","week","day","hour","minute"],default:"day"},i_tx_period_timezone:{type:"object",properties:{period:{$ref:"#/definitions/i_tx_period_simple"},timezone:{description:"",type:"string"}},required:["period","timezone"],additionalProperties:!1},i_tx_time_filter:{type:"object",properties:{start_time:{type:"string",format:"date-time"},end_time:{type:"string",format:"date-time"}},$typescript:'{"additionalProperties":false}'},i_tx_aggregator:{description:"Aggregator description",anyOf:[{$ref:"#/definitions/i_tx_aggregator_simple"},{$ref:"#/definitions/i_tx_aggregator_complex"}]},i_tx_aggregator_simple:{description:"Function to use for grouping",type:"string",enum:["count","countDistinct","sum","average","min","max"],default:"count"},i_tx_aggregator_complex:{description:"Function and field to group",type:"object",properties:{function:{$ref:"#/definitions/i_tx_aggregator_simple"},field:{description:"Field to group by",type:"string"},alias:{description:"Alias to group under",type:"string"}},$typescript:'{"additionalProperties":false}'},i_tx_aggregate_results:{type:"array",items:{$ref:"#/definitions/i_tx_aggregate_result"}},i_tx_aggregate_result:{type:"object",additionalProperties:{type:["string","number"]}},i_tx_distributor_leftover_rule:{description:"Rule for distribution grouping",type:"string",enum:["keep","random","largest","target"]},i_tx_metadata_action:{description:"Whether to replace or extend current metadata with new value",type:"string",enum:["replace","extend"],default:"replace"},i_tx_metadata_action_for_reverse:{description:"Whether to replace or extend current metadata with new value",type:"string",enum:["replace","replace_create_only","replace_cancel_only","extend","extend_create_only","extend_cancel_only"],default:"replace"}},Wu={$schema:OQ,$id:vQ,description:jQ,definitions:IQ};var kQ="http://json-schema.org/draft-07/schema",SQ="UpdateTokenTxInput",CQ="UpdateTokenTxInput",PQ="Input for updateToken",GQ="object",DQ={token:{$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},update:{$ref:"#/definitions/update_token_fields"},options:{$ref:"#/definitions/update_token_tx_options"}},MQ={update_token_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/update_token_additional_options"}]},update_token_additional_options:{description:"Optional flags for input",type:"object",default:{},$typescript:'{"additionalProperties":false}',properties:{return_when_not_updated:{$id:"return_when_not_updated",description:"Whether the request should return the token object even if it was not updated",type:"boolean",default:!1}}},update_token_fields:{type:"object",$typescript:'{"additionalProperties":false}',properties:{metadata:{$ref:"/db/token/token.schema.json#/properties/metadata"},public:{$ref:"/db/token/token.schema.json#/properties/public"},status:{$ref:"/db/token/token.schema.json#/properties/status"}}}},WQ=["token"],EQ=!1,Eu={$schema:kQ,$id:SQ,title:CQ,description:PQ,type:GQ,properties:DQ,definitions:MQ,required:WQ,additionalProperties:EQ};var RQ="http://json-schema.org/draft-07/schema",AQ="UpdateTokenTxOutput",UQ="UpdateTokenTxOutput",qQ="Output of updateToken",NQ="object",BQ={token:{description:"Token object",$ref:"/db/token/token.schema.json"},updated:{description:"Boolean showing if the token was updated",type:"boolean"}},LQ=!1,Ru={$schema:RQ,$id:AQ,title:UQ,description:qQ,type:NQ,properties:BQ,additionalProperties:LQ};var VQ="http://json-schema.org/draft-07/schema",HQ="UpdateTransferTxInput",zQ="UpdateTransferTxInput",KQ="Input for updateTransfer",QQ="object",JQ={transfer:{$ref:"/txs/get-transfer/get-transfer.schema.input.json#/definitions/unique_transfer_filter"},update:{$ref:"#/definitions/update_transfer_fields"},options:{$ref:"#/definitions/update_transfer_tx_options"}},XQ={update_transfer_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/update_transfer_additional_options"}]},update_transfer_additional_options:{description:"Optional flags for input",type:"object",default:{},properties:{return_from_balance:{$id:"return_from_balance",description:"Whether the request should also return from wallet balance",type:"boolean",default:!1},return_to_balance:{$id:"return_to_balance",description:"Whether the request should also return to wallet balance",type:"boolean",default:!1},return_when_not_updated:{$id:"return_when_not_updated",description:"Whether the request should return the transfer object even if it was not updated",type:"boolean",default:!1},metadata_action:{$id:"metadata_action",$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action"}},$typescript:'{"additionalProperties": false}'},update_transfer_fields:{type:"object",properties:{status:{description:"Status the transfer should be set as. Only pending transfers can be updated",default:"finished",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},metadata:{$ref:"/db/transfer/transfer.schema.json#/properties/metadata"},extend_metadata:{$ref:"/db/transfer/transfer.schema.json#/properties/metadata"},updated_at:{$ref:"/db/transfer/transfer.schema.json#/properties/updated_at"}},default:{status:"finished"},additionalProperties:!1}},YQ=["transfer"],ZQ=!1,Au={$schema:VQ,$id:HQ,title:zQ,description:KQ,type:QQ,properties:JQ,definitions:XQ,required:YQ,additionalProperties:ZQ};var e8="http://json-schema.org/draft-07/schema",t8="UpdateTransferTxOutput",r8="UpdateTransferTxOutput",n8="Output of updateTransfer",a8="object",s8={transfer:{description:"Updated transfer object",$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"},updated:{description:"Boolean showing if the transfer was updated",type:"boolean"},from_balance:{description:"Debited wallet balance",$ref:"/txs/get-balance/get-balance.schema.output.json#/definitions/balance"},to_balance:{description:"Credited wallet balance",$ref:"/txs/get-balance/get-balance.schema.output.json#/definitions/balance"}},i8=!1,Uu={$schema:e8,$id:t8,title:r8,description:n8,type:a8,properties:s8,additionalProperties:i8};var o8="http://json-schema.org/draft-07/schema",p8="UpdateTransferGroupTxInput",f8="UpdateTransferGroupTxInput",u8="Input for updateTransferGroup",d8="object",l8={transfer_group:{$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"},update:{$ref:"#/definitions/update_transfer_group_data"},options:{$ref:"#/definitions/update_transfer_group_tx_options"}},c8={update_transfer_group_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options_without_tx"},{$ref:"#/definitions/update_transfer_group_additional_options"}]},update_transfer_group_additional_options:{description:"Optional flags for input",type:"object",default:{},properties:{return_transfers:{description:"Should the update return all transfers belonging to group",type:"boolean"},return_when_not_updated:{$id:"return_to_balance",description:"Whether the request should return the transfer_group object even if it was not updated",type:"boolean",default:!1},metadata_action:{$id:"metadata_action",$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action"},transfer_metadata_action:{$id:"transfer_metadata_action",$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action"}},$typescript:'{"additionalProperties": false}'},update_transfer_group_data:{anyOf:[{$ref:"#/definitions/update_transfer_group_status"},{$ref:"#/definitions/update_transfer_group_transfer_status"}]},update_transfer_group_status:{type:"object",properties:{status:{description:"Lifecycle status of the TransferGroup",$ref:"/db/consts.schema.json#/definitions/TransferGroupStatus"},transfer_status:{description:"Status all the transfers should be set at.",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},metadata:{description:"Key value object to be replaced or extended with existing TransferGroup metadata",$ref:"/db/transfer/transfer.schema.json#/properties/metadata"},transfer_metadata:{description:"Key value object to be replaced or extended with existing Transfer metadata",$ref:"/db/transfer/transfer.schema.json#/properties/metadata"}},required:["status"],additionalProperties:!1},update_transfer_group_transfer_status:{type:"object",properties:{status:{description:"Lifecycle status of the TransferGroup",$ref:"/db/consts.schema.json#/definitions/TransferGroupStatus"},transfer_status:{description:"Status all the transfers should be set at. Changing transfer_status will also close the group",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},metadata:{description:"Key value object to be replaced or extended with existing TransferGroup metadata",$ref:"/db/transfer/transfer.schema.json#/properties/metadata"},transfer_metadata:{description:"Key value object to be replaced or extended with existing Transfer metadata",$ref:"/db/transfer/transfer.schema.json#/properties/metadata"}},required:["transfer_status"],additionalProperties:!1}},m8=["transfer_group"],h8=!1,qu={$schema:o8,$id:p8,title:f8,description:u8,type:d8,properties:l8,definitions:c8,required:m8,additionalProperties:h8};var g8="http://json-schema.org/draft-07/schema",_8="UpdateTransferGroupTxOutput",T8="UpdateTransferGroupTxOutput",y8="Output of updateTransferGroup",b8="object",x8={transfer_group:{$ref:"/db/transfer-group/transfer-group.schema.json"},updated:{description:"Boolean showing if the transfer_group was updated",type:"boolean"},transfers:{description:"Updated transfers",type:"array",items:{$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"}}},F8=!1,Nu={$schema:g8,$id:_8,title:T8,description:y8,type:b8,properties:x8,additionalProperties:F8};var w8="http://json-schema.org/draft-07/schema",$8="UpdateTransferGroupManyTxInput",O8="UpdateTransferGroupManyTxInput",v8="Input for updateTransferGroupMany",j8="object",I8={transfer_group:{$ref:"/txs/find-transfer-group-many/find-transfer-group-many.schema.input.json#/definitions/find_transfer_group_many_filter"},update:{$ref:"/txs/update-transfer-group/update-transfer-group.schema.input.json#/definitions/update_transfer_group_data"},options:{$ref:"/txs/update-transfer-group/update-transfer-group.schema.input.json#/definitions/update_transfer_group_tx_options"}},k8={update_transfer_group_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/update_transfer_group_many_additional_options"}]},update_transfer_group_many_additional_options:{description:"Optional flags for input",type:"object",default:{},$typescript:'{"additionalProperties":false}'}},S8=["transfer_group"],C8=!1,Bu={$schema:w8,$id:$8,title:O8,description:v8,type:j8,properties:I8,definitions:k8,required:S8,additionalProperties:C8};var P8="http://json-schema.org/draft-07/schema",G8="UpdateTransferGroupManyTxOutput",D8="UpdateTransferGroupManyTxOutput",M8="Output of updateTransferGroupMany",W8="object",E8={transfer_groups:{description:"Updated transfer groups",type:"array",items:{$ref:"/db/transfer-group/transfer-group.schema.json"}},updated:{description:"Boolean showing if the transfer_group was updated",type:"boolean"},transfers:{description:"Updated transfers",type:"array",items:{$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"}}},R8=["transfer_groups"],A8=!1,Lu={$schema:P8,$id:G8,title:D8,description:M8,type:W8,properties:E8,required:R8,additionalProperties:A8};var U8="http://json-schema.org/draft-07/schema",q8="UpdateTransferManyTxInput",N8="UpdateTransferManyTxInput",B8="Input for updateTransferMany",L8="object",V8={transfer:{$ref:"/txs/find-transfer-many/find-transfer-many.schema.input.json#/definitions/find_transfer_many_filter"},update:{$ref:"/txs/update-transfer/update-transfer.schema.input.json#/definitions/update_transfer_fields"},options:{$ref:"#/definitions/update_transfer_many_tx_options"}},H8={update_transfer_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options_without_tx"},{$ref:"#/definitions/update_transfer_many_additional_options"}]},update_transfer_many_additional_options:{description:"Optional flags for input",type:"object",default:{},properties:{metadata_action:{$id:"metadata_action",$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action"}},$typescript:'{"additionalProperties": false}'}},z8=["transfer","update"],K8=!1,Vu={$schema:U8,$id:q8,title:N8,description:B8,type:L8,properties:V8,definitions:H8,required:z8,additionalProperties:K8};var Q8="http://json-schema.org/draft-07/schema",J8="UpdateTransferManyTxOutput",X8="UpdateTransferManyTxOutput",Y8="Output of updateTransferMany",Z8="object",e6={transfers:{description:"Updated transfers array",type:"array",items:{$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"}},updated:{description:"Boolean showing if the transfers were updated",type:"boolean"}},t6=!1,Hu={$schema:Q8,$id:J8,title:X8,description:Y8,type:Z8,properties:e6,additionalProperties:t6};var r6="http://json-schema.org/draft-07/schema",n6="UpdateWalletTxInput",a6="UpdateWalletTxInput",s6="Input for updateWallet",i6="object",o6={wallet:{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},update:{$ref:"#/definitions/update_wallet_fields"},options:{$ref:"#/definitions/update_wallet_tx_options"}},p6={update_wallet_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/update_wallet_additional_options"}]},update_wallet_additional_options:{description:"Optional flags for input",type:"object",default:{},properties:{return_when_not_updated:{description:"Whether the request should return the wallet object even if it was not updated",type:"boolean",default:!1}},$typescript:'{"additionalProperties":false}'},update_wallet_fields:{type:"object",properties:{metadata:{$ref:"/db/wallet/wallet.schema.json#/properties/metadata"},name:{$ref:"/db/wallet/wallet.schema.json#/properties/name"},status:{$ref:"/db/wallet/wallet.schema.json#/properties/status"}},$typescript:'{"additionalProperties":false}'}},f6=["wallet"],u6=!1,zu={$schema:r6,$id:n6,title:a6,description:s6,type:i6,properties:o6,definitions:p6,required:f6,additionalProperties:u6};var d6="http://json-schema.org/draft-07/schema",l6="UpdateWalletTxOutput",c6="UpdateWalletTxOutput",m6="Output of updateWallet",h6="object",g6={wallet:{description:"Wallet object",anyOf:[{$ref:"/db/wallet/wallet.schema.json"},{$ref:"/db/wallet/wallet.schema.optional.json"}]},updated:{description:"Boolean showing if the wallet was updated",type:"boolean"}},_6=!1,Ku={$schema:d6,$id:l6,title:c6,description:m6,type:h6,properties:g6,additionalProperties:_6};var m=new cx.default({removeAdditional:!0,useDefaults:!0,coerceTypes:!0,formats:{validkey:/^[A-Za-z_][A-Za-z0-9_-]+?$/},strict:!1});m.addFormat("date-time",{validate:RT});function kh(t,e){if(e!==void 0)return new Ne({message:e,data:t})}function mx(t){return function(e){if(t===void 0)return{isValid:!1,inputCopy:e,error:kh([new Error("Undefined validator")],"Undefined validator")};try{let r=Pd(e),n=t(r),a=n?void 0:t.errors,s=n?void 0:m.errorsText(a),i=kh(a,s);return{isValid:n,inputCopy:r,error:i}}catch(r){return{isValid:!1,inputCopy:e,error:kh([r],r.message)}}}}function g(t,e){let r=JSON.parse(JSON.stringify(t));return hx(r,e)}function hx(t,e){return typeof t!="object"||Object.keys(t).forEach(r=>{r==="$ref"&&t.$ref.startsWith("#")?t.$ref=e+t.$ref:t[r]=hx(t[r],e)}),t}function gx(t,e){let r=g(t,e),n=r.properties.options;return P({$id:r.$id.replace("Input","Options"),definitions:r.definitions},n)}function _x(t,e){let r=g(t,e),n=r.definitions[t.$allowStreamInput];return P({$id:r.$id.replace("Input","StreamChunk"),definitions:r.definitions},n)}var h={};m.addSchema(g(yh,"/api/jsonrpc/jsonrpc.request.schema.json"),"/api/jsonrpc/jsonrpc.request.schema.json");h.JSONRPCRequest=yh;m.addSchema(g(bh,"/api/jsonrpc/jsonrpc.response.schema.json"),"/api/jsonrpc/jsonrpc.response.schema.json");h.JSONRPCResponse=bh;m.addSchema(g(xh,"/client-options.schema.json"),"/client-options.schema.json");h.ClientOptions=xh;m.addSchema(g(cs,"/db/consts.schema.json"),"/db/consts.schema.json");h.Consts=cs;m.addSchema(g(vo,"/db/token/token.schema.input.json"),"/db/token/token.schema.input.json");h.TokenTableInput=vo;m.addSchema(g(jo,"/db/token/token.schema.json"),"/db/token/token.schema.json");h.TokenTable=jo;m.addSchema(g(Fh,"/db/token/token.schema.optional.json"),"/db/token/token.schema.optional.json");h.TokenTableOptional=Fh;m.addSchema(g(Io,"/db/transfer/transfer.schema.input.json"),"/db/transfer/transfer.schema.input.json");h.TransferTableInput=Io;m.addSchema(g(ko,"/db/transfer/transfer.schema.json"),"/db/transfer/transfer.schema.json");h.TransferTable=ko;m.addSchema(g(wh,"/db/transfer/transfer.schema.optional.json"),"/db/transfer/transfer.schema.optional.json");h.TransferTableOptional=wh;m.addSchema(g(So,"/db/transfer-group/transfer-group.schema.input.json"),"/db/transfer-group/transfer-group.schema.input.json");h.TransferGroupTableInput=So;m.addSchema(g(Co,"/db/transfer-group/transfer-group.schema.json"),"/db/transfer-group/transfer-group.schema.json");h.TransferGroupTable=Co;m.addSchema(g($h,"/db/transfer-group/transfer-group.schema.optional.json"),"/db/transfer-group/transfer-group.schema.optional.json");h.TransferGroupTableOptional=$h;m.addSchema(g(Po,"/db/transfer-log/transfer-log.schema.input.json"),"/db/transfer-log/transfer-log.schema.input.json");h.TransferLogTableInput=Po;m.addSchema(g(Go,"/db/transfer-log/transfer-log.schema.json"),"/db/transfer-log/transfer-log.schema.json");h.TransferLogTable=Go;m.addSchema(g(Oh,"/db/transfer-log/transfer-log.schema.optional.json"),"/db/transfer-log/transfer-log.schema.optional.json");h.TransferLogTableOptional=Oh;m.addSchema(g(Do,"/db/wallet/wallet.schema.input.json"),"/db/wallet/wallet.schema.input.json");h.WalletTableInput=Do;m.addSchema(g(Mo,"/db/wallet/wallet.schema.json"),"/db/wallet/wallet.schema.json");h.WalletTable=Mo;m.addSchema(g(vh,"/db/wallet/wallet.schema.optional.json"),"/db/wallet/wallet.schema.optional.json");h.WalletTableOptional=vh;m.addSchema(g(Wo,"/db/wallet-token-setting/wallet-token-setting.schema.input.json"),"/db/wallet-token-setting/wallet-token-setting.schema.input.json");h.WalletTokenSettingTableInput=Wo;m.addSchema(g(Eo,"/db/wallet-token-setting/wallet-token-setting.schema.json"),"/db/wallet-token-setting/wallet-token-setting.schema.json");h.WalletTokenSettingTable=Eo;m.addSchema(g(jh,"/db/wallet-token-setting/wallet-token-setting.schema.optional.json"),"/db/wallet-token-setting/wallet-token-setting.schema.optional.json");h.WalletTokenSettingTableOptional=jh;m.addSchema(g(Ro,"/db/wapi-setting/wapi-setting.schema.input.json"),"/db/wapi-setting/wapi-setting.schema.input.json");h.WapiSettingTableInput=Ro;m.addSchema(g(Ao,"/db/wapi-setting/wapi-setting.schema.json"),"/db/wapi-setting/wapi-setting.schema.json");h.WapiSettingTable=Ao;m.addSchema(g(Ih,"/db/wapi-setting/wapi-setting.schema.optional.json"),"/db/wapi-setting/wapi-setting.schema.optional.json");h.WapiSettingTableOptional=Ih;m.addSchema(g(Uo,"/fns/aggregate-transfers/aggregate-transfers.schema.input.json"),"/fns/aggregate-transfers/aggregate-transfers.schema.input.json");h.AggregateTransfersFnInput=Uo;m.addSchema(g(qo,"/fns/aggregate-transfers/aggregate-transfers.schema.output.json"),"/fns/aggregate-transfers/aggregate-transfers.schema.output.json");h.AggregateTransfersFnOutput=qo;m.addSchema(g(No,"/fns/create-access-token/create-access-token.schema.input.json"),"/fns/create-access-token/create-access-token.schema.input.json");h.CreateAccessTokenFnInput=No;m.addSchema(g(Bo,"/fns/create-access-token/create-access-token.schema.output.json"),"/fns/create-access-token/create-access-token.schema.output.json");h.CreateAccessTokenFnOutput=Bo;m.addSchema(g(Lo,"/fns/create-contract/create-contract.schema.input.json"),"/fns/create-contract/create-contract.schema.input.json");h.CreateContractFnInput=Lo;m.addSchema(g(Vo,"/fns/create-contract/create-contract.schema.output.json"),"/fns/create-contract/create-contract.schema.output.json");h.CreateContractFnOutput=Vo;m.addSchema(g(Ho,"/fns/create-deposit/create-deposit.schema.input.json"),"/fns/create-deposit/create-deposit.schema.input.json");h.CreateDepositFnInput=Ho;m.addSchema(g(zo,"/fns/create-deposit/create-deposit.schema.output.json"),"/fns/create-deposit/create-deposit.schema.output.json");h.CreateDepositFnOutput=zo;m.addSchema(g(Ko,"/fns/create-exchange/create-exchange.schema.input.json"),"/fns/create-exchange/create-exchange.schema.input.json");h.CreateExchangeFnInput=Ko;m.addSchema(g(Qo,"/fns/create-exchange/create-exchange.schema.output.json"),"/fns/create-exchange/create-exchange.schema.output.json");h.CreateExchangeFnOutput=Qo;m.addSchema(g(Jo,"/fns/create-token/create-token.schema.input.json"),"/fns/create-token/create-token.schema.input.json");h.CreateTokenFnInput=Jo;m.addSchema(g(Xo,"/fns/create-token/create-token.schema.output.json"),"/fns/create-token/create-token.schema.output.json");h.CreateTokenFnOutput=Xo;m.addSchema(g(Yo,"/fns/create-transfer/create-transfer.schema.input.json"),"/fns/create-transfer/create-transfer.schema.input.json");h.CreateTransferFnInput=Yo;m.addSchema(g(Zo,"/fns/create-transfer/create-transfer.schema.output.json"),"/fns/create-transfer/create-transfer.schema.output.json");h.CreateTransferFnOutput=Zo;m.addSchema(g(ep,"/fns/create-transfer-group/create-transfer-group.schema.input.json"),"/fns/create-transfer-group/create-transfer-group.schema.input.json");h.CreateTransferGroupFnInput=ep;m.addSchema(g(tp,"/fns/create-transfer-group/create-transfer-group.schema.output.json"),"/fns/create-transfer-group/create-transfer-group.schema.output.json");h.CreateTransferGroupFnOutput=tp;m.addSchema(g(rp,"/fns/create-transfers/create-transfers.schema.input.json"),"/fns/create-transfers/create-transfers.schema.input.json");h.CreateTransfersFnInput=rp;m.addSchema(g(np,"/fns/create-transfers/create-transfers.schema.output.json"),"/fns/create-transfers/create-transfers.schema.output.json");h.CreateTransfersFnOutput=np;m.addSchema(g(ap,"/fns/create-wallet/create-wallet.schema.input.json"),"/fns/create-wallet/create-wallet.schema.input.json");h.CreateWalletFnInput=ap;m.addSchema(g(sp,"/fns/create-wallet/create-wallet.schema.output.json"),"/fns/create-wallet/create-wallet.schema.output.json");h.CreateWalletFnOutput=sp;m.addSchema(g(ip,"/fns/create-withdrawal/create-withdrawal.schema.input.json"),"/fns/create-withdrawal/create-withdrawal.schema.input.json");h.CreateWithdrawalFnInput=ip;m.addSchema(g(op,"/fns/create-withdrawal/create-withdrawal.schema.output.json"),"/fns/create-withdrawal/create-withdrawal.schema.output.json");h.CreateWithdrawalFnOutput=op;m.addSchema(g(pp,"/fns/find-balances/find-balances.schema.input.json"),"/fns/find-balances/find-balances.schema.input.json");h.FindBalancesFnInput=pp;m.addSchema(g(fp,"/fns/find-balances/find-balances.schema.output.json"),"/fns/find-balances/find-balances.schema.output.json");h.FindBalancesFnOutput=fp;m.addSchema(g(up,"/fns/find-tokens/find-tokens.schema.input.json"),"/fns/find-tokens/find-tokens.schema.input.json");h.FindTokensFnInput=up;m.addSchema(g(dp,"/fns/find-tokens/find-tokens.schema.output.json"),"/fns/find-tokens/find-tokens.schema.output.json");h.FindTokensFnOutput=dp;m.addSchema(g(lp,"/fns/find-transfer-groups/find-transfer-groups.schema.input.json"),"/fns/find-transfer-groups/find-transfer-groups.schema.input.json");h.FindTransferGroupsFnInput=lp;m.addSchema(g(cp,"/fns/find-transfer-groups/find-transfer-groups.schema.output.json"),"/fns/find-transfer-groups/find-transfer-groups.schema.output.json");h.FindTransferGroupsFnOutput=cp;m.addSchema(g(mp,"/fns/find-transfers/find-transfers.schema.input.json"),"/fns/find-transfers/find-transfers.schema.input.json");h.FindTransfersFnInput=mp;m.addSchema(g(hp,"/fns/find-transfers/find-transfers.schema.output.json"),"/fns/find-transfers/find-transfers.schema.output.json");h.FindTransfersFnOutput=hp;m.addSchema(g(gp,"/fns/find-wallets/find-wallets.schema.input.json"),"/fns/find-wallets/find-wallets.schema.input.json");h.FindWalletsFnInput=gp;m.addSchema(g(_p,"/fns/find-wallets/find-wallets.schema.output.json"),"/fns/find-wallets/find-wallets.schema.output.json");h.FindWalletsFnOutput=_p;m.addSchema(g(yp,"/fns/fn-consts.schema.json"),"/fns/fn-consts.schema.json");h.FnConsts=yp;m.addSchema(g(bp,"/fns/get-balance/get-balance.schema.input.json"),"/fns/get-balance/get-balance.schema.input.json");h.GetBalanceFnInput=bp;m.addSchema(g(xp,"/fns/get-balance/get-balance.schema.output.json"),"/fns/get-balance/get-balance.schema.output.json");h.GetBalanceFnOutput=xp;m.addSchema(g(Fp,"/fns/get-balance-history/get-balance-history.schema.input.json"),"/fns/get-balance-history/get-balance-history.schema.input.json");h.GetBalanceHistoryFnInput=Fp;m.addSchema(g(wp,"/fns/get-balance-history/get-balance-history.schema.output.json"),"/fns/get-balance-history/get-balance-history.schema.output.json");h.GetBalanceHistoryFnOutput=wp;m.addSchema(g($p,"/fns/get-flags/get-flags.schema.input.json"),"/fns/get-flags/get-flags.schema.input.json");h.GetFlagsFnInput=$p;m.addSchema(g(Op,"/fns/get-flags/get-flags.schema.output.json"),"/fns/get-flags/get-flags.schema.output.json");h.GetFlagsFnOutput=Op;m.addSchema(g(vp,"/fns/get-statistics/get-statistics.schema.input.json"),"/fns/get-statistics/get-statistics.schema.input.json");h.GetStatisticsFnInput=vp;m.addSchema(g(jp,"/fns/get-statistics/get-statistics.schema.output.json"),"/fns/get-statistics/get-statistics.schema.output.json");h.GetStatisticsFnOutput=jp;m.addSchema(g(Ip,"/fns/get-token/get-token.schema.input.json"),"/fns/get-token/get-token.schema.input.json");h.GetTokenFnInput=Ip;m.addSchema(g(kp,"/fns/get-token/get-token.schema.output.json"),"/fns/get-token/get-token.schema.output.json");h.GetTokenFnOutput=kp;m.addSchema(g(Sp,"/fns/get-transfer/get-transfer.schema.input.json"),"/fns/get-transfer/get-transfer.schema.input.json");h.GetTransferFnInput=Sp;m.addSchema(g(Cp,"/fns/get-transfer/get-transfer.schema.output.json"),"/fns/get-transfer/get-transfer.schema.output.json");h.GetTransferFnOutput=Cp;m.addSchema(g(Pp,"/fns/get-transfer-group/get-transfer-group.schema.input.json"),"/fns/get-transfer-group/get-transfer-group.schema.input.json");h.GetTransferGroupFnInput=Pp;m.addSchema(g(Gp,"/fns/get-transfer-group/get-transfer-group.schema.output.json"),"/fns/get-transfer-group/get-transfer-group.schema.output.json");h.GetTransferGroupFnOutput=Gp;m.addSchema(g(Dp,"/fns/get-wallet/get-wallet.schema.input.json"),"/fns/get-wallet/get-wallet.schema.input.json");h.GetWalletFnInput=Dp;m.addSchema(g(Mp,"/fns/get-wallet/get-wallet.schema.output.json"),"/fns/get-wallet/get-wallet.schema.output.json");h.GetWalletFnOutput=Mp;m.addSchema(g(Ss,"/fns/import-data/import-data.schema.input.json"),"/fns/import-data/import-data.schema.input.json");h.ImportDataFnInput=Ss;var Tx=gx(Ss,"/fns/import-data/import-data.schema.input.json");m.addSchema(Tx,"/fns/import-data/import-data.schema.options.json");h.ImportDataFnOptions=Tx;var yx=_x(Ss,"/fns/import-data/import-data.schema.input.json");m.addSchema(yx,"/fns/import-data/import-data.schema.chunk.json");h.ImportDataFnStreamChunk=yx;m.addSchema(g(Wp,"/fns/import-data/import-data.schema.output.json"),"/fns/import-data/import-data.schema.output.json");h.ImportDataFnOutput=Wp;m.addSchema(g(Ep,"/fns/reverse-transfer/reverse-transfer.schema.input.json"),"/fns/reverse-transfer/reverse-transfer.schema.input.json");h.ReverseTransferFnInput=Ep;m.addSchema(g(Rp,"/fns/reverse-transfer/reverse-transfer.schema.output.json"),"/fns/reverse-transfer/reverse-transfer.schema.output.json");h.ReverseTransferFnOutput=Rp;m.addSchema(g(Ap,"/fns/reverse-transfer-group/reverse-transfer-group.schema.input.json"),"/fns/reverse-transfer-group/reverse-transfer-group.schema.input.json");h.ReverseTransferGroupFnInput=Ap;m.addSchema(g(Up,"/fns/reverse-transfer-group/reverse-transfer-group.schema.output.json"),"/fns/reverse-transfer-group/reverse-transfer-group.schema.output.json");h.ReverseTransferGroupFnOutput=Up;m.addSchema(g(qp,"/fns/reverse-transfers/reverse-transfers.schema.input.json"),"/fns/reverse-transfers/reverse-transfers.schema.input.json");h.ReverseTransfersFnInput=qp;m.addSchema(g(Np,"/fns/reverse-transfers/reverse-transfers.schema.output.json"),"/fns/reverse-transfers/reverse-transfers.schema.output.json");h.ReverseTransfersFnOutput=Np;m.addSchema(g(Bp,"/fns/set-flags/set-flags.schema.input.json"),"/fns/set-flags/set-flags.schema.input.json");h.SetFlagsFnInput=Bp;m.addSchema(g(Lp,"/fns/set-flags/set-flags.schema.output.json"),"/fns/set-flags/set-flags.schema.output.json");h.SetFlagsFnOutput=Lp;m.addSchema(g(Vp,"/fns/update-token/update-token.schema.input.json"),"/fns/update-token/update-token.schema.input.json");h.UpdateTokenFnInput=Vp;m.addSchema(g(Hp,"/fns/update-token/update-token.schema.output.json"),"/fns/update-token/update-token.schema.output.json");h.UpdateTokenFnOutput=Hp;m.addSchema(g(zp,"/fns/update-transfer/update-transfer.schema.input.json"),"/fns/update-transfer/update-transfer.schema.input.json");h.UpdateTransferFnInput=zp;m.addSchema(g(Kp,"/fns/update-transfer/update-transfer.schema.output.json"),"/fns/update-transfer/update-transfer.schema.output.json");h.UpdateTransferFnOutput=Kp;m.addSchema(g(Qp,"/fns/update-transfer-group/update-transfer-group.schema.input.json"),"/fns/update-transfer-group/update-transfer-group.schema.input.json");h.UpdateTransferGroupFnInput=Qp;m.addSchema(g(Jp,"/fns/update-transfer-group/update-transfer-group.schema.output.json"),"/fns/update-transfer-group/update-transfer-group.schema.output.json");h.UpdateTransferGroupFnOutput=Jp;m.addSchema(g(Xp,"/fns/update-transfer-groups/update-transfer-groups.schema.input.json"),"/fns/update-transfer-groups/update-transfer-groups.schema.input.json");h.UpdateTransferGroupsFnInput=Xp;m.addSchema(g(Yp,"/fns/update-transfer-groups/update-transfer-groups.schema.output.json"),"/fns/update-transfer-groups/update-transfer-groups.schema.output.json");h.UpdateTransferGroupsFnOutput=Yp;m.addSchema(g(Zp,"/fns/update-transfers/update-transfers.schema.input.json"),"/fns/update-transfers/update-transfers.schema.input.json");h.UpdateTransfersFnInput=Zp;m.addSchema(g(ef,"/fns/update-transfers/update-transfers.schema.output.json"),"/fns/update-transfers/update-transfers.schema.output.json");h.UpdateTransfersFnOutput=ef;m.addSchema(g(tf,"/fns/update-wallet/update-wallet.schema.input.json"),"/fns/update-wallet/update-wallet.schema.input.json");h.UpdateWalletFnInput=tf;m.addSchema(g(rf,"/fns/update-wallet/update-wallet.schema.output.json"),"/fns/update-wallet/update-wallet.schema.output.json");h.UpdateWalletFnOutput=rf;m.addSchema(g(nf,"/txs/aggregate-transfer-many/aggregate-transfer-many.schema.input.json"),"/txs/aggregate-transfer-many/aggregate-transfer-many.schema.input.json");h.AggregateTransferManyTxInput=nf;m.addSchema(g(af,"/txs/aggregate-transfer-many/aggregate-transfer-many.schema.output.json"),"/txs/aggregate-transfer-many/aggregate-transfer-many.schema.output.json");h.AggregateTransferManyTxOutput=af;m.addSchema(g(sf,"/txs/authentication-check/authentication-check.schema.input.json"),"/txs/authentication-check/authentication-check.schema.input.json");h.AuthenticationCheckTxInput=sf;m.addSchema(g(of,"/txs/authentication-check/authentication-check.schema.output.json"),"/txs/authentication-check/authentication-check.schema.output.json");h.AuthenticationCheckTxOutput=of;m.addSchema(g(pf,"/txs/create-access-token/create-access-token.schema.input.json"),"/txs/create-access-token/create-access-token.schema.input.json");h.CreateAccessTokenTxInput=pf;m.addSchema(g(ff,"/txs/create-access-token/create-access-token.schema.output.json"),"/txs/create-access-token/create-access-token.schema.output.json");h.CreateAccessTokenTxOutput=ff;m.addSchema(g(uf,"/txs/create-contract/create-contract.schema.input.json"),"/txs/create-contract/create-contract.schema.input.json");h.CreateContractTxInput=uf;m.addSchema(g(df,"/txs/create-contract/create-contract.schema.output.json"),"/txs/create-contract/create-contract.schema.output.json");h.CreateContractTxOutput=df;m.addSchema(g(lf,"/txs/create-deposit/create-deposit.schema.input.json"),"/txs/create-deposit/create-deposit.schema.input.json");h.CreateDepositTxInput=lf;m.addSchema(g(cf,"/txs/create-deposit/create-deposit.schema.output.json"),"/txs/create-deposit/create-deposit.schema.output.json");h.CreateDepositTxOutput=cf;m.addSchema(g(mf,"/txs/create-distribution/create-distribution.schema.input.json"),"/txs/create-distribution/create-distribution.schema.input.json");h.CreateDistributionTxInput=mf;m.addSchema(g(hf,"/txs/create-distribution/create-distribution.schema.output.json"),"/txs/create-distribution/create-distribution.schema.output.json");h.CreateDistributionTxOutput=hf;m.addSchema(g(gf,"/txs/create-token/create-token.schema.input.json"),"/txs/create-token/create-token.schema.input.json");h.CreateTokenTxInput=gf;m.addSchema(g(_f,"/txs/create-token/create-token.schema.output.json"),"/txs/create-token/create-token.schema.output.json");h.CreateTokenTxOutput=_f;m.addSchema(g(Tf,"/txs/create-transfer/create-transfer.schema.input.json"),"/txs/create-transfer/create-transfer.schema.input.json");h.CreateTransferTxInput=Tf;m.addSchema(g(yf,"/txs/create-transfer/create-transfer.schema.output.json"),"/txs/create-transfer/create-transfer.schema.output.json");h.CreateTransferTxOutput=yf;m.addSchema(g(bf,"/txs/create-transfer-group/create-transfer-group.schema.input.json"),"/txs/create-transfer-group/create-transfer-group.schema.input.json");h.CreateTransferGroupTxInput=bf;m.addSchema(g(xf,"/txs/create-transfer-group/create-transfer-group.schema.output.json"),"/txs/create-transfer-group/create-transfer-group.schema.output.json");h.CreateTransferGroupTxOutput=xf;m.addSchema(g(Ff,"/txs/create-transfer-many/create-transfer-many.schema.input.json"),"/txs/create-transfer-many/create-transfer-many.schema.input.json");h.CreateTransferManyTxInput=Ff;m.addSchema(g(wf,"/txs/create-transfer-many/create-transfer-many.schema.output.json"),"/txs/create-transfer-many/create-transfer-many.schema.output.json");h.CreateTransferManyTxOutput=wf;m.addSchema(g($f,"/txs/create-wallet/create-wallet.schema.input.json"),"/txs/create-wallet/create-wallet.schema.input.json");h.CreateWalletTxInput=$f;m.addSchema(g(Of,"/txs/create-wallet/create-wallet.schema.output.json"),"/txs/create-wallet/create-wallet.schema.output.json");h.CreateWalletTxOutput=Of;m.addSchema(g(vf,"/txs/create-withdrawal/create-withdrawal.schema.input.json"),"/txs/create-withdrawal/create-withdrawal.schema.input.json");h.CreateWithdrawalTxInput=vf;m.addSchema(g(jf,"/txs/create-withdrawal/create-withdrawal.schema.output.json"),"/txs/create-withdrawal/create-withdrawal.schema.output.json");h.CreateWithdrawalTxOutput=jf;m.addSchema(g(If,"/txs/export-database/export-database.schema.input.json"),"/txs/export-database/export-database.schema.input.json");h.ExportDatabaseTxInput=If;m.addSchema(g(kf,"/txs/export-database/export-database.schema.output.json"),"/txs/export-database/export-database.schema.output.json");h.ExportDatabaseTxOutput=kf;m.addSchema(g(Sf,"/txs/find-balance-many/find-balance-many.schema.input.json"),"/txs/find-balance-many/find-balance-many.schema.input.json");h.FindBalanceManyTxInput=Sf;m.addSchema(g(Cf,"/txs/find-balance-many/find-balance-many.schema.output.json"),"/txs/find-balance-many/find-balance-many.schema.output.json");h.FindBalanceManyTxOutput=Cf;m.addSchema(g(Pf,"/txs/find-token-many/find-token-many.schema.input.json"),"/txs/find-token-many/find-token-many.schema.input.json");h.FindTokenManyTxInput=Pf;m.addSchema(g(Gf,"/txs/find-token-many/find-token-many.schema.output.json"),"/txs/find-token-many/find-token-many.schema.output.json");h.FindTokenManyTxOutput=Gf;m.addSchema(g(Df,"/txs/find-transfer-group-many/find-transfer-group-many.schema.input.json"),"/txs/find-transfer-group-many/find-transfer-group-many.schema.input.json");h.FindTransferGroupManyTxInput=Df;m.addSchema(g(Mf,"/txs/find-transfer-group-many/find-transfer-group-many.schema.output.json"),"/txs/find-transfer-group-many/find-transfer-group-many.schema.output.json");h.FindTransferGroupManyTxOutput=Mf;m.addSchema(g(Wf,"/txs/find-transfer-many/find-transfer-many.schema.input.json"),"/txs/find-transfer-many/find-transfer-many.schema.input.json");h.FindTransferManyTxInput=Wf;m.addSchema(g(Ef,"/txs/find-transfer-many/find-transfer-many.schema.output.json"),"/txs/find-transfer-many/find-transfer-many.schema.output.json");h.FindTransferManyTxOutput=Ef;m.addSchema(g(Rf,"/txs/find-wallet-many/find-wallet-many.schema.input.json"),"/txs/find-wallet-many/find-wallet-many.schema.input.json");h.FindWalletManyTxInput=Rf;m.addSchema(g(Af,"/txs/find-wallet-many/find-wallet-many.schema.output.json"),"/txs/find-wallet-many/find-wallet-many.schema.output.json");h.FindWalletManyTxOutput=Af;m.addSchema(g(Uf,"/txs/finish-transaction/finish-transaction.schema.input.json"),"/txs/finish-transaction/finish-transaction.schema.input.json");h.FinishTransactionTxInput=Uf;m.addSchema(g(qf,"/txs/finish-transaction/finish-transaction.schema.output.json"),"/txs/finish-transaction/finish-transaction.schema.output.json");h.FinishTransactionTxOutput=qf;m.addSchema(g(Nf,"/txs/get-balance/get-balance.schema.input.json"),"/txs/get-balance/get-balance.schema.input.json");h.GetBalanceTxInput=Nf;m.addSchema(g(Bf,"/txs/get-balance/get-balance.schema.output.json"),"/txs/get-balance/get-balance.schema.output.json");h.GetBalanceTxOutput=Bf;m.addSchema(g(Lf,"/txs/get-balance-history/get-balance-history.schema.input.json"),"/txs/get-balance-history/get-balance-history.schema.input.json");h.GetBalanceHistoryTxInput=Lf;m.addSchema(g(Vf,"/txs/get-balance-history/get-balance-history.schema.output.json"),"/txs/get-balance-history/get-balance-history.schema.output.json");h.GetBalanceHistoryTxOutput=Vf;m.addSchema(g(Hf,"/txs/get-database-export-progress/get-database-export-progress.schema.input.json"),"/txs/get-database-export-progress/get-database-export-progress.schema.input.json");h.GetDatabaseExportProgressTxInput=Hf;m.addSchema(g(zf,"/txs/get-database-export-progress/get-database-export-progress.schema.output.json"),"/txs/get-database-export-progress/get-database-export-progress.schema.output.json");h.GetDatabaseExportProgressTxOutput=zf;m.addSchema(g(Kf,"/txs/get-database-import-progress/get-database-import-progress.schema.input.json"),"/txs/get-database-import-progress/get-database-import-progress.schema.input.json");h.GetDatabaseImportProgressTxInput=Kf;m.addSchema(g(Qf,"/txs/get-database-import-progress/get-database-import-progress.schema.output.json"),"/txs/get-database-import-progress/get-database-import-progress.schema.output.json");h.GetDatabaseImportProgressTxOutput=Qf;m.addSchema(g(Jf,"/txs/get-flags/get-flags.schema.input.json"),"/txs/get-flags/get-flags.schema.input.json");h.GetFlagsTxInput=Jf;m.addSchema(g(Xf,"/txs/get-flags/get-flags.schema.output.json"),"/txs/get-flags/get-flags.schema.output.json");h.GetFlagsTxOutput=Xf;m.addSchema(g(Yf,"/txs/get-statistics/get-statistics.schema.input.json"),"/txs/get-statistics/get-statistics.schema.input.json");h.GetStatisticsTxInput=Yf;m.addSchema(g(Zf,"/txs/get-statistics/get-statistics.schema.output.json"),"/txs/get-statistics/get-statistics.schema.output.json");h.GetStatisticsTxOutput=Zf;m.addSchema(g(eu,"/txs/get-token/get-token.schema.input.json"),"/txs/get-token/get-token.schema.input.json");h.GetTokenTxInput=eu;m.addSchema(g(tu,"/txs/get-token/get-token.schema.output.json"),"/txs/get-token/get-token.schema.output.json");h.GetTokenTxOutput=tu;m.addSchema(g(ru,"/txs/get-token-many/get-token-many.schema.input.json"),"/txs/get-token-many/get-token-many.schema.input.json");h.GetTokenManyTxInput=ru;m.addSchema(g(nu,"/txs/get-token-many/get-token-many.schema.output.json"),"/txs/get-token-many/get-token-many.schema.output.json");h.GetTokenManyTxOutput=nu;m.addSchema(g(au,"/txs/get-transfer/get-transfer.schema.input.json"),"/txs/get-transfer/get-transfer.schema.input.json");h.GetTransferTxInput=au;m.addSchema(g(su,"/txs/get-transfer/get-transfer.schema.output.json"),"/txs/get-transfer/get-transfer.schema.output.json");h.GetTransferTxOutput=su;m.addSchema(g(iu,"/txs/get-transfer-group/get-transfer-group.schema.input.json"),"/txs/get-transfer-group/get-transfer-group.schema.input.json");h.GetTransferGroupTxInput=iu;m.addSchema(g(ou,"/txs/get-transfer-group/get-transfer-group.schema.output.json"),"/txs/get-transfer-group/get-transfer-group.schema.output.json");h.GetTransferGroupTxOutput=ou;m.addSchema(g(pu,"/txs/get-wallet/get-wallet.schema.input.json"),"/txs/get-wallet/get-wallet.schema.input.json");h.GetWalletTxInput=pu;m.addSchema(g(fu,"/txs/get-wallet/get-wallet.schema.output.json"),"/txs/get-wallet/get-wallet.schema.output.json");h.GetWalletTxOutput=fu;m.addSchema(g(uu,"/txs/get-wallet-many/get-wallet-many.schema.input.json"),"/txs/get-wallet-many/get-wallet-many.schema.input.json");h.GetWalletManyTxInput=uu;m.addSchema(g(du,"/txs/get-wallet-many/get-wallet-many.schema.output.json"),"/txs/get-wallet-many/get-wallet-many.schema.output.json");h.GetWalletManyTxOutput=du;m.addSchema(g(Us,"/txs/import-actions/import-actions.schema.input.json"),"/txs/import-actions/import-actions.schema.input.json");h.ImportActionsTxInput=Us;var bx=gx(Us,"/txs/import-actions/import-actions.schema.input.json");m.addSchema(bx,"/txs/import-actions/import-actions.schema.options.json");h.ImportActionsTxOptions=bx;var xx=_x(Us,"/txs/import-actions/import-actions.schema.input.json");m.addSchema(xx,"/txs/import-actions/import-actions.schema.chunk.json");h.ImportActionsTxStreamChunk=xx;m.addSchema(g(lu,"/txs/import-actions/import-actions.schema.output.json"),"/txs/import-actions/import-actions.schema.output.json");h.ImportActionsTxOutput=lu;m.addSchema(g(cu,"/txs/import-database/import-database.schema.input.json"),"/txs/import-database/import-database.schema.input.json");h.ImportDatabaseTxInput=cu;m.addSchema(g(mu,"/txs/import-database/import-database.schema.output.json"),"/txs/import-database/import-database.schema.output.json");h.ImportDatabaseTxOutput=mu;m.addSchema(g(hu,"/txs/list-database-backups/list-database-backups.schema.input.json"),"/txs/list-database-backups/list-database-backups.schema.input.json");h.ListDatabaseBackupsTxInput=hu;m.addSchema(g(gu,"/txs/list-database-backups/list-database-backups.schema.output.json"),"/txs/list-database-backups/list-database-backups.schema.output.json");h.ListDatabaseBackupsTxOutput=gu;m.addSchema(g(_u,"/txs/query/query.schema.input.json"),"/txs/query/query.schema.input.json");h.QueryTxInput=_u;m.addSchema(g(Tu,"/txs/query/query.schema.output.json"),"/txs/query/query.schema.output.json");h.QueryTxOutput=Tu;m.addSchema(g(yu,"/txs/query-logs/query-logs.schema.input.json"),"/txs/query-logs/query-logs.schema.input.json");h.QueryLogsTxInput=yu;m.addSchema(g(bu,"/txs/query-logs/query-logs.schema.output.json"),"/txs/query-logs/query-logs.schema.output.json");h.QueryLogsTxOutput=bu;m.addSchema(g(xu,"/txs/reset-database/reset-database.schema.input.json"),"/txs/reset-database/reset-database.schema.input.json");h.ResetDatabaseTxInput=xu;m.addSchema(g(Fu,"/txs/reset-database/reset-database.schema.output.json"),"/txs/reset-database/reset-database.schema.output.json");h.ResetDatabaseTxOutput=Fu;m.addSchema(g(wu,"/txs/reverse-transfer/reverse-transfer.schema.input.json"),"/txs/reverse-transfer/reverse-transfer.schema.input.json");h.ReverseTransferTxInput=wu;m.addSchema(g($u,"/txs/reverse-transfer/reverse-transfer.schema.output.json"),"/txs/reverse-transfer/reverse-transfer.schema.output.json");h.ReverseTransferTxOutput=$u;m.addSchema(g(Ou,"/txs/reverse-transfer-group/reverse-transfer-group.schema.input.json"),"/txs/reverse-transfer-group/reverse-transfer-group.schema.input.json");h.ReverseTransferGroupTxInput=Ou;m.addSchema(g(vu,"/txs/reverse-transfer-group/reverse-transfer-group.schema.output.json"),"/txs/reverse-transfer-group/reverse-transfer-group.schema.output.json");h.ReverseTransferGroupTxOutput=vu;m.addSchema(g(ju,"/txs/reverse-transfer-group-many/reverse-transfer-group-many.schema.input.json"),"/txs/reverse-transfer-group-many/reverse-transfer-group-many.schema.input.json");h.ReverseTransferGroupManyTxInput=ju;m.addSchema(g(Iu,"/txs/reverse-transfer-group-many/reverse-transfer-group-many.schema.output.json"),"/txs/reverse-transfer-group-many/reverse-transfer-group-many.schema.output.json");h.ReverseTransferGroupManyTxOutput=Iu;m.addSchema(g(ku,"/txs/reverse-transfer-many/reverse-transfer-many.schema.input.json"),"/txs/reverse-transfer-many/reverse-transfer-many.schema.input.json");h.ReverseTransferManyTxInput=ku;m.addSchema(g(Su,"/txs/reverse-transfer-many/reverse-transfer-many.schema.output.json"),"/txs/reverse-transfer-many/reverse-transfer-many.schema.output.json");h.ReverseTransferManyTxOutput=Su;m.addSchema(g(Cu,"/txs/set-flags/set-flags.schema.input.json"),"/txs/set-flags/set-flags.schema.input.json");h.SetFlagsTxInput=Cu;m.addSchema(g(Pu,"/txs/set-flags/set-flags.schema.output.json"),"/txs/set-flags/set-flags.schema.output.json");h.SetFlagsTxOutput=Pu;m.addSchema(g(Gu,"/txs/start-transaction/start-transaction.schema.input.json"),"/txs/start-transaction/start-transaction.schema.input.json");h.StartTransactionTxInput=Gu;m.addSchema(g(Du,"/txs/start-transaction/start-transaction.schema.output.json"),"/txs/start-transaction/start-transaction.schema.output.json");h.StartTransactionTxOutput=Du;m.addSchema(g(Wu,"/txs/tx-consts.schema.json"),"/txs/tx-consts.schema.json");h.TxConsts=Wu;m.addSchema(g(Eu,"/txs/update-token/update-token.schema.input.json"),"/txs/update-token/update-token.schema.input.json");h.UpdateTokenTxInput=Eu;m.addSchema(g(Ru,"/txs/update-token/update-token.schema.output.json"),"/txs/update-token/update-token.schema.output.json");h.UpdateTokenTxOutput=Ru;m.addSchema(g(Au,"/txs/update-transfer/update-transfer.schema.input.json"),"/txs/update-transfer/update-transfer.schema.input.json");h.UpdateTransferTxInput=Au;m.addSchema(g(Uu,"/txs/update-transfer/update-transfer.schema.output.json"),"/txs/update-transfer/update-transfer.schema.output.json");h.UpdateTransferTxOutput=Uu;m.addSchema(g(qu,"/txs/update-transfer-group/update-transfer-group.schema.input.json"),"/txs/update-transfer-group/update-transfer-group.schema.input.json");h.UpdateTransferGroupTxInput=qu;m.addSchema(g(Nu,"/txs/update-transfer-group/update-transfer-group.schema.output.json"),"/txs/update-transfer-group/update-transfer-group.schema.output.json");h.UpdateTransferGroupTxOutput=Nu;m.addSchema(g(Bu,"/txs/update-transfer-group-many/update-transfer-group-many.schema.input.json"),"/txs/update-transfer-group-many/update-transfer-group-many.schema.input.json");h.UpdateTransferGroupManyTxInput=Bu;m.addSchema(g(Lu,"/txs/update-transfer-group-many/update-transfer-group-many.schema.output.json"),"/txs/update-transfer-group-many/update-transfer-group-many.schema.output.json");h.UpdateTransferGroupManyTxOutput=Lu;m.addSchema(g(Vu,"/txs/update-transfer-many/update-transfer-many.schema.input.json"),"/txs/update-transfer-many/update-transfer-many.schema.input.json");h.UpdateTransferManyTxInput=Vu;m.addSchema(g(Hu,"/txs/update-transfer-many/update-transfer-many.schema.output.json"),"/txs/update-transfer-many/update-transfer-many.schema.output.json");h.UpdateTransferManyTxOutput=Hu;m.addSchema(g(zu,"/txs/update-wallet/update-wallet.schema.input.json"),"/txs/update-wallet/update-wallet.schema.input.json");h.UpdateWalletTxInput=zu;m.addSchema(g(Ku,"/txs/update-wallet/update-wallet.schema.output.json"),"/txs/update-wallet/update-wallet.schema.output.json");h.UpdateWalletTxOutput=Ku;var x;(function(p){p.JSONRPCRequest="JSONRPCRequest",p.JSONRPCResponse="JSONRPCResponse",p.ClientOptions="ClientOptions",p.Consts="Consts",p.TokenTableInput="TokenTableInput",p.TokenTable="TokenTable",p.TokenTableOptional="TokenTableOptional",p.TransferTableInput="TransferTableInput",p.TransferTable="TransferTable",p.TransferTableOptional="TransferTableOptional",p.TransferGroupTableInput="TransferGroupTableInput",p.TransferGroupTable="TransferGroupTable",p.TransferGroupTableOptional="TransferGroupTableOptional",p.TransferLogTableInput="TransferLogTableInput",p.TransferLogTable="TransferLogTable",p.TransferLogTableOptional="TransferLogTableOptional",p.WalletTableInput="WalletTableInput",p.WalletTable="WalletTable",p.WalletTableOptional="WalletTableOptional",p.WalletTokenSettingTableInput="WalletTokenSettingTableInput",p.WalletTokenSettingTable="WalletTokenSettingTable",p.WalletTokenSettingTableOptional="WalletTokenSettingTableOptional",p.WapiSettingTableInput="WapiSettingTableInput",p.WapiSettingTable="WapiSettingTable",p.WapiSettingTableOptional="WapiSettingTableOptional",p.AggregateTransfersFnInput="AggregateTransfersFnInput",p.AggregateTransfersFnOutput="AggregateTransfersFnOutput",p.CreateAccessTokenFnInput="CreateAccessTokenFnInput",p.CreateAccessTokenFnOutput="CreateAccessTokenFnOutput",p.CreateContractFnInput="CreateContractFnInput",p.CreateContractFnOutput="CreateContractFnOutput",p.CreateDepositFnInput="CreateDepositFnInput",p.CreateDepositFnOutput="CreateDepositFnOutput",p.CreateExchangeFnInput="CreateExchangeFnInput",p.CreateExchangeFnOutput="CreateExchangeFnOutput",p.CreateTokenFnInput="CreateTokenFnInput",p.CreateTokenFnOutput="CreateTokenFnOutput",p.CreateTransferFnInput="CreateTransferFnInput",p.CreateTransferFnOutput="CreateTransferFnOutput",p.CreateTransferGroupFnInput="CreateTransferGroupFnInput",p.CreateTransferGroupFnOutput="CreateTransferGroupFnOutput",p.CreateTransfersFnInput="CreateTransfersFnInput",p.CreateTransfersFnOutput="CreateTransfersFnOutput",p.CreateWalletFnInput="CreateWalletFnInput",p.CreateWalletFnOutput="CreateWalletFnOutput",p.CreateWithdrawalFnInput="CreateWithdrawalFnInput",p.CreateWithdrawalFnOutput="CreateWithdrawalFnOutput",p.FindBalancesFnInput="FindBalancesFnInput",p.FindBalancesFnOutput="FindBalancesFnOutput",p.FindTokensFnInput="FindTokensFnInput",p.FindTokensFnOutput="FindTokensFnOutput",p.FindTransferGroupsFnInput="FindTransferGroupsFnInput",p.FindTransferGroupsFnOutput="FindTransferGroupsFnOutput",p.FindTransfersFnInput="FindTransfersFnInput",p.FindTransfersFnOutput="FindTransfersFnOutput",p.FindWalletsFnInput="FindWalletsFnInput",p.FindWalletsFnOutput="FindWalletsFnOutput",p.FnConsts="FnConsts",p.GetBalanceFnInput="GetBalanceFnInput",p.GetBalanceFnOutput="GetBalanceFnOutput",p.GetBalanceHistoryFnInput="GetBalanceHistoryFnInput",p.GetBalanceHistoryFnOutput="GetBalanceHistoryFnOutput",p.GetFlagsFnInput="GetFlagsFnInput",p.GetFlagsFnOutput="GetFlagsFnOutput",p.GetStatisticsFnInput="GetStatisticsFnInput",p.GetStatisticsFnOutput="GetStatisticsFnOutput",p.GetTokenFnInput="GetTokenFnInput",p.GetTokenFnOutput="GetTokenFnOutput",p.GetTransferFnInput="GetTransferFnInput",p.GetTransferFnOutput="GetTransferFnOutput",p.GetTransferGroupFnInput="GetTransferGroupFnInput",p.GetTransferGroupFnOutput="GetTransferGroupFnOutput",p.GetWalletFnInput="GetWalletFnInput",p.GetWalletFnOutput="GetWalletFnOutput",p.ImportDataFnInput="ImportDataFnInput",p.ImportDataFnOptions="ImportDataFnOptions",p.ImportDataFnStreamChunk="ImportDataFnStreamChunk",p.ImportDataFnOutput="ImportDataFnOutput",p.ReverseTransferFnInput="ReverseTransferFnInput",p.ReverseTransferFnOutput="ReverseTransferFnOutput",p.ReverseTransferGroupFnInput="ReverseTransferGroupFnInput",p.ReverseTransferGroupFnOutput="ReverseTransferGroupFnOutput",p.ReverseTransfersFnInput="ReverseTransfersFnInput",p.ReverseTransfersFnOutput="ReverseTransfersFnOutput",p.SetFlagsFnInput="SetFlagsFnInput",p.SetFlagsFnOutput="SetFlagsFnOutput",p.UpdateTokenFnInput="UpdateTokenFnInput",p.UpdateTokenFnOutput="UpdateTokenFnOutput",p.UpdateTransferFnInput="UpdateTransferFnInput",p.UpdateTransferFnOutput="UpdateTransferFnOutput",p.UpdateTransferGroupFnInput="UpdateTransferGroupFnInput",p.UpdateTransferGroupFnOutput="UpdateTransferGroupFnOutput",p.UpdateTransferGroupsFnInput="UpdateTransferGroupsFnInput",p.UpdateTransferGroupsFnOutput="UpdateTransferGroupsFnOutput",p.UpdateTransfersFnInput="UpdateTransfersFnInput",p.UpdateTransfersFnOutput="UpdateTransfersFnOutput",p.UpdateWalletFnInput="UpdateWalletFnInput",p.UpdateWalletFnOutput="UpdateWalletFnOutput",p.AggregateTransferManyTxInput="AggregateTransferManyTxInput",p.AggregateTransferManyTxOutput="AggregateTransferManyTxOutput",p.AuthenticationCheckTxInput="AuthenticationCheckTxInput",p.AuthenticationCheckTxOutput="AuthenticationCheckTxOutput",p.CreateAccessTokenTxInput="CreateAccessTokenTxInput",p.CreateAccessTokenTxOutput="CreateAccessTokenTxOutput",p.CreateContractTxInput="CreateContractTxInput",p.CreateContractTxOutput="CreateContractTxOutput",p.CreateDepositTxInput="CreateDepositTxInput",p.CreateDepositTxOutput="CreateDepositTxOutput",p.CreateDistributionTxInput="CreateDistributionTxInput",p.CreateDistributionTxOutput="CreateDistributionTxOutput",p.CreateTokenTxInput="CreateTokenTxInput",p.CreateTokenTxOutput="CreateTokenTxOutput",p.CreateTransferTxInput="CreateTransferTxInput",p.CreateTransferTxOutput="CreateTransferTxOutput",p.CreateTransferGroupTxInput="CreateTransferGroupTxInput",p.CreateTransferGroupTxOutput="CreateTransferGroupTxOutput",p.CreateTransferManyTxInput="CreateTransferManyTxInput",p.CreateTransferManyTxOutput="CreateTransferManyTxOutput",p.CreateWalletTxInput="CreateWalletTxInput",p.CreateWalletTxOutput="CreateWalletTxOutput",p.CreateWithdrawalTxInput="CreateWithdrawalTxInput",p.CreateWithdrawalTxOutput="CreateWithdrawalTxOutput",p.ExportDatabaseTxInput="ExportDatabaseTxInput",p.ExportDatabaseTxOutput="ExportDatabaseTxOutput",p.FindBalanceManyTxInput="FindBalanceManyTxInput",p.FindBalanceManyTxOutput="FindBalanceManyTxOutput",p.FindTokenManyTxInput="FindTokenManyTxInput",p.FindTokenManyTxOutput="FindTokenManyTxOutput",p.FindTransferGroupManyTxInput="FindTransferGroupManyTxInput",p.FindTransferGroupManyTxOutput="FindTransferGroupManyTxOutput",p.FindTransferManyTxInput="FindTransferManyTxInput",p.FindTransferManyTxOutput="FindTransferManyTxOutput",p.FindWalletManyTxInput="FindWalletManyTxInput",p.FindWalletManyTxOutput="FindWalletManyTxOutput",p.FinishTransactionTxInput="FinishTransactionTxInput",p.FinishTransactionTxOutput="FinishTransactionTxOutput",p.GetBalanceTxInput="GetBalanceTxInput",p.GetBalanceTxOutput="GetBalanceTxOutput",p.GetBalanceHistoryTxInput="GetBalanceHistoryTxInput",p.GetBalanceHistoryTxOutput="GetBalanceHistoryTxOutput",p.GetDatabaseExportProgressTxInput="GetDatabaseExportProgressTxInput",p.GetDatabaseExportProgressTxOutput="GetDatabaseExportProgressTxOutput",p.GetDatabaseImportProgressTxInput="GetDatabaseImportProgressTxInput",p.GetDatabaseImportProgressTxOutput="GetDatabaseImportProgressTxOutput",p.GetFlagsTxInput="GetFlagsTxInput",p.GetFlagsTxOutput="GetFlagsTxOutput",p.GetStatisticsTxInput="GetStatisticsTxInput",p.GetStatisticsTxOutput="GetStatisticsTxOutput",p.GetTokenTxInput="GetTokenTxInput",p.GetTokenTxOutput="GetTokenTxOutput",p.GetTokenManyTxInput="GetTokenManyTxInput",p.GetTokenManyTxOutput="GetTokenManyTxOutput",p.GetTransferTxInput="GetTransferTxInput",p.GetTransferTxOutput="GetTransferTxOutput",p.GetTransferGroupTxInput="GetTransferGroupTxInput",p.GetTransferGroupTxOutput="GetTransferGroupTxOutput",p.GetWalletTxInput="GetWalletTxInput",p.GetWalletTxOutput="GetWalletTxOutput",p.GetWalletManyTxInput="GetWalletManyTxInput",p.GetWalletManyTxOutput="GetWalletManyTxOutput",p.ImportActionsTxInput="ImportActionsTxInput",p.ImportActionsTxOptions="ImportActionsTxOptions",p.ImportActionsTxStreamChunk="ImportActionsTxStreamChunk",p.ImportActionsTxOutput="ImportActionsTxOutput",p.ImportDatabaseTxInput="ImportDatabaseTxInput",p.ImportDatabaseTxOutput="ImportDatabaseTxOutput",p.ListDatabaseBackupsTxInput="ListDatabaseBackupsTxInput",p.ListDatabaseBackupsTxOutput="ListDatabaseBackupsTxOutput",p.QueryTxInput="QueryTxInput",p.QueryTxOutput="QueryTxOutput",p.QueryLogsTxInput="QueryLogsTxInput",p.QueryLogsTxOutput="QueryLogsTxOutput",p.ResetDatabaseTxInput="ResetDatabaseTxInput",p.ResetDatabaseTxOutput="ResetDatabaseTxOutput",p.ReverseTransferTxInput="ReverseTransferTxInput",p.ReverseTransferTxOutput="ReverseTransferTxOutput",p.ReverseTransferGroupTxInput="ReverseTransferGroupTxInput",p.ReverseTransferGroupTxOutput="ReverseTransferGroupTxOutput",p.ReverseTransferGroupManyTxInput="ReverseTransferGroupManyTxInput",p.ReverseTransferGroupManyTxOutput="ReverseTransferGroupManyTxOutput",p.ReverseTransferManyTxInput="ReverseTransferManyTxInput",p.ReverseTransferManyTxOutput="ReverseTransferManyTxOutput",p.SetFlagsTxInput="SetFlagsTxInput",p.SetFlagsTxOutput="SetFlagsTxOutput",p.StartTransactionTxInput="StartTransactionTxInput",p.StartTransactionTxOutput="StartTransactionTxOutput",p.TxConsts="TxConsts",p.UpdateTokenTxInput="UpdateTokenTxInput",p.UpdateTokenTxOutput="UpdateTokenTxOutput",p.UpdateTransferTxInput="UpdateTransferTxInput",p.UpdateTransferTxOutput="UpdateTransferTxOutput",p.UpdateTransferGroupTxInput="UpdateTransferGroupTxInput",p.UpdateTransferGroupTxOutput="UpdateTransferGroupTxOutput",p.UpdateTransferGroupManyTxInput="UpdateTransferGroupManyTxInput",p.UpdateTransferGroupManyTxOutput="UpdateTransferGroupManyTxOutput",p.UpdateTransferManyTxInput="UpdateTransferManyTxInput",p.UpdateTransferManyTxOutput="UpdateTransferManyTxOutput",p.UpdateWalletTxInput="UpdateWalletTxInput",p.UpdateWalletTxOutput="UpdateWalletTxOutput"})(x||(x={}));var Qu={ajv:m,createValidator(t){let e=m.compile(t);return mx(e)},getValidator(t){let e=m.getSchema(t);return mx(e)},getSchema(t){return h[t]},Schemas:h,SchemaNames:x},sse=Qu.createValidator,F=Qu.getValidator;var Ju;(function(i){i.year="year",i.month="month",i.week="week",i.day="day",i.hour="hour",i.minute="minute"})(Ju||(Ju={}));var Sh;(function(i){i.count="count",i.countDistinct="countDistinct",i.sum="sum",i.average="average",i.min="min",i.max="max"})(Sh||(Sh={}));var Ch;(function(a){a.keep="keep",a.random="random",a.largest="largest",a.target="target"})(Ch||(Ch={}));var Ph;(function(r){r.replace="replace",r.extend="extend"})(Ph||(Ph={}));var Gh;(function(i){i.replace="replace",i.replace_create_only="replace_create_only",i.replace_cancel_only="replace_cancel_only",i.extend="extend",i.extend_create_only="extend_create_only",i.extend_cancel_only="extend_cancel_only"})(Gh||(Gh={}));var T6=F(x.AggregateTransferManyTxInput);var y6=F(x.AuthenticationCheckTxInput);var b6=F(x.CreateAccessTokenTxInput);var x6=F(x.CreateContractTxInput);var F6=F(x.CreateDepositTxInput);var w6=F(x.CreateDistributionTxInput);var $6=F(x.CreateTokenTxInput);var O6=F(x.CreateTransferTxInput);var v6=F(x.CreateTransferGroupTxInput);var j6=F(x.CreateTransferManyTxInput);var I6=F(x.CreateWalletTxInput);var k6=F(x.CreateWithdrawalTxInput);var S6=F(x.ExportDatabaseTxInput);var C6=F(x.FindBalanceManyTxInput);var P6=F(x.FindTokenManyTxInput);var G6=F(x.FindTransferGroupManyTxInput);var D6=F(x.FindTransferManyTxInput);var M6=F(x.FindWalletManyTxInput);var W6=F(x.FinishTransactionTxInput);var E6=F(x.GetBalanceTxInput);var R6=F(x.GetBalanceHistoryTxInput);var A6=F(x.GetDatabaseExportProgressTxInput);var U6=F(x.GetDatabaseImportProgressTxInput);var q6=F(x.GetFlagsTxInput);var N6=F(x.GetStatisticsTxInput);var B6=F(x.GetTokenTxInput);var L6=F(x.GetTokenManyTxInput);var V6=F(x.GetTransferTxInput);var H6=F(x.GetTransferGroupTxInput);var z6=F(x.GetWalletTxInput);var K6=F(x.GetWalletManyTxInput);var Q6=F(x.ImportActionsTxInput);var J6=F(x.ImportDatabaseTxInput);var X6=F(x.ListDatabaseBackupsTxInput);var Y6=F(x.QueryTxInput);var Z6=F(x.QueryLogsTxInput);var eJ=F(x.ResetDatabaseTxInput);var tJ=F(x.ReverseTransferTxInput);var rJ=F(x.ReverseTransferGroupTxInput);var nJ=F(x.ReverseTransferGroupManyTxInput);var aJ=F(x.ReverseTransferManyTxInput);var sJ=F(x.SetFlagsTxInput);var iJ=F(x.StartTransactionTxInput);var oJ=F(x.UpdateTokenTxInput);var pJ=F(x.UpdateTransferTxInput);var fJ=F(x.UpdateTransferGroupTxInput);var uJ=F(x.UpdateTransferGroupManyTxInput);var dJ=F(x.UpdateTransferManyTxInput);var lJ=F(x.UpdateWalletTxInput),Dh={aggregateTransferMany:T6,authenticationCheck:y6,createAccessToken:b6,createContract:x6,createDeposit:F6,createDistribution:w6,createToken:$6,createTransfer:O6,createTransferGroup:v6,createTransferMany:j6,createWallet:I6,createWithdrawal:k6,exportDatabase:S6,findBalanceMany:C6,findTokenMany:P6,findTransferGroupMany:G6,findTransferMany:D6,findWalletMany:M6,finishTransaction:W6,getBalance:E6,getBalanceHistory:R6,getDatabaseExportProgress:A6,getDatabaseImportProgress:U6,getFlags:q6,getStatistics:N6,getToken:B6,getTokenMany:L6,getTransfer:V6,getTransferGroup:H6,getWallet:z6,getWalletMany:K6,importActions:Q6,importDatabase:J6,listDatabaseBackups:X6,query:Y6,queryLogs:Z6,resetDatabase:eJ,reverseTransfer:tJ,reverseTransferGroup:rJ,reverseTransferGroupMany:nJ,reverseTransferMany:aJ,setFlags:sJ,startTransaction:iJ,updateToken:oJ,updateTransfer:pJ,updateTransferGroup:fJ,updateTransferGroupMany:uJ,updateTransferMany:dJ,updateWallet:lJ},R;(function(S){S.aggregateTransferMany="aggregateTransferMany",S.authenticationCheck="authenticationCheck",S.createAccessToken="createAccessToken",S.createContract="createContract",S.createDeposit="createDeposit",S.createDistribution="createDistribution",S.createToken="createToken",S.createTransfer="createTransfer",S.createTransferGroup="createTransferGroup",S.createTransferMany="createTransferMany",S.createWallet="createWallet",S.createWithdrawal="createWithdrawal",S.exportDatabase="exportDatabase",S.findBalanceMany="findBalanceMany",S.findTokenMany="findTokenMany",S.findTransferGroupMany="findTransferGroupMany",S.findTransferMany="findTransferMany",S.findWalletMany="findWalletMany",S.finishTransaction="finishTransaction",S.getBalance="getBalance",S.getBalanceHistory="getBalanceHistory",S.getDatabaseExportProgress="getDatabaseExportProgress",S.getDatabaseImportProgress="getDatabaseImportProgress",S.getFlags="getFlags",S.getStatistics="getStatistics",S.getToken="getToken",S.getTokenMany="getTokenMany",S.getTransfer="getTransfer",S.getTransferGroup="getTransferGroup",S.getWallet="getWallet",S.getWalletMany="getWalletMany",S.importActions="importActions",S.importDatabase="importDatabase",S.listDatabaseBackups="listDatabaseBackups",S.query="query",S.queryLogs="queryLogs",S.resetDatabase="resetDatabase",S.reverseTransfer="reverseTransfer",S.reverseTransferGroup="reverseTransferGroup",S.reverseTransferGroupMany="reverseTransferGroupMany",S.reverseTransferMany="reverseTransferMany",S.setFlags="setFlags",S.startTransaction="startTransaction",S.updateToken="updateToken",S.updateTransfer="updateTransfer",S.updateTransferGroup="updateTransferGroup",S.updateTransferGroupMany="updateTransferGroupMany",S.updateTransferMany="updateTransferMany",S.updateWallet="updateWallet"})(R||(R={}));var cJ=F(x.ImportActionsTxInput);function Fx(t){let{error:e}=cJ(t);return e===void 0}var Yoe=F(x.ImportActionsTxOutput);var Zoe=F(x.ImportActionsTxStreamChunk);var mJ=F(x.ImportActionsTxOptions);function wx(t){let{error:e}=mJ(t);return e===void 0}var Ci=class{constructor(e,r,n){this.isConnected=!1;this.hooks=new Proxy({},{set(e,r,n){if(typeof n!="function")throw new TypeError("Hooks can only be functions");return e[r]=n,!0}});this._requests=new Map;this._error=!1;this._sending=new Set;this.type=r,this._connection=e,this.connectionType=r,this.$connect=n}_setConnected(e){this.isConnected=e,this.isConnected&&this._error!==!1&&(this._error=!1),this.isConnected&&this.hooks.connected&&this.hooks.connected(this.socId),!this.isConnected&&this.hooks.disconnected&&this.hooks.disconnected()}_setErrored(e){this._error=e,this.isConnected&&this._setConnected(!1)}_send(e){throw new Error("This method must be implemented by child class")}_reconnect(){throw new Error("This method must be implemented by child class")}close(){return ye(this,null,function*(){throw new Error("This method must be implemented by child class")})}_connectionLost(){this._requests.forEach((e,r)=>{"stream"in e&&e.stream.destroy(new hd({message:"connection lost"})),this._requests.delete(r)}),this.socId=void 0}_handleMessage(e){var o,f,u;if(this.hooks.message&&this.hooks.message(e),"method"in e){let l=e;if(l.method===ve.ping){this._send({jsonrpc:ve.version,result:ve.pong,id:l.id});return}pe("Unexpected JSONRPCRequest",e);return}let r=e;if(this.hooks.message&&this.hooks.message(r),r.id===null){pe("Unexpected JSONRPCResponse",e);return}if(r.result===ve.acknowledgement){this._sending.delete(r.id);return}let n=this._requests.get(r.id);if(!n){pe("No Request found for incoming",e);return}if("handle"in n){n.handle(r),delete n.handle;return}r.error&&"error"in n&&n.error(r.error);let a=r;if(((o=a.result)==null?void 0:o.type)===ve.streamPause&&"pause"in n){n.pause();return}if(((f=a.result)==null?void 0:f.type)===ve.streamResume&&"resume"in n){n.resume();return}let{stream:s,start:i}=n;if(((u=a.result)==null?void 0:u.type)===ve.streamChunk){s.push(a.result);return}s.push(a),s.push(null),this._requests.delete(a.id),this.connectionType===dt.ws&&this._send({jsonrpc:ve.version,method:ve.acknowledgement,params:Date.now()-i,id:a.id})}_sendTransaction(e,r){let{isValid:n,inputCopy:a,error:s}=Dh[e](r);if(!n)throw s;let i={jsonrpc:ve.version,method:e,params:a,id:as()};return this.hooks.preflight&&this.hooks.preflight(i)===!1?new ua:new ua(o=>ye(this,null,function*(){this._error&&this._reconnect(),this.isConnected||(yield this.$connect),this._requests.set(i.id,{stream:o,start:Date.now()}),this._sending.add(i.id),this._send(i)}))}_streamTransaction(e,r,n,a){let s=Date.now(),i=as(),o,f=({method:w,params:y})=>{if(o)return;let j={jsonrpc:ve.version,method:w,params:P({streamId:i},y),id:as()};this._sending.add(j.id),this._send(j)},u=(w,y)=>{o||(f({method:"streamError",params:{error:y}}),o=y,w.push({error:y}))},l=new Vc,_=a?l.pipe(a):l,b={jsonrpc:ve.version,method:"streamStart",params:{method:e,options:n},id:i};return this.hooks.preflight&&this.hooks.preflight(b)===!1?new Md:new Md(w=>ye(this,null,function*(){this._error&&this._reconnect(),this.isConnected||(yield this.$connect);let y=setTimeout(()=>{w.push({error:new de({message:re.INPUT_STREAM_TIMEOUT})})},3e4);this._requests.set(b.id,{stream:w,start:s,error(j){o=j,pe("stream:error()>",j)},pause(){l.pause()},resume(){l.resume()},handle(j){if(j.error){w.push(j);return}_.on("data",I=>{if(!o){if(y&&(clearTimeout(y),y=null),!r(I)){u(w,new Ne({message:re.INPUT_INVALID,data:I}));return}f({method:"streamData",params:{data:I}})}}).on("error",I=>{o||(y&&(clearTimeout(y),y=null),f({method:"streamError",params:{error:I}}),w.push({error:new de({message:re.INPUT_STREAM_ERROR,data:I})}))}).on("end",()=>{y&&(clearTimeout(y),y=null),f({method:"streamEnd",params:{}})})}}),this._sending.add(b.id),this._send(b)}),l)}aggregateTransferMany(e){return this._sendTransaction(R.aggregateTransferMany,e)}authenticationCheck(e){return this._sendTransaction(R.authenticationCheck,e)}createAccessToken(e){return this._sendTransaction(R.createAccessToken,e)}createContract(e){return this._sendTransaction(R.createContract,e)}createDeposit(e){return this._sendTransaction(R.createDeposit,e)}createDistribution(e){return this._sendTransaction(R.createDistribution,e)}createToken(e){return this._sendTransaction(R.createToken,e)}createTransfer(e){return this._sendTransaction(R.createTransfer,e)}createTransferGroup(e){return this._sendTransaction(R.createTransferGroup,e)}createTransferMany(e){return this._sendTransaction(R.createTransferMany,e)}createWallet(e){return this._sendTransaction(R.createWallet,e)}createWithdrawal(e){return this._sendTransaction(R.createWithdrawal,e)}exportDatabase(e){return this._sendTransaction(R.exportDatabase,e)}findBalanceMany(e){return this._sendTransaction(R.findBalanceMany,e)}findTokenMany(e){return this._sendTransaction(R.findTokenMany,e)}findTransferGroupMany(e){return this._sendTransaction(R.findTransferGroupMany,e)}findTransferMany(e){return this._sendTransaction(R.findTransferMany,e)}findWalletMany(e){return this._sendTransaction(R.findWalletMany,e)}finishTransaction(e){return this._sendTransaction(R.finishTransaction,e)}getBalance(e){return this._sendTransaction(R.getBalance,e)}getBalanceHistory(e){return this._sendTransaction(R.getBalanceHistory,e)}getDatabaseExportProgress(e){return this._sendTransaction(R.getDatabaseExportProgress,e)}getDatabaseImportProgress(e){return this._sendTransaction(R.getDatabaseImportProgress,e)}getFlags(e){return this._sendTransaction(R.getFlags,e)}getStatistics(e){return this._sendTransaction(R.getStatistics,e)}getToken(e){return this._sendTransaction(R.getToken,e)}getTokenMany(e){return this._sendTransaction(R.getTokenMany,e)}getTransfer(e){return this._sendTransaction(R.getTransfer,e)}getTransferGroup(e){return this._sendTransaction(R.getTransferGroup,e)}getWallet(e){return this._sendTransaction(R.getWallet,e)}getWalletMany(e){return this._sendTransaction(R.getWalletMany,e)}importActions(e){return this._sendTransaction(R.importActions,e)}importActionsStream(e,r){if(e!==void 0&&!wx(e))throw new Ne({message:re.INPUT_INVALID,data:e});return this._streamTransaction(R.importActions,Fx,e,r)}importDatabase(e){return this._sendTransaction(R.importDatabase,e)}listDatabaseBackups(e){return this._sendTransaction(R.listDatabaseBackups,e)}query(e){return this._sendTransaction(R.query,e)}queryLogs(e){return this._sendTransaction(R.queryLogs,e)}resetDatabase(e){return this._sendTransaction(R.resetDatabase,e)}reverseTransfer(e){return this._sendTransaction(R.reverseTransfer,e)}reverseTransferGroup(e){return this._sendTransaction(R.reverseTransferGroup,e)}reverseTransferGroupMany(e){return this._sendTransaction(R.reverseTransferGroupMany,e)}reverseTransferMany(e){return this._sendTransaction(R.reverseTransferMany,e)}setFlags(e){return this._sendTransaction(R.setFlags,e)}startTransaction(e){return this._sendTransaction(R.startTransaction,e)}updateToken(e){return this._sendTransaction(R.updateToken,e)}updateTransfer(e){return this._sendTransaction(R.updateTransfer,e)}updateTransferGroup(e){return this._sendTransaction(R.updateTransferGroup,e)}updateTransferGroupMany(e){return this._sendTransaction(R.updateTransferGroupMany,e)}updateTransferMany(e){return this._sendTransaction(R.updateTransferMany,e)}updateWallet(e){return this._sendTransaction(R.updateWallet,e)}};var cl;(function(e){e.ready="ready"})(cl||(cl={}));var ml;(function(r){r[r.authError=4030]="authError",r[r.genericError=4500]="genericError"})(ml||(ml={}));var hl="0.6.3";function Mh(t){let e=$x(t);return new Ox(e,t)}function $x(t){let e=Object.assign({rejectUnauthorized:!0,clientVersion:hl},t),r=MT(e),n=new pT(...r),a,s,i=!1,o;n.onclose=f,n.onerror=u,n.onmessage=l;function f(w){if(pe(`createConnection>close(reason:${w.reason},code:${w.code},wasClean:${w.wasClean})`),w.code===ml.authError)return _(new _d({message:re.AUTHENTICATION_FAILED,code:me.AuthenticationError}));_(new Error("WS closed"))}function u(w){pe(`createConnection>error(message:${w.message},error:${w.error},type:${w.type})`),_(w.error)}function l(w){pe(`createConnection>message(type:${w.type},data:${w.data})`);let{data:y}=w,j;try{j=JSON.parse(y.toString())}catch(I){return pe("Invalid JSON response",I),_(new Error("Invalid JSON response"))}if(j.result!==cl.ready)return pe("Invalid first message"),_(new Error("Invalid first message - "+JSON.stringify(j)));_()}function _(w){i||(delete n.onmessage,delete n.onerror,delete n.onclose,w?(s(w),n.close()):a(o),i=!0)}let b=new Promise((w,y)=>{a=w,s=y});return{ws:n,$connect:b}}var Ox=class extends Ci{constructor(e,r){super(e.ws,dt.ws,e.$connect);this._tryToReconnect=!0;this._config=r,this.$connect.then(n=>(this.socId=n,this._ready())).catch(n=>{this.socId||this._setErrored(n)})}_setErrored(e){super._setErrored(e),e.hasOwnProperty("code")&&e.code===me.AuthenticationError&&(this._tryToReconnect=!1)}_ready(){this._setConnected(!0),this._connection.onmessage=e=>{let{data:r,type:n}=e;if(pe(`message(type:${n},data:${r})`),n==="message"){let a=JSON.parse(r.toString());this._handleMessage(a),this._heartbeat()}},this._connection.onerror=e=>{let{message:r,error:n,type:a}=e;pe(`error(message:${r},error:${n},type:${a})`)},this._connection.onclose=e=>{let{reason:r,code:n,wasClean:a}=e;pe(`close(reason:${r},code:${n},wasClean:${a})`),this._setConnected(!1),clearTimeout(this._pingTimeout),this._connectionLost(),this._reconnect()},this._heartbeat()}_reconnect(){if(pe("reconnect(),tryToReconnect:",this._tryToReconnect),!this._tryToReconnect)return;if(this.hooks.reconnect&&!this.hooks.reconnect()){pe("reconnect hook returned false");return}let e=process.env.WAPI_RECONNECT_ATTEMPTS&&parseInt(process.env.WAPI_RECONNECT_ATTEMPTS)||10,r=process.env.WAPI_MAX_RECONNECT_WAIT&&parseInt(process.env.WAPI_MAX_RECONNECT_WAIT)||1e4;this.$connect=(()=>ye(this,null,function*(){let n;for(let a=0;a<e+1;a++)try{pe("Trying to connect, attempt:",a);let{ws:s,$connect:i}=$x(this._config);n=yield i,this.socId=n,this._connection=s,this._ready();break}catch(s){if(s.code===me.AuthenticationError||a>e-1)throw s;yield CT(Math.min(Math.pow(1.5,a)*1e3,r))}return n}))()}_heartbeat(){pe("heartbeat"),clearTimeout(this._pingTimeout),this._pingTimeout=setTimeout(()=>{if(this._sending.size)return pe("pingTimeout reached, but sending.size:",this._sending.size),this._heartbeat();pe("timeout"),this._connection.close(),this._setConnected(!1),this._reconnect()},31e3)}_send(e){pe("send()",e),this._connection.send(JSON.stringify(e))}close(){return ye(this,null,function*(){return pe("close()"),this._tryToReconnect=!1,clearTimeout(this._pingTimeout),this._setConnected(!1),this._connection.close()})}};var Vh=ri(Rx());function Hh(t){let e=kJ(t);return new Ax(e,t)}function kJ(t){function e(a){return ye(this,null,function*(){pe(`http_createConnection>message(body:${a})`)})}function r(a,s){return ye(this,null,function*(){let i=JSON.parse(a),f=yield(yield(0,Vh.default)(`${t.host}/api`,{keepalive:!0,method:"POST",headers:{Authorization:`Bearer ${s}`},body:a})).json();this.onmessage(q(P({},f),{id:i.id}))})}let n=(0,Vh.default)(`${t.host}/api`,{method:"POST",headers:{Authorization:`Bearer ${t.jwt}`},body:JSON.stringify({jsonrpc:ve.version,method:"authenticationCheck",params:{},id:as()})}).then(a=>a.json()).then(a=>{if(a.error)throw new Error(a.error.message);return!0});return{send:r,onmessage:e,$connect:n}}var Ax=class extends Ci{constructor(e,r){super(e,dt.https,e.$connect);this.jwt=r.jwt,this.$connect.then(()=>{this._ready()}).catch(n=>{this._setErrored(n)})}_send(e){pe("send()",e),this._connection.send(JSON.stringify(e),this.jwt)}_ready(){this._setConnected(!0),this._connection.onmessage=e=>ye(this,null,function*(){pe(`http_message(data:${e})`),this._handleMessage(e)})}close(){return ye(this,null,function*(){pe("close()"),this._setConnected(!1)})}_reconnect(){return ye(this,null,function*(){pe("reconnect()")})}};var Tl=class{constructor(e){this.filter=[];this.modifierFn=e}add(e){return this.filter.push(e),this}addWhere(e,r,n,a){if(typeof r=="object"){let s={};for(let[i,o]of Object.entries(r))s[i]=this.modifierFn?this.modifierFn(i,o):o;return this.add({function:e,value:s})}if(typeof r=="function"){let s=new Tl(this.modifierFn);return r.call(s,s),this.add({function:e,inner:s.toJSON().filter})}if(a!==void 0)return this.add({function:e,field:r,operator:n,value:a});if(typeof n=="object")return this.add({function:e,value:{[r]:n}});if(n!==void 0){let s=this.modifierFn?this.modifierFn(r,n):n;return this.add({function:e,field:r,value:s})}throw TypeError("Invalid input")}where(e,r,n){return this.addWhere("where",e,r,n)}orWhere(e,r,n){return this.addWhere("orWhere",e,r,n)}whereIn(e,r){return this.add({function:"whereIn",field:e,value:r})}orWhereIn(e,r){return this.add({function:"orWhereIn",field:e,value:r})}whereNull(e){return this.add({function:"whereNull",field:e})}orWhereNull(e){return this.add({function:"orWhereNull",field:e})}whereNotNull(e){return this.add({function:"whereNotNull",field:e})}orWhereNotNull(e){return this.add({function:"orWhereNotNull",field:e})}whereMetadata(e,r,n){return n===void 0?this.add({function:"whereMetadata",field:e,operator:"=",value:r}):this.add({function:"whereMetadata",field:e,operator:r,value:n})}orWhereMetadata(e,r,n){return n===void 0?this.add({function:"orWhereMetadata",field:e,operator:"=",value:r}):this.add({function:"orWhereMetadata",field:e,operator:r,value:n})}whereMetadataIn(e,r){return this.add({function:"whereMetadataIn",field:e,value:r})}orWhereMetadataIn(e,r){return this.add({function:"orWhereMetadataIn",field:e,value:r})}whereMetadataNull(e){return this.add({function:"whereMetadataNull",field:e})}orWhereMetadataNull(e){return this.add({function:"orWhereMetadataNull",field:e})}whereMetadataNotNull(e){return this.add({function:"whereMetadataNotNull",field:e})}orWhereMetadataNotNull(e){return this.add({function:"orWhereMetadataNotNull",field:e})}toJSON(){return{filter:JSON.parse(JSON.stringify(this.filter))}}};function zh(t){return t.map(e=>{if(typeof e=="string"){if(e.includes(" "))throw new TypeError("invalid order option: "+e);return{field:e,direction:"asc"}}return{field:e.column,direction:e.order,nulls:e.nulls}})}var rd=class extends Tl{constructor({start:e,modifiers:r,optionsModifiers:n}){super(r);this.optionsObject={};this.execFn=e,this.optionsModifiers=n}start(){return this.execFn(this.toJSON())}toJSON(){return q(P({},super.toJSON()),{options:P({},this.optionsObject)})}options(e){if(this.optionsModifiers===void 0)return this.optionsObject=P(P({},this.optionsObject),e),this;this.optionsObject=P({},this.optionsObject);for(let[r,n]of Object.entries(e))this.optionsObject[r]=this.optionsModifiers(r,n);return this}then(e,r){return this.start().then(e,r)}catch(e){return this.start().catch(e)}stream(){return this.start().stream()}},Qe=class extends rd{constructor({start:e,modifiers:r,optionsModifiers:n}){super({start:a=>e(a),modifiers:r,optionsModifiers:n})}limit(e){return this.optionsObject.limit=e,this}offset(e){return this.optionsObject.offset=e,this}orderBy(e,r,n){if(!Array.isArray(e)&&typeof e!="string")throw new TypeError("invalid input");if(Array.isArray(e))return this.optionsObject.order=zh(e),this;if(!e.includes(" "))return this.optionsObject.order=zh([{column:e,order:r||"asc",nulls:n}]),this;let[a,s,i,o]=e.split(" ");if(s!=="asc"&&s!=="desc")throw new TypeError("invalid order");let f={column:a,order:s};if(i==="nulls"){if(!["first","last"].includes(o))throw new TypeError("invalid nulls order");f.nulls=o}return this.optionsObject.order=zh([e]),this}select(...e){return this.optionsObject.select=e,this}deselect(...e){return this.optionsObject.deselect=e,this}};function Di(t,e){if(!e)return{function:t,alias:t};if(!e.includes(" "))return{function:t,field:e,alias:t};if(!e.includes(" as "))throw new de({message:"Invalid Aggregator"});let[r,n]=e.split(" as ");return{function:t,field:r,alias:n||r}}var Kh=class extends rd{constructor({start:e,modifiers:r,optionsModifiers:n}){super({start:a=>e(a),modifiers:r,optionsModifiers:n});this.aggregatorObject={aggregators:[]};this.timezoneString=""}toJSON(){return q(P({},super.toJSON()),{aggregators:JSON.parse(JSON.stringify(this.aggregatorObject.aggregators)),groups:JSON.parse(JSON.stringify(this.aggregatorObject.groups||[]))})}timezone(e){return this.timezoneString=e,this.aggregatorObject.groups&&Array.isArray(this.aggregatorObject.groups)&&this.aggregatorObject.groups.forEach(r=>{r.type==="period"&&(r.field={period:r.field,timezone:e})}),this}groupBy(e,...r){let n={};if(typeof e!="string")throw new TypeError("expected string as input, got"+typeof e);let[a,s]=e.split(" as ");if(Ju.hasOwnProperty(a))n.type="period",n.alias=s||a,this.timezoneString?n.field={period:a,timezone:this.timezoneString}:n.field=a;else if(a.startsWith("metadata.")){let[,i]=a.split(".");n.type="metadata_field",n.field=i,n.alias=s||i}else n.type="field",n.field=a,n.alias=s||a;return this.aggregatorObject.groups?this.aggregatorObject.groups.push(n):this.aggregatorObject.groups=[n],r.length&&r.forEach(i=>this.groupBy(i)),this}count(e){return this.aggregatorObject.aggregators.push(Di("count",e)),this}distinct(e){return this.aggregatorObject.aggregators.push(Di("countDistinct",e)),this}avg(e){return this.aggregatorObject.aggregators.push(Di("average",e)),this}min(e){return this.aggregatorObject.aggregators.push(Di("min",e)),this}max(e){return this.aggregatorObject.aggregators.push(Di("max",e)),this}sum(e){return this.aggregatorObject.aggregators.push(Di("sum",e)),this}},nd=class extends rd{constructor({start:e,modifiers:r,optionsModifiers:n}){super({start:e,modifiers:r,optionsModifiers:n});this.updateObject={}}toJSON(){return q(P({},super.toJSON()),{update:JSON.parse(JSON.stringify(this.updateObject))})}update(e){return this.updateObject=Object.assign(this.updateObject,e),this}},Qh=class extends rd{constructor({start:e,modifiers:r,optionsModifiers:n}){super({start:e,modifiers:r,optionsModifiers:n});this.reverseModifications={}}toJSON(){return q(P({},super.toJSON()),{reverse:JSON.parse(JSON.stringify(this.reverseModifications))})}reverse(e){return this.reverseModifications=Object.assign(this.reverseModifications,e),this}};"use strict";var SJ=F(x.AggregateTransfersFnInput);function yl(t,e,r){let{client:n}=t;if(e===void 0)return new Kh({start(y){return n.api.aggregateTransferMany({transfer:y.filter,options:y.options,groups:y.groups,aggregators:y.aggregators})},modifiers(y,j){return["token","wallet","from_wallet","to_wallet"].includes(y)?G(j):y==="transfer_group"?J(j):j}});let{inputCopy:a,error:s}=M({input:e,options:r,validate:SJ});if(s)throw s;let{token:i,wallet:o,from_wallet:f,to_wallet:u,transfer_group:l,status:_,metadata:b}=a,w={token:G(i),wallet:G(o),from_wallet:G(f),to_wallet:G(u),transfer_group:J(l),status:_,metadata:b};return n.api.aggregateTransferMany({transfer:w,groups:a.groups,aggregators:a.aggregators})}"use strict";var CJ=F(x.CreateAccessTokenFnInput);function bl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:CJ});if(s)throw s;return n.api.createAccessToken({token:a.token,options:t})}"use strict";var PJ=F(x.CreateContractFnInput);function xl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:PJ});if(s)throw s;let i={token:{foreign:a.foreign+"",metadata:a.metadata,owner:G(a.owner),deposits:[{token:G(a.value_token),amount:a.value_amount}]}};return a.buyer&&(a.buyer.latest_control_hash&&console.warn("deprecated: latest_control_hash is deprecated and will be ignored"),i.exchange={from_wallet:G(a.buyer.wallet),amount:a.buyer.amount||a.value_amount,from_token:G(a.buyer.token||a.value_token),metadata:a.buyer.metadata}),n.api.createContract(i)}"use strict";var GJ=F(x.CreateDepositFnInput);function Fl(t,e,r){let{client:n}=t,a=yt(e,"token",n.getConfig("token")),{inputCopy:s,error:i}=M({input:a,options:r,validate:GJ});if(i)throw i;let o=s.token||n.getConfig("token");if(o===void 0)throw new de({message:re.INPUT_NEEDS_TOKEN,data:e});let f=s.options;delete s.options;let u=q(P({},s),{identifier:s.identifier,transfer_group:J(s.transfer_group),token:G(o),to_wallet:G(s.wallet),type:"deposit"});return u.identifier||(u.identifier=Re(u)),n.api.createTransfer({transfer:u,options:Gd(f,{return_balance:"return_to_balance",create_wallet_if_not_exists:"create_to_wallet_if_not_exists"})})}"use strict";var DJ=F(x.CreateExchangeFnInput);function wl(t,e,r){var o,f,u,l,_;let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:DJ});if(s)throw s;let i=a.options;return delete a.options,(o=a.identifier)!=null||(a.identifier=Re(a)),n.api.createTransferGroup({transfer_group:{identifier:a.identifier,status:ad.closed,transfer_status:(f=a.status)!=null?f:"pending",metadata:a.metadata,children:[{identifier:(u=a.from_identifier)!=null?u:Re(),from_wallet:G(a.from_wallet),to_wallet:G(a.to_wallet),token:G(a.from_token),type:a.from_wallet?za.transfer:za.deposit,amount:a.from_amount,metadata:a.metadata,force:a.force},{identifier:(l=a.to_identifier)!=null?l:Re(),from_wallet:G(a.to_wallet),to_wallet:G(a.from_wallet),token:G(a.to_token),type:a.to_wallet?za.transfer:za.deposit,amount:(_=a.to_amount)!=null?_:a.from_amount,metadata:a.metadata,force:a.force}]},options:i})}"use strict";var MJ=F(x.CreateTokenFnInput);function $l(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:MJ});if(s)throw s;let i=a.options;return delete a.options,n.api.createToken({token:q(P({},a),{belongs_to:G(a.belongs_to)}),options:i})}"use strict";var WJ=F(x.CreateTransferFnInput);function Ol(t,e,r){let{client:n}=t,a=yt(e,"token",n.getConfig("token")),{inputCopy:s,error:i}=M({input:a,options:r,validate:WJ});if(i)throw i;let o=Ka(s,n.getConfig("token"));return o.identifier||(o.identifier=Re(o)),n.api.createTransfer({transfer:o,options:s.options})}function Ka(t,e){t.type=t.type||"transfer";let r={identifier:t.identifier,token:G(t.token||e),amount:t.amount,metadata:t.metadata,status:t.status,type:t.type,transfer_group:J(t.transfer_group),created_at:t.created_at};if(t.type==="transfer")return t.latest_control_hash&&console.warn("deprecated: latest_control_hash is deprecated"),q(P({},r),{from_wallet:G(t.from_wallet),to_wallet:G(t.to_wallet)});if(t.type==="withdrawal")return t.latest_control_hash&&console.warn("deprecated: latest_control_hash is deprecated"),q(P({},r),{from_wallet:G(t.wallet)});if(t.type==="deposit")return q(P({},r),{to_wallet:G(t.wallet)})}"use strict";var EJ=F(x.CreateTransferGroupFnInput);function vl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:EJ});if(s)throw s;let i=JSON.parse(JSON.stringify(a));return delete i.options,i.children&&(i.children=i.children.map(o=>Ka(o,n.getConfig("token")))),i.identifier||(i.identifier=Re(i)),n.api.createTransferGroup({transfer_group:i,options:a.options})}"use strict";var RJ=F(x.CreateTransfersFnInput);function jl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:RJ});if(s)throw s;let i=a.transfers.map(o=>Ka(o,n.getConfig("token")));for(let o of i)o.identifier||(o.identifier=Re(o));return n.api.createTransferMany({transfers:i,options:a.options})}"use strict";var AJ=F(x.CreateWalletFnInput);function Il(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:AJ});if(s)throw s;let i=a.options;return delete a.options,n.api.createWallet({wallet:P({},a),options:i})}"use strict";var UJ=F(x.CreateWithdrawalFnInput);function kl(t,e,r){let{client:n}=t,a=yt(e,"token",n.getConfig("token")),{inputCopy:s,error:i}=M({input:a,options:r,validate:UJ});if(i)throw i;let o=s.options;delete s.options,s.latest_control_hash&&(console.warn("deprecated: latest_control_hash is deprecated"),delete s.latest_control_hash);let f=s.token||n.getConfig("token");if(f===void 0)throw new de({message:re.INPUT_NEEDS_TOKEN,data:e});let u=q(P({},s),{identifier:s.identifier,transfer_group:J(s.transfer_group),token:G(f),from_wallet:G(s.wallet),type:"withdrawal"});return u.identifier||(u.identifier=Re(u)),n.api.createTransfer({transfer:u,options:Gd(o,{return_balance:"return_from_balance"})})}"use strict";var qJ=F(x.FindBalancesFnInput);function Sl(t,e,r){var u,l;let{client:n}=t;if(e===void 0)return new Qe({start(_){return n.api.findBalanceMany({balance:_.filter,options:_.options})},modifiers(_,b){return["wallet","token"].includes(_)?G(b):b}});let{inputCopy:a,error:s}=M({input:e,options:r,validate:qJ});if(s)throw s;let i={};a.wallet&&(i.wallet=G(a.wallet)),a.token&&(i.token=G(a.token));let o=(u=a.options)==null?void 0:u.order_by;(l=a.options)==null||delete l.order_by;let f=P({},a.options);return!f.order&&o&&(f.order=bt(o)),n.api.findBalanceMany({balance:i,options:f})}"use strict";var NJ=F(x.FindTokensFnInput);function Cl(t,e,r){var u,l;let{client:n}=t;if(e===void 0)return new Qe({start(_){return n.api.findTokenMany({token:_.filter,options:_.options})},modifiers(_,b){return["belongs_to"].includes(_)?G(b):b}});let{inputCopy:a,error:s}=M({input:e,options:r,validate:NJ});if(s)throw s;let i={foreign:a.foreign?a.foreign+"":void 0,type:a.type,metadata:a.metadata};a.belongs_to&&(i.belongs_to=G(a.belongs_to));let o=(u=a.options)==null?void 0:u.order_by;(l=a.options)==null||delete l.order_by;let f=P({},a.options);return!f.order&&o&&(f.order=bt(o)),n.api.findTokenMany({token:i,options:f})}"use strict";var BJ=F(x.FindTransferGroupsFnInput);function Pl(t,e,r){var y,j;let{client:n}=t;if(e===void 0)return new Qe({start(I){return n.api.findTransferGroupMany({transfer_group:I.filter,options:I.options})},modifiers(I,k){return["transfer_group","reverses"].includes(I)?J(k):k}});let{inputCopy:a,error:s}=M({input:e,options:r,validate:BJ});if(s)throw s;let{identifier:i,transfer_status:o,status:f,metadata:u,type:l}=a,_={identifier:i,transfer_status:o,status:f,metadata:u,type:l};a.reverses&&(_.reverses=J(a.reverses));let b=(y=a.options)==null?void 0:y.order_by;(j=a.options)==null||delete j.order_by;let w=P({},a.options);return!w.order&&b&&(w.order=bt(b)),n.api.findTransferGroupMany({transfer_group:_,options:w})}"use strict";var LJ=F(x.FindTransfersFnInput);function Gl(t,e,r){var j;let{client:n}=t;if(e===void 0)return new Qe({start(I){return n.api.findTransferMany({transfer:I.filter,options:I.options})},modifiers(I,k){return["token","wallet","from_wallet","to_wallet"].includes(I)?G(k):I==="transfer_group"?J(k):k}});let{inputCopy:a,error:s}=M({input:e,options:r,validate:LJ});if(s)throw s;let{token:i,wallet:o,from_wallet:f,to_wallet:u}=a,l={token:G(i),wallet:G(o),from_wallet:G(f),to_wallet:G(u)};a.transfer_group&&(l.transfer_group=J(a.transfer_group)),a.status&&(l.status=a.status),a.metadata&&(l.metadata=a.metadata),(j=a.options)!=null||(a.options={});let _=a.options.order_by;if(delete a.options.order_by,a.options.return_running_balance){if(a.options.return_running_balance_for_wallet)throw new de({message:re.CONFLICTING_OPTIONS,data:{options:a.options}});if(!l.wallet)throw new de({message:re.RUNNING_BALANCE_WITHOUT_WALLET,data:{input:a}});a.options.return_running_balance_for_wallet=a.wallet}let b=a.options.return_running_balance_for_wallet;if(delete a.options.return_running_balance_for_wallet,a.options.return_signed_amount){if(a.options.return_signed_amount_for_wallet)throw new de({message:re.CONFLICTING_OPTIONS,data:{options:a.options}});if(!l.wallet)throw new de({message:re.SIGNED_AMOUNT_WITHOUT_WALLET,data:{input:a}});a.options.return_signed_amount_for_wallet=a.wallet}let w=a.options.return_signed_amount_for_wallet;delete a.options.return_signed_amount_for_wallet;let y=P({},a.options);return!y.order&&_&&(y.order=bt(_)),b&&(y.return_running_balance_for_wallet=G(b)),w&&(y.return_signed_amount_for_wallet=G(w)),n.api.findTransferMany({transfer:l,options:y})}"use strict";var VJ=F(x.FindWalletsFnInput);function Dl(t,e,r){var l;let{client:n}=t;if(e===void 0)return new Qe({start(_){return n.api.findWalletMany({wallet:_.filter,options:_.options})},optionsModifiers(_,b){return _==="include_balance_for_token"&&typeof b!="object"?G(b):b}});let{inputCopy:a,error:s}=M({input:e,options:r,validate:VJ});if(s)throw s;let i=(l=a.options)!=null?l:{};delete a.options;let o=P({},a),f=i.order_by;delete i.order_by;let u=P({},i);return!u.order&&f&&(u.order=bt(f)),n.api.findWalletMany({wallet:o,options:u})}"use strict";var HJ=F(x.GetBalanceFnInput);function Ml(t,e,r){let{client:n}=t,a=yt(e,"token",n.getConfig("token")),{inputCopy:s,error:i}=M({input:a,options:r,validate:HJ});if(i)throw i;if(s.datetime&&WT(s.datetime))throw new de({message:re.BAL_FUTURE_DATETIME,data:s});let o=s.token||n.getConfig("token");if(o===void 0)throw new de({message:re.INPUT_NEEDS_TOKEN,data:e});return n.api.getBalance({balance:{wallet:G(s.wallet),token:G(o),datetime:s.datetime},options:s.options})}"use strict";var zJ=F(x.GetBalanceHistoryFnInput);function Wl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:zJ});if(s)throw s;let i=a.token||n.getConfig("token");if(i===void 0)throw new de({message:re.INPUT_NEEDS_TOKEN,data:e});return n.api.getBalanceHistory({balance:{wallet:G(a.wallet),token:G(i)},options:a.options})}"use strict";var KJ=F(x.GetFlagsFnInput);function El(t,e,r){let{client:n}=t,{error:a,inputCopy:s}=M({input:e||{},options:r,validate:KJ});if(a)throw a;return n.api.getFlags({options:s.options})}"use strict";var QJ=F(x.GetStatisticsFnInput);function Rl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e||{},options:r,validate:QJ});if(s)throw s;return n.api.getStatistics({model:a.model||"Transfer",aggregator:a.aggregator||"count",groups:a.groups,filter:a.filter,options:a.options})}"use strict";var JJ=F(x.GetTokenFnInput);function Al(t,e={},r){let{client:n}=t,a=yt(e,"foreign",n.getConfig("token")),{inputCopy:s,error:i}=M({input:a,options:r,validate:JJ});if(i)throw i;let o=s.foreign||n.getConfig("token");if(o===void 0)throw new de({message:re.INPUT_NEEDS_TOKEN,data:e});return n.api.getToken({token:G(o),options:s.options})}"use strict";var XJ=F(x.GetTransferFnInput);function Ul(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:XJ});if(s)throw s;return n.api.getTransfer({transfer:J(a.transfer),options:a.options})}"use strict";var YJ=F(x.GetTransferGroupFnInput);function ql(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:YJ});if(s)throw s;return n.api.getTransferGroup({transfer_group:J(a.transfer_group),options:a.options})}"use strict";var ZJ=F(x.GetWalletFnInput);function Nl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:ZJ});if(s)throw s;return n.api.getWallet({wallet:G(a.wallet),options:a.options})}var e4=F(x.ImportDataFnInput);function Bl(t){let{error:e}=e4(t);return e===void 0}var Dle=F(x.ImportDataFnOutput);var t4=F(x.ImportDataFnStreamChunk);function Ux(t){let{error:e}=t4(t);return e===void 0}var r4=F(x.ImportDataFnOptions);function Mi(t){let{error:e}=r4(t);return e===void 0}"use strict";var n4=F(x.ImportDataFnInput);function Ll(t,e,r){let{client:n}=t;if(e===void 0&&r===void 0)return n.api.importActionsStream(void 0,qx());if(r===void 0&&Mi(e))return n.api.importActionsStream(e,qx());let{inputCopy:a,error:s}=M({input:e,options:r,validate:n4});if(s)throw s;return n.api.importActions(a)}var a4=F(x.ImportDataFnStreamChunk);function qx(){let t=[];return new Hc({dataTransform(e){return ye(this,null,function*(){if(e===void 0)return{actions:t};if(!Ux(e)){let{error:r}=a4(e);throw new Ne({message:re.INPUT_INVALID,data:{data:e,error:r}})}if(t.push(s4(e)),t.length>=50){let r=t;return t=[],{actions:r}}})}})}function s4(t){switch(t.target){case"wallet":return t;case"token":return{target:"token",data:q(P({},t.data),{belongs_to:G(t.data.belongs_to)})};case"transfer":return{target:"transfer",data:q(P({},Ka(q(P({},t.data),{status:"pending"}))),{status:t.data.status,status_finalized_at:t.data.status_finalized_at})};case"transfer_group":return{target:"transfer_group",data:q(P({},t.data),{children:t.data.children.map(e=>Ka(e))})}}}"use strict";var i4=F(x.ReverseTransferFnInput);function Vl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:i4});if(s)throw s;return a.extend_metadata&&console.warn("deprecated: extend_metadata is deprecated. Use metadata_action instead"),n.api.reverseTransfer({transfer:J(a.transfer),reverse:{force:a.force,metadata:a.metadata,extend_metadata:a.extend_metadata,identifier:a.identifier,status:a.status},options:a.options})}"use strict";var o4=F(x.ReverseTransferGroupFnInput);function Hl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:o4});if(s)throw s;return a.extend_metadata&&console.warn("deprecated: extend_metadata is deprecated. Use metadata_action instead"),n.api.reverseTransferGroup({transfer_group:J(a.transfer_group),reverse:{status:a.status,force:a.force,transfer_status:a.transfer_status,identifier:a.identifier,metadata:a.metadata,transfer_metadata:a.transfer_metadata,extend_metadata:a.extend_metadata,transfer_extend_metadata:a.transfer_extend_metadata},options:a.options})}"use strict";var p4=F(x.ReverseTransfersFnInput);function zl(t,e,r){let{client:n}=t;if(e===void 0)return new Qh({start(_){return n.api.reverseTransferMany({transfer:_.filter,reverse:_.reverse,options:_.options})},modifiers(_,b){return["token","wallet","from_wallet","to_wallet"].includes(_)?G(b):_==="transfer_group"?J(b):b}});let{inputCopy:a,error:s}=M({input:e,options:r,validate:p4});if(s)throw s;let{token:i,wallet:o,from_wallet:f,to_wallet:u}=a,l={token:G(i),wallet:G(o),from_wallet:G(f),to_wallet:G(u)};return a.transfer_group&&(l.transfer_group=J(a.transfer_group)),a.status&&(l.status=a.status),a.metadata&&(l.metadata=a.metadata),n.api.reverseTransferMany({transfer:l,reverse:a.reverse,options:a.options})}var Jh;(function(r){r.whereMetadata="whereMetadata",r.orWhereMetadata="orWhereMetadata"})(Jh||(Jh={}));var Xh;(function(r){r.where="where",r.orWhere="orWhere"})(Xh||(Xh={}));var Yh;(function(r){r.whereIn="whereIn",r.orWhereIn="orWhereIn"})(Yh||(Yh={}));var Zh;(function(r){r.whereMetadataIn="whereMetadataIn",r.orWhereMetadataIn="orWhereMetadataIn"})(Zh||(Zh={}));var eg;(function(a){a.whereMetadataNull="whereMetadataNull",a.orWhereMetadataNull="orWhereMetadataNull",a.whereMetadataNotNull="whereMetadataNotNull",a.orWhereMetadataNotNull="orWhereMetadataNotNull"})(eg||(eg={}));var tg;(function(a){a.whereNull="whereNull",a.orWhereNull="orWhereNull",a.whereNotNull="whereNotNull",a.orWhereNotNull="orWhereNotNull"})(tg||(tg={}));var rg;(function(t){t["="]="=",t[">="]=">=",t["<="]="<=",t["<"]="<",t[">"]=">"})(rg||(rg={}));var ng;(function(r){r.like="like",r.ilike="ilike"})(ng||(ng={}));var ag;(function(r){r["="]="=",r[">="]=">=",r["<="]="<=",r["<"]="<",r[">"]=">",r.like="like",r.ilike="ilike"})(ag||(ag={}));var sg;(function(a){a.value="value",a.share="share",a.group="group",a.contract="contract"})(sg||(sg={}));var ig;(function(r){r.active="active",r["dw-only"]="dw-only",r.disabled="disabled"})(ig||(ig={}));var ad;(function(r){r.open="open",r.closed="closed"})(ad||(ad={}));var og;(function(n){n.pending="pending",n.finished="finished",n.cancelled="cancelled"})(og||(og={}));var pg;(function(r){r.pending="pending",r.finished="finished"})(pg||(pg={}));var fg;(function(n){n.regular="regular",n.exchange="exchange",n.distribution="distribution"})(fg||(fg={}));var za;(function(n){n.transfer="transfer",n.deposit="deposit",n.withdrawal="withdrawal"})(za||(za={}));var ug;(function(n){n.token="token",n.house="house",n.regular="regular"})(ug||(ug={}));var dg;(function(r){r.active="active",r.disabled="disabled"})(dg||(dg={}));var lg;(function(r){r.flag="flag",r.setting="setting"})(lg||(lg={}));var cg;(function(o){o.Token="Token",o.TransferGroup="TransferGroup",o.TransferLog="TransferLog",o.Transfer="Transfer",o.WalletTokenSetting="WalletTokenSetting",o.Wallet="Wallet",o.WapiSetting="WapiSetting"})(cg||(cg={}));"use strict";var f4=F(x.SetFlagsFnInput);function Kl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:f4});if(s)throw s;let i=Object.keys(cs.definitions.Flags.properties),o={};if(i.forEach(f=>{f in a&&(o[f]=a[f])}),Object.keys(o).length<1)throw new de({message:`One of [${i.join()}] is required`,data:e});return n.api.setFlags({flags:o,options:a.options})}"use strict";var u4=F(x.UpdateTokenFnInput);function Ql(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:u4});if(s)throw s;return n.api.updateToken({token:G(a.token),update:{public:a.public,metadata:a.metadata,status:a.status},options:a.options})}"use strict";var d4=F(x.UpdateTransferFnInput);function Jl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:d4});if(s)throw s;return n.api.updateTransfer({transfer:J(a.transfer),update:{status:a.status,metadata:a.metadata},options:a.options})}"use strict";var l4=F(x.UpdateTransferGroupFnInput);function Xl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:l4});if(s)throw s;return n.api.updateTransferGroup({transfer_group:J(a.transfer_group),update:{transfer_status:a.transfer_status,status:a.status},options:a.options})}"use strict";var c4=F(x.UpdateTransferGroupsFnInput);function Yl(t,e,r){let{client:n}=t;if(e===void 0)return new nd({start(b){return n.api.updateTransferGroupMany({transfer_group:b.filter,update:b.update,options:b.options})},modifiers(b,w){return["transfer_group","reverses"].includes(b)?J(w):w}});let{inputCopy:a,error:s}=M({input:e,options:r,validate:c4});if(s)throw s;let{transfer_status:i,status:o,metadata:f,type:u,update:l}=a,_={transfer_status:i,status:o,metadata:f,type:u};return a.reverses&&(_.reverses=J(a.reverses)),n.api.updateTransferGroupMany({transfer_group:_,update:l,options:a.options})}"use strict";var m4=F(x.UpdateTransfersFnInput);function Zl(t,e,r){let{client:n}=t;if(e===void 0)return new nd({start(_){return n.api.updateTransferMany({transfer:_.filter,update:_.update,options:_.options})},modifiers(_,b){return["token","wallet","from_wallet","to_wallet"].includes(_)?G(b):_==="transfer_group"?J(b):b}});let{inputCopy:a,error:s}=M({input:e,options:r,validate:m4});if(s)throw s;let{token:i,wallet:o,from_wallet:f,to_wallet:u}=a,l={token:G(i),wallet:G(o),from_wallet:G(f),to_wallet:G(u)};return a.transfer_group&&(l.transfer_group=J(a.transfer_group)),a.status&&(l.status=a.status),a.metadata&&(l.metadata=a.metadata),n.api.updateTransferMany({transfer:l,update:a.update,options:a.options})}"use strict";var h4=F(x.UpdateWalletFnInput);function ec(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:h4});if(s)throw s;return n.api.updateWallet({wallet:G(a.wallet),update:{metadata:a.metadata,status:a.status,name:a.name},options:a.options})}var g4={aggregateTransfers:F(x.AggregateTransfersFnInput),createAccessToken:F(x.CreateAccessTokenFnInput),createContract:F(x.CreateContractFnInput),createDeposit:F(x.CreateDepositFnInput),createExchange:F(x.CreateExchangeFnInput),createToken:F(x.CreateTokenFnInput),createTransfer:F(x.CreateTransferFnInput),createTransferGroup:F(x.CreateTransferGroupFnInput),createTransfers:F(x.CreateTransfersFnInput),createWallet:F(x.CreateWalletFnInput),createWithdrawal:F(x.CreateWithdrawalFnInput),findBalances:F(x.FindBalancesFnInput),findTokens:F(x.FindTokensFnInput),findTransferGroups:F(x.FindTransferGroupsFnInput),findTransfers:F(x.FindTransfersFnInput),findWallets:F(x.FindWalletsFnInput),getBalance:F(x.GetBalanceFnInput),getBalanceHistory:F(x.GetBalanceHistoryFnInput),getFlags:F(x.GetFlagsFnInput),getStatistics:F(x.GetStatisticsFnInput),getToken:F(x.GetTokenFnInput),getTransfer:F(x.GetTransferFnInput),getTransferGroup:F(x.GetTransferGroupFnInput),getWallet:F(x.GetWalletFnInput),importData:F(x.ImportDataFnInput),reverseTransfer:F(x.ReverseTransferFnInput),reverseTransferGroup:F(x.ReverseTransferGroupFnInput),reverseTransfers:F(x.ReverseTransfersFnInput),setFlags:F(x.SetFlagsFnInput),updateToken:F(x.UpdateTokenFnInput),updateTransfer:F(x.UpdateTransferFnInput),updateTransferGroup:F(x.UpdateTransferGroupFnInput),updateTransferGroups:F(x.UpdateTransferGroupsFnInput),updateTransfers:F(x.UpdateTransfersFnInput),updateWallet:F(x.UpdateWalletFnInput)},U={aggregateTransfers:yl,createAccessToken:bl,createContract:xl,createDeposit:Fl,createExchange:wl,createToken:$l,createTransfer:Ol,createTransferGroup:vl,createTransfers:jl,createWallet:Il,createWithdrawal:kl,findBalances:Sl,findTokens:Cl,findTransferGroups:Pl,findTransfers:Gl,findWallets:Dl,getBalance:Ml,getBalanceHistory:Wl,getFlags:El,getStatistics:Rl,getToken:Al,getTransfer:Ul,getTransferGroup:ql,getWallet:Nl,importData:Ll,reverseTransfer:Vl,reverseTransferGroup:Hl,reverseTransfers:zl,setFlags:Kl,updateToken:Ql,updateTransfer:Jl,updateTransferGroup:Xl,updateTransferGroups:Yl,updateTransfers:Zl,updateWallet:ec},mg;(function(D){D.aggregateTransfers="aggregateTransfers",D.createAccessToken="createAccessToken",D.createContract="createContract",D.createDeposit="createDeposit",D.createExchange="createExchange",D.createToken="createToken",D.createTransfer="createTransfer",D.createTransferGroup="createTransferGroup",D.createTransfers="createTransfers",D.createWallet="createWallet",D.createWithdrawal="createWithdrawal",D.findBalances="findBalances",D.findTokens="findTokens",D.findTransferGroups="findTransferGroups",D.findTransfers="findTransfers",D.findWallets="findWallets",D.getBalance="getBalance",D.getBalanceHistory="getBalanceHistory",D.getFlags="getFlags",D.getStatistics="getStatistics",D.getToken="getToken",D.getTransfer="getTransfer",D.getTransferGroup="getTransferGroup",D.getWallet="getWallet",D.importData="importData",D.reverseTransfer="reverseTransfer",D.reverseTransferGroup="reverseTransferGroup",D.reverseTransfers="reverseTransfers",D.setFlags="setFlags",D.updateToken="updateToken",D.updateTransfer="updateTransfer",D.updateTransferGroup="updateTransferGroup",D.updateTransferGroups="updateTransferGroups",D.updateTransfers="updateTransfers",D.updateWallet="updateWallet"})(mg||(mg={}));var hg;(function(r){r.findTransfers="findTransfers",r.findWallets="findWallets"})(hg||(hg={}));var sd=class{constructor(e,r){this.config={};if(this.api=e,this.$connect=e.$connect,r&&(r.token&&(this.config=q(P({},this.config),{token:r.token})),r.hooks))for(let[n,a]of Object.entries(r.hooks))this.setHook(n,a)}close(){return ye(this,null,function*(){return this.api.close()})}version(){return hl}setHook(e,r){if(typeof r!="function")throw new TypeError("Hooks can only be functions");return this.api.hooks[e]=r,this}configure(e){return this.config=P(P({},this.config),e),this}getConfig(e){return this.config[e]}aggregateTransfers(e,r){return e===void 0?U.aggregateTransfers({client:this}):U.aggregateTransfers({client:this},e,r)}createAccessToken(e,r){return U.createAccessToken({client:this},e,r)}createContract(e,r){return U.createContract({client:this},e,r)}createDeposit(e,r){return U.createDeposit({client:this},e,r)}createExchange(e,r){return U.createExchange({client:this},e,r)}createToken(e,r){return U.createToken({client:this},e,r)}createTransfer(e,r){return U.createTransfer({client:this},e,r)}createTransferGroup(e,r){return U.createTransferGroup({client:this},e,r)}createTransfers(e,r){return U.createTransfers({client:this},e,r)}createWallet(e,r){return U.createWallet({client:this},e,r)}createWithdrawal(e,r){return U.createWithdrawal({client:this},e,r)}findBalances(e,r){return e===void 0?U.findBalances({client:this}):U.findBalances({client:this},e,r)}findTokens(e,r){return e===void 0?U.findTokens({client:this}):U.findTokens({client:this},e,r)}findTransferGroups(e,r){return e===void 0?U.findTransferGroups({client:this}):U.findTransferGroups({client:this},e,r)}findTransfers(e,r){return e===void 0?U.findTransfers({client:this}):U.findTransfers({client:this},e,r)}findWallets(e,r){return e===void 0?U.findWallets({client:this}):U.findWallets({client:this},e,r)}getBalance(e,r){return U.getBalance({client:this},e,r)}getBalanceHistory(e,r){return U.getBalanceHistory({client:this},e,r)}getFlags(e,r){return U.getFlags({client:this},e,r)}getStatistics(e,r){return U.getStatistics({client:this},e,r)}getToken(e,r){return U.getToken({client:this},e,r)}getTransfer(e,r){return U.getTransfer({client:this},e,r)}getTransferGroup(e,r){return U.getTransferGroup({client:this},e,r)}getWallet(e,r){return U.getWallet({client:this},e,r)}importData(e,r){if(e===void 0&&r===void 0)return U.importData({client:this});if(r===void 0&&Mi(e))return U.importData({client:this},e);if(Bl(e))return U.importData({client:this},e,r);throw new Ne({message:re.INPUT_INVALID,data:{input:e,options:r}})}reverseTransfer(e,r){return U.reverseTransfer({client:this},e,r)}reverseTransferGroup(e,r){return U.reverseTransferGroup({client:this},e,r)}reverseTransfers(e,r){return e===void 0?U.reverseTransfers({client:this}):U.reverseTransfers({client:this},e,r)}setFlags(e,r){return U.setFlags({client:this},e,r)}updateToken(e,r){return U.updateToken({client:this},e,r)}updateTransfer(e,r){return U.updateTransfer({client:this},e,r)}updateTransferGroup(e,r){return U.updateTransferGroup({client:this},e,r)}updateTransferGroups(e,r){return e===void 0?U.updateTransferGroups({client:this}):U.updateTransferGroups({client:this},e,r)}updateTransfers(e,r){return e===void 0?U.updateTransfers({client:this}):U.updateTransfers({client:this},e,r)}updateWallet(e,r){return U.updateWallet({client:this},e,r)}};function Nx(t,e){let r=Mh(t);return new sd(r,e)}function Bx(t,e){let r=Hh(t);return new sd(r,e)}var _4=Qu.getValidator(x.ClientOptions),dt;(function(r){r.ws="ws",r.https="https"})(dt||(dt={}));function T4(t){let e=t.config,{inputCopy:r,error:n}=_4(t);if(n)throw n;if(r.client===dt.ws)return Nx(r.connection,e);if(r.client===dt.https)return Bx(r.connection,e);throw new TypeError("Invalid client type")}var y4={getIdentifier:PT};0&&(module.exports={APIFunctions,APIValidators,AggregateTransferManyTxInputSchema,AggregateTransferManyTxOutputSchema,AggregateTransfersFnInputSchema,AggregateTransfersFnOutputSchema,AuthenticationCheckTxInputSchema,AuthenticationCheckTxOutputSchema,Client,ClientFunctions,ClientFunctionsEnum,ClientQueryBuilderFunctionsEnum,ClientValidators,ConstsSchema,CreateAccessTokenFnInputSchema,CreateAccessTokenFnOutputSchema,CreateAccessTokenTxInputSchema,CreateAccessTokenTxOutputSchema,CreateContractFnInputSchema,CreateContractFnOutputSchema,CreateContractTxInputSchema,CreateContractTxOutputSchema,CreateDepositFnInputSchema,CreateDepositFnOutputSchema,CreateDepositTxInputSchema,CreateDepositTxOutputSchema,CreateDistributionTxInputSchema,CreateDistributionTxOutputSchema,CreateExchangeFnInputSchema,CreateExchangeFnOutputSchema,CreateTokenFnInputSchema,CreateTokenFnOutputSchema,CreateTokenTxInputSchema,CreateTokenTxOutputSchema,CreateTransferFnInputSchema,CreateTransferFnOutputSchema,CreateTransferGroupFnInputSchema,CreateTransferGroupFnOutputSchema,CreateTransferGroupTxInputSchema,CreateTransferGroupTxOutputSchema,CreateTransferManyTxInputSchema,CreateTransferManyTxOutputSchema,CreateTransferTxInputSchema,CreateTransferTxOutputSchema,CreateTransfersFnInputSchema,CreateTransfersFnOutputSchema,CreateWalletFnInputSchema,CreateWalletFnOutputSchema,CreateWalletTxInputSchema,CreateWalletTxOutputSchema,CreateWithdrawalFnInputSchema,CreateWithdrawalFnOutputSchema,CreateWithdrawalTxInputSchema,CreateWithdrawalTxOutputSchema,DbFilterFunctionBasicEnum,DbFilterFunctionInEnum,DbFilterFunctionMetadataBasicEnum,DbFilterFunctionMetadataInEnum,DbFilterFunctionMetadataNullEnum,DbFilterFunctionNullEnum,DbFilterOperatorEnum,DbFilterOperatorExtendedEnum,DbFilterOperatorStringEnum,DbModelNameEnum,ErrorMessage,Errors,ExportDatabaseTxInputSchema,ExportDatabaseTxOutputSchema,FindBalanceManyTxInputSchema,FindBalanceManyTxOutputSchema,FindBalancesFnInputSchema,FindBalancesFnOutputSchema,FindTokenManyTxInputSchema,FindTokenManyTxOutputSchema,FindTokensFnInputSchema,FindTokensFnOutputSchema,FindTransferGroupManyTxInputSchema,FindTransferGroupManyTxOutputSchema,FindTransferGroupsFnInputSchema,FindTransferGroupsFnOutputSchema,FindTransferManyTxInputSchema,FindTransferManyTxOutputSchema,FindTransfersFnInputSchema,FindTransfersFnOutputSchema,FindWalletManyTxInputSchema,FindWalletManyTxOutputSchema,FindWalletsFnInputSchema,FindWalletsFnOutputSchema,FinishTransactionTxInputSchema,FinishTransactionTxOutputSchema,FnConstsSchema,GetBalanceFnInputSchema,GetBalanceFnOutputSchema,GetBalanceHistoryFnInputSchema,GetBalanceHistoryFnOutputSchema,GetBalanceHistoryTxInputSchema,GetBalanceHistoryTxOutputSchema,GetBalanceTxInputSchema,GetBalanceTxOutputSchema,GetDatabaseExportProgressTxInputSchema,GetDatabaseExportProgressTxOutputSchema,GetDatabaseImportProgressTxInputSchema,GetDatabaseImportProgressTxOutputSchema,GetFlagsFnInputSchema,GetFlagsFnOutputSchema,GetFlagsTxInputSchema,GetFlagsTxOutputSchema,GetStatisticsFnInputSchema,GetStatisticsFnOutputSchema,GetStatisticsTxInputSchema,GetStatisticsTxOutputSchema,GetTokenFnInputSchema,GetTokenFnOutputSchema,GetTokenManyTxInputSchema,GetTokenManyTxOutputSchema,GetTokenTxInputSchema,GetTokenTxOutputSchema,GetTransferFnInputSchema,GetTransferFnOutputSchema,GetTransferGroupFnInputSchema,GetTransferGroupFnOutputSchema,GetTransferGroupTxInputSchema,GetTransferGroupTxOutputSchema,GetTransferTxInputSchema,GetTransferTxOutputSchema,GetWalletFnInputSchema,GetWalletFnOutputSchema,GetWalletManyTxInputSchema,GetWalletManyTxOutputSchema,GetWalletTxInputSchema,GetWalletTxOutputSchema,ITxAggregatorSimpleEnum,ITxDistributorLeftoverRuleEnum,ITxMetadataActionEnum,ITxMetadataActionForReverseEnum,ITxPeriodSimpleEnum,ImportActionsTxInputSchema,ImportActionsTxOutputSchema,ImportDataFnInputSchema,ImportDataFnOutputSchema,ImportDatabaseTxInputSchema,ImportDatabaseTxOutputSchema,ListDatabaseBackupsTxInputSchema,ListDatabaseBackupsTxOutputSchema,QueryBuilder,QueryLogsTxInputSchema,QueryLogsTxOutputSchema,QueryTxInputSchema,QueryTxOutputSchema,ResetDatabaseTxInputSchema,ResetDatabaseTxOutputSchema,ReverseTransferFnInputSchema,ReverseTransferFnOutputSchema,ReverseTransferGroupFnInputSchema,ReverseTransferGroupFnOutputSchema,ReverseTransferGroupManyTxInputSchema,ReverseTransferGroupManyTxOutputSchema,ReverseTransferGroupTxInputSchema,ReverseTransferGroupTxOutputSchema,ReverseTransferManyTxInputSchema,ReverseTransferManyTxOutputSchema,ReverseTransferTxInputSchema,ReverseTransferTxOutputSchema,ReverseTransfersFnInputSchema,ReverseTransfersFnOutputSchema,SetFlagsFnInputSchema,SetFlagsFnOutputSchema,SetFlagsTxInputSchema,SetFlagsTxOutputSchema,StartTransactionTxInputSchema,StartTransactionTxOutputSchema,StreamPromise,TokenStatusEnum,TokenTableInputSchema,TokenTableSchema,TokenTypeEnum,TransferGroupStatusEnum,TransferGroupTableInputSchema,TransferGroupTableSchema,TransferGroupTypeEnum,TransferLogTableInputSchema,TransferLogTableSchema,TransferStatusEnum,TransferStatusInputEnum,TransferTableInputSchema,TransferTableSchema,TransferTypeEnum,TxConstsSchema,UpdateTokenFnInputSchema,UpdateTokenFnOutputSchema,UpdateTokenTxInputSchema,UpdateTokenTxOutputSchema,UpdateTransferFnInputSchema,UpdateTransferFnOutputSchema,UpdateTransferGroupFnInputSchema,UpdateTransferGroupFnOutputSchema,UpdateTransferGroupManyTxInputSchema,UpdateTransferGroupManyTxOutputSchema,UpdateTransferGroupTxInputSchema,UpdateTransferGroupTxOutputSchema,UpdateTransferGroupsFnInputSchema,UpdateTransferGroupsFnOutputSchema,UpdateTransferManyTxInputSchema,UpdateTransferManyTxOutputSchema,UpdateTransferTxInputSchema,UpdateTransferTxOutputSchema,UpdateTransfersFnInputSchema,UpdateTransfersFnOutputSchema,UpdateWalletFnInputSchema,UpdateWalletFnOutputSchema,UpdateWalletTxInputSchema,UpdateWalletTxOutputSchema,Validator,WalletStatusEnum,WalletTableInputSchema,WalletTableSchema,WalletTokenSettingTableInputSchema,WalletTokenSettingTableSchema,WalletTypeEnum,WapiClientType,WapiSettingTableInputSchema,WapiSettingTableSchema,WapiSettingTypeEnum,aggregateTransfers,create,createAccessToken,createContract,createDeposit,createExchange,createToken,createTransfer,createTransferGroup,createTransfers,createWallet,createWithdrawal,findBalances,findTokens,findTransferGroups,findTransfers,findWallets,getBalance,getBalanceHistory,getFlags,getStatistics,getToken,getTransfer,getTransferGroup,getWallet,importData,isImportDataFnInput,isImportDataFnOptions,reverseTransfer,reverseTransferGroup,reverseTransfers,setFlags,updateToken,updateTransfer,updateTransferGroup,updateTransferGroups,updateTransfers,updateWallet,utils});
|
|
16
|
+
deps: ${r}}`};var WI={keyword:"dependencies",type:"object",schemaType:"object",error:Ot.error,code(t){let[e,r]=EI(t);Mb(t,e),Wb(t,r)}};function EI({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let a=Array.isArray(t[n])?e:r;a[n]=t[n]}return[e,r]}function Mb(t,e=t.schema){let{gen:r,data:n,it:a}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let i in e){let o=e[i];if(o.length===0)continue;let f=wo.propertyInData(r,n,i,a.opts.ownProperties);t.setParams({property:i,depsCount:o.length,deps:o.join(", ")}),a.allErrors?r.if(f,()=>{for(let u of o)wo.checkReportMissingProp(t,u)}):(r.if(Zm._`${f} && (${wo.checkMissingProp(t,o,s)})`),wo.reportMissingProp(t,s),r.else())}}Ot.validatePropertyDeps=Mb;function Wb(t,e=t.schema){let{gen:r,data:n,keyword:a,it:s}=t,i=r.name("valid");for(let o in e)MI.alwaysValidSchema(s,e[o])||(r.if(wo.propertyInData(r,n,o,s.opts.ownProperties),()=>{let f=t.subschema({keyword:a,schemaProp:o},i);t.mergeValidEvaluated(f,i)},()=>r.var(i,!0)),t.ok(i))}Ot.validateSchemaDeps=Wb;Ot.default=WI});var Ab=C(eh=>{"use strict";Object.defineProperty(eh,"__esModule",{value:!0});var Rb=Q(),RI=ae(),AI={message:"property name must be valid",params:({params:t})=>Rb._`{propertyName: ${t.propertyName}}`},UI={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:AI,code(t){let{gen:e,schema:r,data:n,it:a}=t;if(RI.alwaysValidSchema(a,r))return;let s=e.name("valid");e.forIn("key",n,i=>{t.setParams({propertyName:i}),t.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},s),e.if(Rb.not(s),()=>{t.error(!0),a.allErrors||e.break()})}),t.ok(s)}};eh.default=UI});var rh=C(th=>{"use strict";Object.defineProperty(th,"__esModule",{value:!0});var ol=et(),pt=Q(),qI=Kr(),pl=ae(),NI={message:"must NOT have additional properties",params:({params:t})=>pt._`{additionalProperty: ${t.additionalProperty}}`},BI={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:NI,code(t){let{gen:e,schema:r,parentSchema:n,data:a,errsCount:s,it:i}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:o,opts:f}=i;if(i.props=!0,f.removeAdditional!=="all"&&pl.alwaysValidSchema(i,r))return;let u=ol.allSchemaProperties(n.properties),l=ol.allSchemaProperties(n.patternProperties);_(),t.ok(pt._`${s} === ${qI.default.errors}`);function _(){e.forIn("key",a,I=>{!u.length&&!l.length?y(I):e.if(b(I),()=>y(I))})}function b(I){let k;if(u.length>8){let A=pl.schemaRefOrVal(i,n.properties,"properties");k=ol.isOwnProperty(e,A,I)}else u.length?k=pt.or(...u.map(A=>pt._`${I} === ${A}`)):k=pt.nil;return l.length&&(k=pt.or(k,...l.map(A=>pt._`${ol.usePattern(t,A)}.test(${I})`))),pt.not(k)}function w(I){e.code(pt._`delete ${a}[${I}]`)}function y(I){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){w(I);return}if(r===!1){t.setParams({additionalProperty:I}),t.error(),o||e.break();return}if(typeof r=="object"&&!pl.alwaysValidSchema(i,r)){let k=e.name("valid");f.removeAdditional==="failing"?(j(I,k,!1),e.if(pt.not(k),()=>{t.reset(),w(I)})):(j(I,k),o||e.if(pt.not(k),()=>e.break()))}}function j(I,k,A){let ce={keyword:"additionalProperties",dataProp:I,dataPropType:pl.Type.Str};A===!1&&Object.assign(ce,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(ce,k)}}};th.default=BI});var Nb=C(ah=>{"use strict";Object.defineProperty(ah,"__esModule",{value:!0});var LI=uo(),Ub=et(),nh=ae(),qb=rh(),VI={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:a,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&qb.default.code(new LI.KeywordCxt(s,qb.default,"additionalProperties"));let i=Ub.allSchemaProperties(r);for(let _ of i)s.definedProperties.add(_);s.opts.unevaluated&&i.length&&s.props!==!0&&(s.props=nh.mergeEvaluated.props(e,nh.toHash(i),s.props));let o=i.filter(_=>!nh.alwaysValidSchema(s,r[_]));if(o.length===0)return;let f=e.name("valid");for(let _ of o)u(_)?l(_):(e.if(Ub.propertyInData(e,a,_,s.opts.ownProperties)),l(_),s.allErrors||e.else().var(f,!0),e.endIf()),t.it.definedProperties.add(_),t.ok(f);function u(_){return s.opts.useDefaults&&!s.compositeRule&&r[_].default!==void 0}function l(_){t.subschema({keyword:"properties",schemaProp:_,dataProp:_},f)}}};ah.default=VI});var Hb=C(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});var Bb=et(),fl=Q(),Lb=ae(),Vb=ae(),HI={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:a,it:s}=t,{opts:i}=s,o=Bb.allSchemaProperties(r),f=o.filter(j=>Lb.alwaysValidSchema(s,r[j]));if(o.length===0||f.length===o.length&&(!s.opts.unevaluated||s.props===!0))return;let u=i.strictSchema&&!i.allowMatchingProperties&&a.properties,l=e.name("valid");s.props!==!0&&!(s.props instanceof fl.Name)&&(s.props=Vb.evaluatedPropsToName(e,s.props));let{props:_}=s;b();function b(){for(let j of o)u&&w(j),s.allErrors?y(j):(e.var(l,!0),y(j),e.if(l))}function w(j){for(let I in u)new RegExp(j).test(I)&&Lb.checkStrictMode(s,`property ${I} matches pattern ${j} (use allowMatchingProperties)`)}function y(j){e.forIn("key",n,I=>{e.if(fl._`${Bb.usePattern(t,j)}.test(${I})`,()=>{let k=f.includes(j);k||t.subschema({keyword:"patternProperties",schemaProp:j,dataProp:I,dataPropType:Vb.Type.Str},l),s.opts.unevaluated&&_!==!0?e.assign(fl._`${_}[${I}]`,!0):!k&&!s.allErrors&&e.if(fl.not(l),()=>e.break())})})}}};sh.default=HI});var zb=C(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});var zI=ae(),KI={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if(zI.alwaysValidSchema(n,r)){t.fail();return}let a=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),t.failResult(a,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};ih.default=KI});var Kb=C(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});var QI=et(),JI={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:QI.validateUnion,error:{message:"must match a schema in anyOf"}};oh.default=JI});var Qb=C(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});var ul=Q(),XI=ae(),YI={message:"must match exactly one schema in oneOf",params:({params:t})=>ul._`{passingSchemas: ${t.passing}}`},ZI={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:YI,code(t){let{gen:e,schema:r,parentSchema:n,it:a}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(a.opts.discriminator&&n.discriminator)return;let s=r,i=e.let("valid",!1),o=e.let("passing",null),f=e.name("_valid");t.setParams({passing:o}),e.block(u),t.result(i,()=>t.reset(),()=>t.error(!0));function u(){s.forEach((l,_)=>{let b;XI.alwaysValidSchema(a,l)?e.var(f,!0):b=t.subschema({keyword:"oneOf",schemaProp:_,compositeRule:!0},f),_>0&&e.if(ul._`${f} && ${i}`).assign(i,!1).assign(o,ul._`[${o}, ${_}]`).else(),e.if(f,()=>{e.assign(i,!0),e.assign(o,_),b&&t.mergeEvaluated(b,ul.Name)})})}}};ph.default=ZI});var Jb=C(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});var ek=ae(),tk={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let a=e.name("valid");r.forEach((s,i)=>{if(ek.alwaysValidSchema(n,s))return;let o=t.subschema({keyword:"allOf",schemaProp:i},a);t.ok(a),t.mergeEvaluated(o)})}};fh.default=tk});var Zb=C(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});var dl=Q(),Xb=ae(),rk={message:({params:t})=>dl.str`must match "${t.ifClause}" schema`,params:({params:t})=>dl._`{failingKeyword: ${t.ifClause}}`},nk={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:rk,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&Xb.checkStrictMode(n,'"if" without "then" and "else" is ignored');let a=Yb(n,"then"),s=Yb(n,"else");if(!a&&!s)return;let i=e.let("valid",!0),o=e.name("_valid");if(f(),t.reset(),a&&s){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(o,u("then",l),u("else",l))}else a?e.if(o,u("then")):e.if(dl.not(o),u("else"));t.pass(i,()=>t.error(!0));function f(){let l=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},o);t.mergeEvaluated(l)}function u(l,_){return()=>{let b=t.subschema({keyword:l},o);e.assign(i,o),t.mergeValidEvaluated(b,i),_?e.assign(_,dl._`${l}`):t.setParams({ifClause:l})}}}};function Yb(t,e){let r=t.schema[e];return r!==void 0&&!Xb.alwaysValidSchema(t,r)}uh.default=nk});var ex=C(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});var ak=ae(),sk={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&ak.checkStrictMode(r,`"${t}" without "if" is ignored`)}};dh.default=sk});var tx=C(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});var ik=Km(),ok=Cb(),pk=Qm(),fk=Gb(),uk=Db(),dk=Eb(),lk=Ab(),ck=rh(),mk=Nb(),hk=Hb(),gk=zb(),_k=Kb(),Tk=Qb(),yk=Jb(),bk=Zb(),xk=ex();function Fk(t=!1){let e=[gk.default,_k.default,Tk.default,yk.default,bk.default,xk.default,lk.default,ck.default,dk.default,mk.default,hk.default];return t?e.push(ok.default,fk.default):e.push(ik.default,pk.default),e.push(uk.default),e}lh.default=Fk});var rx=C(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});var xe=Q(),wk={message:({schemaCode:t})=>xe.str`must match format "${t}"`,params:({schemaCode:t})=>xe._`{format: ${t}}`},$k={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:wk,code(t,e){let{gen:r,data:n,$data:a,schema:s,schemaCode:i,it:o}=t,{opts:f,errSchemaPath:u,schemaEnv:l,self:_}=o;if(!f.validateFormats)return;a?b():w();function b(){let y=r.scopeValue("formats",{ref:_.formats,code:f.code.formats}),j=r.const("fDef",xe._`${y}[${i}]`),I=r.let("fType"),k=r.let("format");r.if(xe._`typeof ${j} == "object" && !(${j} instanceof RegExp)`,()=>r.assign(I,xe._`${j}.type || "string"`).assign(k,xe._`${j}.validate`),()=>r.assign(I,xe._`"string"`).assign(k,j)),t.fail$data(xe.or(A(),ce()));function A(){return f.strictSchema===!1?xe.nil:xe._`${i} && !${k}`}function ce(){let Y=l.$async?xe._`(${j}.async ? await ${k}(${n}) : ${k}(${n}))`:xe._`${k}(${n})`,z=xe._`(typeof ${k} == "function" ? ${Y} : ${k}.test(${n}))`;return xe._`${k} && ${k} !== true && ${I} === ${e} && !${z}`}}function w(){let y=_.formats[s];if(!y){A();return}if(y===!0)return;let[j,I,k]=ce(y);j===e&&t.pass(Y());function A(){if(f.strictSchema===!1){_.logger.warn(z());return}throw new Error(z());function z(){return`unknown format "${s}" ignored in schema at path "${u}"`}}function ce(z){let be=z instanceof RegExp?xe.regexpCode(z):f.code.formats?xe._`${f.code.formats}${xe.getProperty(s)}`:void 0,Ge=r.scopeValue("formats",{key:s,ref:z,code:be});return typeof z=="object"&&!(z instanceof RegExp)?[z.type||"string",z.validate,xe._`${Ge}.validate`]:["string",z,Ge]}function Y(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!l.$async)throw new Error("async format in sync schema");return xe._`await ${k}(${n})`}return typeof I=="function"?xe._`${k}(${n})`:xe._`${k}.test(${n})`}}}};ch.default=$k});var nx=C(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});var Ok=rx(),vk=[Ok.default];mh.default=vk});var ax=C(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.contentVocabulary=li.metadataVocabulary=void 0;li.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];li.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var ix=C(hh=>{"use strict";Object.defineProperty(hh,"__esModule",{value:!0});var jk=cb(),Ik=jb(),kk=tx(),Sk=nx(),sx=ax(),Ck=[jk.default,Ik.default,kk.default(),Sk.default,sx.metadataVocabulary,sx.contentVocabulary];hh.default=Ck});var ox=C($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.DiscrError=void 0;var Pk;(function(t){t.Tag="tag",t.Mapping="mapping"})(Pk=$o.DiscrError||($o.DiscrError={}))});var px=C(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});var ci=Q(),gh=ox(),Gk={message:({params:{discrError:t,tagName:e}})=>t===gh.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>ci._`{error: ${t}, tag: ${r}, tagValue: ${e}}`},Dk={keyword:"discriminator",type:"object",schemaType:"object",error:Gk,code(t){let{gen:e,data:r,schema:n,parentSchema:a,it:s}=t,{oneOf:i}=a;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let o=n.propertyName;if(typeof o!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!i)throw new Error("discriminator: requires oneOf keyword");let f=e.let("valid",!1),u=e.const("tag",ci._`${r}${ci.getProperty(o)}`);e.if(ci._`typeof ${u} == "string"`,()=>l(),()=>t.error(!1,{discrError:gh.DiscrError.Tag,tag:u,tagName:o})),t.ok(f);function l(){let w=b();e.if(!1);for(let y in w)e.elseIf(ci._`${u} === ${y}`),e.assign(f,_(w[y]));e.else(),t.error(!1,{discrError:gh.DiscrError.Mapping,tag:u,tagName:o}),e.endIf()}function _(w){let y=e.name("valid"),j=t.subschema({keyword:"oneOf",schemaProp:w},y);return t.mergeEvaluated(j,ci.Name),y}function b(){var w;let y={},j=k(a),I=!0;for(let Y=0;Y<i.length;Y++){let z=i[Y],be=(w=z.properties)===null||w===void 0?void 0:w[o];if(typeof be!="object")throw new Error(`discriminator: oneOf schemas must have "properties/${o}"`);I=I&&(j||k(z)),A(be,Y)}if(!I)throw new Error(`discriminator: "${o}" must be required`);return y;function k({required:Y}){return Array.isArray(Y)&&Y.includes(o)}function A(Y,z){if(Y.const)ce(Y.const,z);else if(Y.enum)for(let be of Y.enum)ce(be,z);else throw new Error(`discriminator: "properties/${o}" must have "const" or "enum"`)}function ce(Y,z){if(typeof Y!="string"||Y in y)throw new Error(`discriminator: "${o}" values must be unique strings`);y[Y]=z}}}};_h.default=Dk});var fx=C((BX,Mk)=>{Mk.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var lx=C((je,dx)=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.CodeGen=je.Name=je.nil=je.stringify=je.str=je._=je.KeywordCxt=void 0;var Wk=ob(),Ek=ix(),Rk=px(),ux=fx(),Ak=["/properties"],ll="http://json-schema.org/draft-07/schema",Th=class extends Wk.default{_addVocabularies(){super._addVocabularies(),Ek.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(Rk.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(ux,Ak):ux;this.addMetaSchema(e,ll,!1),this.refs["http://json-schema.org/schema"]=ll}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ll)?ll:void 0)}};dx.exports=je=Th;Object.defineProperty(je,"__esModule",{value:!0});je.default=Th;var Uk=uo();Object.defineProperty(je,"KeywordCxt",{enumerable:!0,get:function(){return Uk.KeywordCxt}});var mi=Q();Object.defineProperty(je,"_",{enumerable:!0,get:function(){return mi._}});Object.defineProperty(je,"str",{enumerable:!0,get:function(){return mi.str}});Object.defineProperty(je,"stringify",{enumerable:!0,get:function(){return mi.stringify}});Object.defineProperty(je,"nil",{enumerable:!0,get:function(){return mi.nil}});Object.defineProperty(je,"Name",{enumerable:!0,get:function(){return mi.Name}});Object.defineProperty(je,"CodeGen",{enumerable:!0,get:function(){return mi.CodeGen}})});var Wx=C((Dr,Mx)=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});function Xu(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var lt=Xu(require("stream")),vx=Xu(require("http")),Wh=Xu(require("url")),_J=Xu(require("https")),Ns=Xu(require("zlib")),TJ=lt.Readable,sa=Symbol("buffer"),Eh=Symbol("type"),Bs=class{constructor(){this[Eh]="";let e=arguments[0],r=arguments[1],n=[],a=0;if(e){let i=e,o=Number(i.length);for(let f=0;f<o;f++){let u=i[f],l;u instanceof Buffer?l=u:ArrayBuffer.isView(u)?l=Buffer.from(u.buffer,u.byteOffset,u.byteLength):u instanceof ArrayBuffer?l=Buffer.from(u):u instanceof Bs?l=u[sa]:l=Buffer.from(typeof u=="string"?u:String(u)),a+=l.length,n.push(l)}}this[sa]=Buffer.concat(n);let s=r&&r.type!==void 0&&String(r.type).toLowerCase();s&&!/[^\u0020-\u007E]/.test(s)&&(this[Eh]=s)}get size(){return this[sa].length}get type(){return this[Eh]}text(){return Promise.resolve(this[sa].toString())}arrayBuffer(){let e=this[sa],r=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return Promise.resolve(r)}stream(){let e=new TJ;return e._read=function(){},e.push(this[sa]),e.push(null),e}toString(){return"[object Blob]"}slice(){let e=this.size,r=arguments[0],n=arguments[1],a,s;r===void 0?a=0:r<0?a=Math.max(e+r,0):a=Math.min(r,e),n===void 0?s=e:n<0?s=Math.max(e+n,0):s=Math.min(n,e);let i=Math.max(s-a,0),f=this[sa].slice(a,a+i),u=new Bs([],{type:arguments[2]});return u[sa]=f,u}};Object.defineProperties(Bs.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});Object.defineProperty(Bs.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0});function Ee(t,e,r){Error.call(this,t),this.message=t,this.type=e,r&&(this.code=this.errno=r.code),Error.captureStackTrace(this,this.constructor)}Ee.prototype=Object.create(Error.prototype);Ee.prototype.constructor=Ee;Ee.prototype.name="FetchError";var Rh;try{Rh=require("encoding").convert}catch(t){}var ia=Symbol("Body internals"),jx=lt.PassThrough;function Ie(t){var e=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=r.size;let a=n===void 0?0:n;var s=r.timeout;let i=s===void 0?0:s;t==null?t=null:Ix(t)?t=Buffer.from(t.toString()):Yu(t)||Buffer.isBuffer(t)||(Object.prototype.toString.call(t)==="[object ArrayBuffer]"?t=Buffer.from(t):ArrayBuffer.isView(t)?t=Buffer.from(t.buffer,t.byteOffset,t.byteLength):t instanceof lt||(t=Buffer.from(String(t)))),this[ia]={body:t,disturbed:!1,error:null},this.size=a,this.timeout=i,t instanceof lt&&t.on("error",function(o){let f=o.name==="AbortError"?o:new Ee(`Invalid response body while trying to fetch ${e.url}: ${o.message}`,"system",o);e[ia].error=f})}Ie.prototype={get body(){return this[ia].body},get bodyUsed(){return this[ia].disturbed},arrayBuffer(){return Pi.call(this).then(function(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)})},blob(){let t=this.headers&&this.headers.get("content-type")||"";return Pi.call(this).then(function(e){return Object.assign(new Bs([],{type:t.toLowerCase()}),{[sa]:e})})},json(){var t=this;return Pi.call(this).then(function(e){try{return JSON.parse(e.toString())}catch(r){return Ie.Promise.reject(new Ee(`invalid json response body at ${t.url} reason: ${r.message}`,"invalid-json"))}})},text(){return Pi.call(this).then(function(t){return t.toString()})},buffer(){return Pi.call(this)},textConverted(){var t=this;return Pi.call(this).then(function(e){return yJ(e,t.headers)})}};Object.defineProperties(Ie.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});Ie.mixIn=function(t){for(let e of Object.getOwnPropertyNames(Ie.prototype))if(!(e in t)){let r=Object.getOwnPropertyDescriptor(Ie.prototype,e);Object.defineProperty(t,e,r)}};function Pi(){var t=this;if(this[ia].disturbed)return Ie.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[ia].disturbed=!0,this[ia].error)return Ie.Promise.reject(this[ia].error);let e=this.body;if(e===null)return Ie.Promise.resolve(Buffer.alloc(0));if(Yu(e)&&(e=e.stream()),Buffer.isBuffer(e))return Ie.Promise.resolve(e);if(!(e instanceof lt))return Ie.Promise.resolve(Buffer.alloc(0));let r=[],n=0,a=!1;return new Ie.Promise(function(s,i){let o;t.timeout&&(o=setTimeout(function(){a=!0,i(new Ee(`Response timeout while trying to fetch ${t.url} (over ${t.timeout}ms)`,"body-timeout"))},t.timeout)),e.on("error",function(f){f.name==="AbortError"?(a=!0,i(f)):i(new Ee(`Invalid response body while trying to fetch ${t.url}: ${f.message}`,"system",f))}),e.on("data",function(f){if(!(a||f===null)){if(t.size&&n+f.length>t.size){a=!0,i(new Ee(`content size at ${t.url} over limit: ${t.size}`,"max-size"));return}n+=f.length,r.push(f)}}),e.on("end",function(){if(!a){clearTimeout(o);try{s(Buffer.concat(r,n))}catch(f){i(new Ee(`Could not create Buffer from response body for ${t.url}: ${f.message}`,"system",f))}}})})}function yJ(t,e){if(typeof Rh!="function")throw new Error("The package `encoding` must be installed to use the textConverted() function");let r=e.get("content-type"),n="utf-8",a,s;return r&&(a=/charset=([^;]*)/i.exec(r)),s=t.slice(0,1024).toString(),!a&&s&&(a=/<meta.+?charset=(['"])(.+?)\1/i.exec(s)),!a&&s&&(a=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(s),a||(a=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(s),a&&a.pop()),a&&(a=/charset=(.*)/i.exec(a.pop()))),!a&&s&&(a=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(s)),a&&(n=a.pop(),(n==="gb2312"||n==="gbk")&&(n="gb18030")),Rh(t,"UTF-8",n).toString()}function Ix(t){return typeof t!="object"||typeof t.append!="function"||typeof t.delete!="function"||typeof t.get!="function"||typeof t.getAll!="function"||typeof t.has!="function"||typeof t.set!="function"?!1:t.constructor.name==="URLSearchParams"||Object.prototype.toString.call(t)==="[object URLSearchParams]"||typeof t.sort=="function"}function Yu(t){return typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.constructor=="function"&&typeof t.constructor.name=="string"&&/^(Blob|File)$/.test(t.constructor.name)&&/^(Blob|File)$/.test(t[Symbol.toStringTag])}function kx(t){let e,r,n=t.body;if(t.bodyUsed)throw new Error("cannot clone body after it is used");return n instanceof lt&&typeof n.getBoundary!="function"&&(e=new jx,r=new jx,n.pipe(e),n.pipe(r),t[ia].body=e,n=r),n}function Sx(t){return t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":Ix(t)?"application/x-www-form-urlencoded;charset=UTF-8":Yu(t)?t.type||null:Buffer.isBuffer(t)||Object.prototype.toString.call(t)==="[object ArrayBuffer]"||ArrayBuffer.isView(t)?null:typeof t.getBoundary=="function"?`multipart/form-data;boundary=${t.getBoundary()}`:t instanceof lt?null:"text/plain;charset=UTF-8"}function Cx(t){let e=t.body;return e===null?0:Yu(e)?e.size:Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&(e._lengthRetrievers&&e._lengthRetrievers.length==0||e.hasKnownLength&&e.hasKnownLength())?e.getLengthSync():null}function bJ(t,e){let r=e.body;r===null?t.end():Yu(r)?r.stream().pipe(t):Buffer.isBuffer(r)?(t.write(r),t.end()):r.pipe(t)}Ie.Promise=global.Promise;var Px=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,Ah=/[^\t\x20-\x7e\x80-\xff]/;function Zu(t){if(t=`${t}`,Px.test(t)||t==="")throw new TypeError(`${t} is not a legal HTTP header name`)}function Gx(t){if(t=`${t}`,Ah.test(t))throw new TypeError(`${t} is not a legal HTTP header value`)}function Gi(t,e){e=e.toLowerCase();for(let r in t)if(r.toLowerCase()===e)return r}var Fe=Symbol("map"),Ke=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;if(this[Fe]=Object.create(null),e instanceof Ke){let r=e.raw(),n=Object.keys(r);for(let a of n)for(let s of r[a])this.append(a,s);return}if(e!=null)if(typeof e=="object"){let r=e[Symbol.iterator];if(r!=null){if(typeof r!="function")throw new TypeError("Header pairs must be iterable");let n=[];for(let a of e){if(typeof a!="object"||typeof a[Symbol.iterator]!="function")throw new TypeError("Each header pair must be iterable");n.push(Array.from(a))}for(let a of n){if(a.length!==2)throw new TypeError("Each header pair must be a name/value tuple");this.append(a[0],a[1])}}else for(let n of Object.keys(e)){let a=e[n];this.append(n,a)}}else throw new TypeError("Provided initializer must be an object")}get(e){e=`${e}`,Zu(e);let r=Gi(this[Fe],e);return r===void 0?null:this[Fe][r].join(", ")}forEach(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=Uh(this),a=0;for(;a<n.length;){var s=n[a];let i=s[0],o=s[1];e.call(r,o,i,this),n=Uh(this),a++}}set(e,r){e=`${e}`,r=`${r}`,Zu(e),Gx(r);let n=Gi(this[Fe],e);this[Fe][n!==void 0?n:e]=[r]}append(e,r){e=`${e}`,r=`${r}`,Zu(e),Gx(r);let n=Gi(this[Fe],e);n!==void 0?this[Fe][n].push(r):this[Fe][e]=[r]}has(e){return e=`${e}`,Zu(e),Gi(this[Fe],e)!==void 0}delete(e){e=`${e}`,Zu(e);let r=Gi(this[Fe],e);r!==void 0&&delete this[Fe][r]}raw(){return this[Fe]}keys(){return Nh(this,"key")}values(){return Nh(this,"value")}[Symbol.iterator](){return Nh(this,"key+value")}};Ke.prototype.entries=Ke.prototype[Symbol.iterator];Object.defineProperty(Ke.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(Ke.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});function Uh(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"key+value";return Object.keys(t[Fe]).sort().map(e==="key"?function(n){return n.toLowerCase()}:e==="value"?function(n){return t[Fe][n].join(", ")}:function(n){return[n.toLowerCase(),t[Fe][n].join(", ")]})}var qh=Symbol("internal");function Nh(t,e){let r=Object.create(Bh);return r[qh]={target:t,kind:e,index:0},r}var Bh=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==Bh)throw new TypeError("Value of `this` is not a HeadersIterator");var t=this[qh];let e=t.target,r=t.kind,n=t.index,a=Uh(e,r),s=a.length;return n>=s?{value:void 0,done:!0}:(this[qh].index=n+1,{value:a[n],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));Object.defineProperty(Bh,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});function xJ(t){let e=Object.assign({__proto__:null},t[Fe]),r=Gi(t[Fe],"Host");return r!==void 0&&(e[r]=e[r][0]),e}function FJ(t){let e=new Ke;for(let r of Object.keys(t))if(!Px.test(r))if(Array.isArray(t[r]))for(let n of t[r])Ah.test(n)||(e[Fe][r]===void 0?e[Fe][r]=[n]:e[Fe][r].push(n));else Ah.test(t[r])||(e[Fe][r]=[t[r]]);return e}var Va=Symbol("Response internals"),wJ=vx.STATUS_CODES,rt=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ie.call(this,e,r);let n=r.status||200,a=new Ke(r.headers);if(e!=null&&!a.has("Content-Type")){let s=Sx(e);s&&a.append("Content-Type",s)}this[Va]={url:r.url,status:n,statusText:r.statusText||wJ[n],headers:a,counter:r.counter}}get url(){return this[Va].url||""}get status(){return this[Va].status}get ok(){return this[Va].status>=200&&this[Va].status<300}get redirected(){return this[Va].counter>0}get statusText(){return this[Va].statusText}get headers(){return this[Va].headers}clone(){return new rt(kx(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}};Ie.mixIn(rt.prototype);Object.defineProperties(rt.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});Object.defineProperty(rt.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});var oa=Symbol("Request internals"),Lh=Wh.parse,$J=Wh.format,OJ="destroy"in lt.Readable.prototype;function gl(t){return typeof t=="object"&&typeof t[oa]=="object"}function vJ(t){let e=t&&typeof t=="object"&&Object.getPrototypeOf(t);return!!(e&&e.constructor.name==="AbortSignal")}var pa=class{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n;gl(e)?n=Lh(e.url):(e&&e.href?n=Lh(e.href):n=Lh(`${e}`),e={});let a=r.method||e.method||"GET";if(a=a.toUpperCase(),(r.body!=null||gl(e)&&e.body!==null)&&(a==="GET"||a==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let s=r.body!=null?r.body:gl(e)&&e.body!==null?kx(e):null;Ie.call(this,s,{timeout:r.timeout||e.timeout||0,size:r.size||e.size||0});let i=new Ke(r.headers||e.headers||{});if(s!=null&&!i.has("Content-Type")){let f=Sx(s);f&&i.append("Content-Type",f)}let o=gl(e)?e.signal:null;if("signal"in r&&(o=r.signal),o!=null&&!vJ(o))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[oa]={method:a,redirect:r.redirect||e.redirect||"follow",headers:i,parsedURL:n,signal:o},this.follow=r.follow!==void 0?r.follow:e.follow!==void 0?e.follow:20,this.compress=r.compress!==void 0?r.compress:e.compress!==void 0?e.compress:!0,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent}get method(){return this[oa].method}get url(){return $J(this[oa].parsedURL)}get headers(){return this[oa].headers}get redirect(){return this[oa].redirect}get signal(){return this[oa].signal}clone(){return new pa(this)}};Ie.mixIn(pa.prototype);Object.defineProperty(pa.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(pa.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}});function jJ(t){let e=t[oa].parsedURL,r=new Ke(t[oa].headers);if(r.has("Accept")||r.set("Accept","*/*"),!e.protocol||!e.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(e.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(t.signal&&t.body instanceof lt.Readable&&!OJ)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let n=null;if(t.body==null&&/^(POST|PUT)$/i.test(t.method)&&(n="0"),t.body!=null){let s=Cx(t);typeof s=="number"&&(n=String(s))}n&&r.set("Content-Length",n),r.has("User-Agent")||r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let a=t.agent;return typeof a=="function"&&(a=a(e)),!r.has("Connection")&&!a&&r.set("Connection","close"),Object.assign({},e,{method:t.method,headers:xJ(r),agent:a})}function ed(t){Error.call(this,t),this.type="aborted",this.message=t,Error.captureStackTrace(this,this.constructor)}ed.prototype=Object.create(Error.prototype);ed.prototype.constructor=ed;ed.prototype.name="AbortError";var Dx=lt.PassThrough,IJ=Wh.resolve;function Ha(t,e){if(!Ha.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return Ie.Promise=Ha.Promise,new Ha.Promise(function(r,n){let a=new pa(t,e),s=jJ(a),i=(s.protocol==="https:"?_J:vx).request,o=a.signal,f=null,u=function(){let j=new ed("The user aborted a request.");n(j),a.body&&a.body instanceof lt.Readable&&a.body.destroy(j),!(!f||!f.body)&&f.body.emit("error",j)};if(o&&o.aborted){u();return}let l=function(){u(),w()},_=i(s),b;o&&o.addEventListener("abort",l);function w(){_.abort(),o&&o.removeEventListener("abort",l),clearTimeout(b)}a.timeout&&_.once("socket",function(y){b=setTimeout(function(){n(new Ee(`network timeout at: ${a.url}`,"request-timeout")),w()},a.timeout)}),_.on("error",function(y){n(new Ee(`request to ${a.url} failed, reason: ${y.message}`,"system",y)),w()}),_.on("response",function(y){clearTimeout(b);let j=FJ(y.headers);if(Ha.isRedirect(y.statusCode)){let Y=j.get("Location"),z=Y===null?null:IJ(a.url,Y);switch(a.redirect){case"error":n(new Ee(`uri requested responds with a redirect, redirect mode is set to error: ${a.url}`,"no-redirect")),w();return;case"manual":if(z!==null)try{j.set("Location",z)}catch(Ge){n(Ge)}break;case"follow":if(z===null)break;if(a.counter>=a.follow){n(new Ee(`maximum redirect reached at: ${a.url}`,"max-redirect")),w();return}let be={headers:new Ke(a.headers),follow:a.follow,counter:a.counter+1,agent:a.agent,compress:a.compress,method:a.method,body:a.body,signal:a.signal,timeout:a.timeout,size:a.size};if(y.statusCode!==303&&a.body&&Cx(a)===null){n(new Ee("Cannot follow redirect with body being a readable stream","unsupported-redirect")),w();return}(y.statusCode===303||(y.statusCode===301||y.statusCode===302)&&a.method==="POST")&&(be.method="GET",be.body=void 0,be.headers.delete("content-length")),r(Ha(new pa(z,be))),w();return}}y.once("end",function(){o&&o.removeEventListener("abort",l)});let I=y.pipe(new Dx),k={url:a.url,status:y.statusCode,statusText:y.statusMessage,headers:j,size:a.size,timeout:a.timeout,counter:a.counter},A=j.get("Content-Encoding");if(!a.compress||a.method==="HEAD"||A===null||y.statusCode===204||y.statusCode===304){f=new rt(I,k),r(f);return}let ce={flush:Ns.Z_SYNC_FLUSH,finishFlush:Ns.Z_SYNC_FLUSH};if(A=="gzip"||A=="x-gzip"){I=I.pipe(Ns.createGunzip(ce)),f=new rt(I,k),r(f);return}if(A=="deflate"||A=="x-deflate"){y.pipe(new Dx).once("data",function(z){(z[0]&15)==8?I=I.pipe(Ns.createInflate()):I=I.pipe(Ns.createInflateRaw()),f=new rt(I,k),r(f)});return}if(A=="br"&&typeof Ns.createBrotliDecompress=="function"){I=I.pipe(Ns.createBrotliDecompress()),f=new rt(I,k),r(f);return}f=new rt(I,k),r(f)}),bJ(_,a)})}Ha.isRedirect=function(t){return t===301||t===302||t===303||t===307||t===308};Ha.Promise=global.Promise;Mx.exports=Dr=Ha;Object.defineProperty(Dr,"__esModule",{value:!0});Dr.default=Dr;Dr.Headers=Ke;Dr.Request=pa;Dr.Response=rt;Dr.FetchError=Ee});var Rx=C((Ls,Ex)=>{var td=Wx(),kJ=td.default||td,_l=function(t,e){return/^\/\//.test(t)&&(t="https:"+t),kJ.call(this,t,e)};_l.ponyfill=!0;Ex.exports=Ls=_l;Ls.fetch=_l;Ls.Headers=td.Headers;Ls.Request=td.Request;Ls.Response=td.Response;Ls.default=_l});IF(exports,{APIFunctions:()=>R,APIValidators:()=>Dh,AggregateTransferManyTxInputSchema:()=>nf,AggregateTransferManyTxOutputSchema:()=>af,AggregateTransfersFnInputSchema:()=>Uo,AggregateTransfersFnOutputSchema:()=>qo,AuthenticationCheckTxInputSchema:()=>sf,AuthenticationCheckTxOutputSchema:()=>of,Client:()=>sd,ClientFunctions:()=>U,ClientFunctionsEnum:()=>mg,ClientQueryBuilderFunctionsEnum:()=>hg,ClientValidators:()=>_4,ConstsSchema:()=>cs,CreateAccessTokenFnInputSchema:()=>No,CreateAccessTokenFnOutputSchema:()=>Bo,CreateAccessTokenTxInputSchema:()=>pf,CreateAccessTokenTxOutputSchema:()=>ff,CreateContractFnInputSchema:()=>Lo,CreateContractFnOutputSchema:()=>Vo,CreateContractTxInputSchema:()=>uf,CreateContractTxOutputSchema:()=>df,CreateDepositFnInputSchema:()=>Ho,CreateDepositFnOutputSchema:()=>zo,CreateDepositTxInputSchema:()=>lf,CreateDepositTxOutputSchema:()=>cf,CreateDistributionTxInputSchema:()=>mf,CreateDistributionTxOutputSchema:()=>hf,CreateExchangeFnInputSchema:()=>Ko,CreateExchangeFnOutputSchema:()=>Qo,CreateTokenFnInputSchema:()=>Jo,CreateTokenFnOutputSchema:()=>Xo,CreateTokenTxInputSchema:()=>gf,CreateTokenTxOutputSchema:()=>_f,CreateTransferFnInputSchema:()=>Yo,CreateTransferFnOutputSchema:()=>Zo,CreateTransferGroupFnInputSchema:()=>ep,CreateTransferGroupFnOutputSchema:()=>tp,CreateTransferGroupTxInputSchema:()=>bf,CreateTransferGroupTxOutputSchema:()=>xf,CreateTransferManyTxInputSchema:()=>Ff,CreateTransferManyTxOutputSchema:()=>wf,CreateTransferTxInputSchema:()=>Tf,CreateTransferTxOutputSchema:()=>yf,CreateTransfersFnInputSchema:()=>rp,CreateTransfersFnOutputSchema:()=>np,CreateWalletFnInputSchema:()=>ap,CreateWalletFnOutputSchema:()=>sp,CreateWalletTxInputSchema:()=>$f,CreateWalletTxOutputSchema:()=>Of,CreateWithdrawalFnInputSchema:()=>ip,CreateWithdrawalFnOutputSchema:()=>op,CreateWithdrawalTxInputSchema:()=>vf,CreateWithdrawalTxOutputSchema:()=>jf,DbFilterFunctionBasicEnum:()=>Xh,DbFilterFunctionInEnum:()=>Yh,DbFilterFunctionMetadataBasicEnum:()=>Jh,DbFilterFunctionMetadataInEnum:()=>Zh,DbFilterFunctionMetadataNullEnum:()=>eg,DbFilterFunctionNullEnum:()=>tg,DbFilterOperatorEnum:()=>rg,DbFilterOperatorExtendedEnum:()=>ag,DbFilterOperatorStringEnum:()=>ng,DbModelNameEnum:()=>cg,ErrorMessage:()=>re,Errors:()=>me,ExportDatabaseTxInputSchema:()=>If,ExportDatabaseTxOutputSchema:()=>kf,FindBalanceManyTxInputSchema:()=>Sf,FindBalanceManyTxOutputSchema:()=>Cf,FindBalancesFnInputSchema:()=>pp,FindBalancesFnOutputSchema:()=>fp,FindTokenManyTxInputSchema:()=>Pf,FindTokenManyTxOutputSchema:()=>Gf,FindTokensFnInputSchema:()=>up,FindTokensFnOutputSchema:()=>dp,FindTransferGroupManyTxInputSchema:()=>Df,FindTransferGroupManyTxOutputSchema:()=>Mf,FindTransferGroupsFnInputSchema:()=>lp,FindTransferGroupsFnOutputSchema:()=>cp,FindTransferManyTxInputSchema:()=>Wf,FindTransferManyTxOutputSchema:()=>Ef,FindTransfersFnInputSchema:()=>mp,FindTransfersFnOutputSchema:()=>hp,FindWalletManyTxInputSchema:()=>Rf,FindWalletManyTxOutputSchema:()=>Af,FindWalletsFnInputSchema:()=>gp,FindWalletsFnOutputSchema:()=>_p,FinishTransactionTxInputSchema:()=>Uf,FinishTransactionTxOutputSchema:()=>qf,FnConstsSchema:()=>yp,GetBalanceFnInputSchema:()=>bp,GetBalanceFnOutputSchema:()=>xp,GetBalanceHistoryFnInputSchema:()=>Fp,GetBalanceHistoryFnOutputSchema:()=>wp,GetBalanceHistoryTxInputSchema:()=>Lf,GetBalanceHistoryTxOutputSchema:()=>Vf,GetBalanceTxInputSchema:()=>Nf,GetBalanceTxOutputSchema:()=>Bf,GetDatabaseExportProgressTxInputSchema:()=>Hf,GetDatabaseExportProgressTxOutputSchema:()=>zf,GetDatabaseImportProgressTxInputSchema:()=>Kf,GetDatabaseImportProgressTxOutputSchema:()=>Qf,GetFlagsFnInputSchema:()=>$p,GetFlagsFnOutputSchema:()=>Op,GetFlagsTxInputSchema:()=>Jf,GetFlagsTxOutputSchema:()=>Xf,GetStatisticsFnInputSchema:()=>vp,GetStatisticsFnOutputSchema:()=>jp,GetStatisticsTxInputSchema:()=>Yf,GetStatisticsTxOutputSchema:()=>Zf,GetTokenFnInputSchema:()=>Ip,GetTokenFnOutputSchema:()=>kp,GetTokenManyTxInputSchema:()=>ru,GetTokenManyTxOutputSchema:()=>nu,GetTokenTxInputSchema:()=>eu,GetTokenTxOutputSchema:()=>tu,GetTransferFnInputSchema:()=>Sp,GetTransferFnOutputSchema:()=>Cp,GetTransferGroupFnInputSchema:()=>Pp,GetTransferGroupFnOutputSchema:()=>Gp,GetTransferGroupTxInputSchema:()=>iu,GetTransferGroupTxOutputSchema:()=>ou,GetTransferTxInputSchema:()=>au,GetTransferTxOutputSchema:()=>su,GetWalletFnInputSchema:()=>Dp,GetWalletFnOutputSchema:()=>Mp,GetWalletManyTxInputSchema:()=>uu,GetWalletManyTxOutputSchema:()=>du,GetWalletTxInputSchema:()=>pu,GetWalletTxOutputSchema:()=>fu,ITxAggregatorSimpleEnum:()=>Sh,ITxDistributorLeftoverRuleEnum:()=>Ch,ITxMetadataActionEnum:()=>Ph,ITxMetadataActionForReverseEnum:()=>Gh,ITxPeriodSimpleEnum:()=>Ju,ImportActionsTxInputSchema:()=>Us,ImportActionsTxOutputSchema:()=>lu,ImportDataFnInputSchema:()=>Ss,ImportDataFnOutputSchema:()=>Wp,ImportDatabaseTxInputSchema:()=>cu,ImportDatabaseTxOutputSchema:()=>mu,ListDatabaseExportsTxInputSchema:()=>hu,ListDatabaseExportsTxOutputSchema:()=>gu,QueryBuilder:()=>Qe,QueryLogsTxInputSchema:()=>yu,QueryLogsTxOutputSchema:()=>bu,QueryTxInputSchema:()=>_u,QueryTxOutputSchema:()=>Tu,ResetDatabaseTxInputSchema:()=>xu,ResetDatabaseTxOutputSchema:()=>Fu,ReverseTransferFnInputSchema:()=>Ep,ReverseTransferFnOutputSchema:()=>Rp,ReverseTransferGroupFnInputSchema:()=>Ap,ReverseTransferGroupFnOutputSchema:()=>Up,ReverseTransferGroupManyTxInputSchema:()=>ju,ReverseTransferGroupManyTxOutputSchema:()=>Iu,ReverseTransferGroupTxInputSchema:()=>Ou,ReverseTransferGroupTxOutputSchema:()=>vu,ReverseTransferManyTxInputSchema:()=>ku,ReverseTransferManyTxOutputSchema:()=>Su,ReverseTransferTxInputSchema:()=>wu,ReverseTransferTxOutputSchema:()=>$u,ReverseTransfersFnInputSchema:()=>qp,ReverseTransfersFnOutputSchema:()=>Np,SetFlagsFnInputSchema:()=>Bp,SetFlagsFnOutputSchema:()=>Lp,SetFlagsTxInputSchema:()=>Cu,SetFlagsTxOutputSchema:()=>Pu,StartTransactionTxInputSchema:()=>Gu,StartTransactionTxOutputSchema:()=>Du,StreamPromise:()=>da,TokenStatusEnum:()=>ig,TokenTableInputSchema:()=>vo,TokenTableSchema:()=>jo,TokenTypeEnum:()=>sg,TransferGroupStatusEnum:()=>ad,TransferGroupTableInputSchema:()=>So,TransferGroupTableSchema:()=>Co,TransferGroupTypeEnum:()=>fg,TransferLogTableInputSchema:()=>Po,TransferLogTableSchema:()=>Go,TransferStatusEnum:()=>og,TransferStatusInputEnum:()=>pg,TransferTableInputSchema:()=>Io,TransferTableSchema:()=>ko,TransferTypeEnum:()=>za,TxConstsSchema:()=>Wu,UpdateTokenFnInputSchema:()=>Vp,UpdateTokenFnOutputSchema:()=>Hp,UpdateTokenTxInputSchema:()=>Eu,UpdateTokenTxOutputSchema:()=>Ru,UpdateTransferFnInputSchema:()=>zp,UpdateTransferFnOutputSchema:()=>Kp,UpdateTransferGroupFnInputSchema:()=>Qp,UpdateTransferGroupFnOutputSchema:()=>Jp,UpdateTransferGroupManyTxInputSchema:()=>Bu,UpdateTransferGroupManyTxOutputSchema:()=>Lu,UpdateTransferGroupTxInputSchema:()=>qu,UpdateTransferGroupTxOutputSchema:()=>Nu,UpdateTransferGroupsFnInputSchema:()=>Xp,UpdateTransferGroupsFnOutputSchema:()=>Yp,UpdateTransferManyTxInputSchema:()=>Vu,UpdateTransferManyTxOutputSchema:()=>Hu,UpdateTransferTxInputSchema:()=>Au,UpdateTransferTxOutputSchema:()=>Uu,UpdateTransfersFnInputSchema:()=>Zp,UpdateTransfersFnOutputSchema:()=>ef,UpdateWalletFnInputSchema:()=>tf,UpdateWalletFnOutputSchema:()=>rf,UpdateWalletTxInputSchema:()=>zu,UpdateWalletTxOutputSchema:()=>Ku,Validator:()=>Qu,WalletStatusEnum:()=>dg,WalletTableInputSchema:()=>Do,WalletTableSchema:()=>Mo,WalletTokenSettingTableInputSchema:()=>Wo,WalletTokenSettingTableSchema:()=>Eo,WalletTypeEnum:()=>ug,WapiClientType:()=>dt,WapiSettingTableInputSchema:()=>Ro,WapiSettingTableSchema:()=>Ao,WapiSettingTypeEnum:()=>lg,aggregateTransfers:()=>yl,create:()=>y4,createAccessToken:()=>bl,createContract:()=>xl,createDeposit:()=>Fl,createExchange:()=>wl,createToken:()=>$l,createTransfer:()=>Ol,createTransferGroup:()=>vl,createTransfers:()=>jl,createWallet:()=>Il,createWithdrawal:()=>kl,findBalances:()=>Sl,findTokens:()=>Cl,findTransferGroups:()=>Pl,findTransfers:()=>Gl,findWallets:()=>Dl,getBalance:()=>Ml,getBalanceHistory:()=>Wl,getFlags:()=>El,getStatistics:()=>Rl,getToken:()=>Al,getTransfer:()=>Ul,getTransferGroup:()=>ql,getWallet:()=>Nl,importData:()=>Ll,isImportDataFnInput:()=>Bl,isImportDataFnOptions:()=>Mi,reverseTransfer:()=>Vl,reverseTransferGroup:()=>Hl,reverseTransfers:()=>zl,setFlags:()=>Kl,updateToken:()=>Ql,updateTransfer:()=>Jl,updateTransferGroup:()=>Xl,updateTransferGroups:()=>Yl,updateTransfers:()=>Zl,updateWallet:()=>ec,utils:()=>b4});var Dc=ri(Gc()),pT=Gc();function pe(...t){process.env.WAPI_DEBUG&&console.log(...t)}var Hr=class extends Error{constructor({code:e,message:r,data:n,description:a}){super(r);var s;this.code=e,this.message=r,this.data=n,this.description=(s=a!=null?a:Nw[r])!=null?s:""}toJSON(){return{code:this.code,message:this.message,description:this.description,data:this.data}}},fT=class extends Hr{constructor({message:e,data:r,code:n}){super({message:e,data:r,code:n||me.DatabaseError})}},Ne=class extends Hr{constructor({message:e,data:r,code:n}){super({message:e,data:r,code:n||me.SchemaValidationError})}},de=class extends Hr{constructor({message:e,data:r,code:n}){super({message:e,data:r,code:n||me.InputError})}},uT=class extends Hr{constructor({message:e,data:r,code:n}){super({message:e,data:r,code:n||me.ConstraintError})}},dT=class extends Hr{constructor({message:e,data:r,code:n}){super({message:e,data:r,code:n||me.UnknownError})}},hd=class extends Hr{constructor({message:e,data:r,code:n}){super({message:e,data:r,code:n||me.ConnectionError})}},gd=class extends Hr{constructor({message:e,data:r,code:n}){super({message:e,data:r,code:n||me.StreamError})}},_d=class extends Hr{constructor({message:e,data:r,code:n}){super({message:e,data:r,code:n||me.AuthenticationError})}};function Mc({message:t,data:e,code:r}){switch(r){case me.SchemaValidationError:return new Ne({message:t,data:e,code:r});case me.DatabaseError:return new fT({message:t,data:e,code:r});case me.InputError:return new de({message:t,data:e,code:r});case me.ConstraintError:return new uT({message:t,data:e,code:r});case me.ConnectionError:return new hd({message:t,data:e,code:r});case me.StreamError:return new gd({message:t,data:e,code:r});case me.AuthenticationError:return new _d({message:t,data:e,code:r});default:return new dT({message:t,data:e,code:r})}}var me;(function(f){f.SchemaValidationError="SchemaValidationError",f.DatabaseError="DatabaseError",f.InputError="InputError",f.UnknownError="UnknownError",f.ConstraintError="ConstraintError",f.ConnectionError="ConnectionError",f.StreamError="StreamError",f.AuthenticationError="AuthenticationError"})(me||(me={}));var re;(function(v){v.AUTHENTICATION_FAILED="AUTHENTICATION_FAILED",v.BAL_FUTURE_DATETIME="BAL_FUTURE_DATETIME",v.CONFLICTING_OPTIONS="CONFLICTING_OPTIONS",v.CONTRACT_OWNER_NOT_FOUND="CONTRACT_OWNER_NOT_FOUND",v.DATABASE_ERROR="DATABASE_ERROR",v.DISTRIBUTION_MISSING_TARGETS="DISTRIBUTION_MISSING_TARGETS",v.EXCHANGE_MISSING_TARGETS="EXCHANGE_MISSING_TARGETS",v.IMPORT_MISSING_CONTRACT_TOKEN="IMPORT_MISSING_CONTRACT_TOKEN",v.IMPORT_MISSING_TOKEN_WALLET="IMPORT_MISSING_TOKEN_WALLET",v.IMPORT_OBJECT_DUPLICATE="IMPORT_OBJECT_DUPLICATE",v.IMPORT_OBJECT_EXISTS="IMPORT_OBJECT_EXISTS",v.IMPORT_PREDATED_TRANSFER="IMPORT_PREDATED_TRANSFER",v.IMPORT_USE_BEFORE_CREATE="IMPORT_USE_BEFORE_CREATE",v.INPUT_NEEDS_IDENTIFIER="INPUT_NEEDS_IDENTIFIER",v.INPUT_NEEDS_TOKEN="INPUT_NEEDS_TOKEN",v.INPUT_STREAM_ERROR="INPUT_STREAM_ERROR",v.INPUT_STREAM_TIMEOUT="INPUT_STREAM_TIMEOUT",v.INPUT_STREAM_INVALID="INPUT_STREAM_INVALID",v.INPUT_STREAM_NOT_ALLOWED="INPUT_STREAM_NOT_ALLOWED",v.INPUT_INVALID="INPUT_INVALID",v.INVALID_COMPLEX_FILTER="INVALID_COMPLEX_FILTER",v.INVALID_FIELD_AGR_COMB="INVALID_FIELD_AGR_COMB",v.INVALID_FIELD_FOR_MODEL="INVALID_FIELD_FOR_MODEL",v.INVALID_LATEST_HASH="INVALID_LATEST_HASH",v.INVALID_MODEL="INVALID_MODEL",v.NO_METADATA_ON_MODEL="NO_METADATA_ON_MODEL",v.RUNNING_BALANCE_WITHOUT_WALLET="RUNNING_BALANCE_WITHOUT_WALLET",v.SIGNED_AMOUNT_WITHOUT_WALLET="SIGNED_AMOUNT_WITHOUT_WALLET",v.TOKEN_INVALID_WALLET="TOKEN_INVALID_WALLET",v.TOKEN_LIMIT_REACHED="TOKEN_LIMIT_REACHED",v.TR_AMOUNT_NOT_DIVISIBLE="TR_AMOUNT_NOT_DIVISIBLE",v.TR_CANCELLED_CANT_RV="TR_CANCELLED_CANT_RV",v.TR_CANT_UPDATE_TO_PENDING="TR_CANT_UPDATE_TO_PENDING",v.TR_DEPOSIT_CANT_RV_WITHOUT_FLAG="TR_DEPOSIT_CANT_RV_WITHOUT_FLAG",v.TR_FROM_WALLET_DEPOSIT="TR_FROM_WALLET_DEPOSIT",v.TR_FROM_WALLET_STATUS_CONSTRAINT="TR_FROM_WALLET_STATUS_CONSTRAINT",v.TR_INVALID_BALANCE="TR_INVALID_BALANCE",v.TR_INVALID_CANCELLED="TR_INVALID_CANCELLED",v.TR_TIMESTAMP_IN_PAST="TR_TIMESTAMP_IN_PAST",v.TR_TO_WALLET_STATUS_CONSTRAINT="TR_TO_WALLET_STATUS_CONSTRAINT",v.TR_TO_WALLET_WITHDRAWAL="TR_TO_WALLET_WITHDRAWAL",v.TR_TOKEN_DISABLED="TR_TOKEN_DISABLED",v.TR_TOKEN_DWONLY="TR_TOKEN_DWONLY",v.TR_TRG_CLOSED="TR_TRG_CLOSED",v.TR_TRG_STATUS_MISMATCH="TR_TRG_STATUS_MISMATCH",v.TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG="TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG",v.TRANSACTION_NOT_FOUND="TRANSACTION_NOT_FOUND",v.TRANSACTION_TIMEOUT="TRANSACTION_TIMEOUT",v.TRG_BALANCE_CHECK_REQUIRED_WITHOUT_STATUS_LOCK="TRG_BALANCE_CHECK_REQUIRED_WITHOUT_STATUS_LOCK",v.TRG_CANCELLED_CANT_RV="TRG_CANCELLED_CANT_RV",v.TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG="TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG",v.TRG_SINGLE_PENDING_TR_CANT_RV="TRG_SINGLE_PENDING_TR_CANT_RV",v.TRG_WITHDRAWAL_CANT_RV_WITHOUT_FLAG="TRG_WITHDRAWAL_CANT_RV_WITHOUT_FLAG",v.UNCLEAR_AGGREGATOR="UNCLEAR_AGGREGATOR",v.TR_MISSING_FILTER="TR_MISSING_FILTER",v.TRG_MISSING_FILTER="TRG_MISSING_FILTER",v.HTTP_BODY_SIZE="HTTP_BODY_SIZE",v.METHOD_DISABLED="METHOD_DISABLED",v.DATABASE_IMPORT_UNEXPECTED_ERROR="DATABASE_IMPORT_UNEXPECTED_ERROR",v.DATABASE_IMPORT_NOT_FOUND="DATABASE_IMPORT_NOT_FOUND",v.DATABASE_BACKUP_CREATE_UNEXPECTED_ERROR="DATABASE_BACKUP_CREATE_UNEXPECTED_ERROR",v.LIST_DATABASE_BACKUPS_UNEXPECTED_ERROR="LIST_DATABASE_BACKUPS_UNEXPECTED_ERROR",v.IMPORT_DATABASE_PROGRESS_NOT_FOUND="IMPORT_DATABASE_PROGRESS_NOT_FOUND",v.IMPORT_DATABASE_PROGRESS_UNEXPECTED_ERROR="IMPORT_DATABASE_PROGRESS_UNEXPECTED_ERROR",v.DATABASE_BACKUP_PROGRESS_NOT_FOUND="DATABASE_BACKUP_PROGRESS_NOT_FOUND",v.DATABASE_BACKUP_PROGRESS_UNEXPECTED_ERROR="DATABASE_BACKUP_PROGRESS_UNEXPECTED_ERROR"})(re||(re={}));var Nw={AUTHENTICATION_FAILED:"Provided credentials are invalid",BAL_FUTURE_DATETIME:"Balance datetime can't be in the future",CONFLICTING_OPTIONS:"return_running_balance and return_running_balance_for can't be specified together",CONTRACT_OWNER_NOT_FOUND:"Unable to find Wallet specified as Contract token owner",DATABASE_ERROR:"Something went wrong in the DB layer",DISTRIBUTION_MISSING_TARGETS:"Unable to resolve all targets (Wallets, Tokens) for distribution request",EXCHANGE_MISSING_TARGETS:"Unable to resolve all targets (Wallets, Token) for exchange request",IMPORT_MISSING_CONTRACT_TOKEN:"The import contract specifies Token that does not exist",IMPORT_MISSING_TOKEN_WALLET:"The import results in invalid Token without valid Wallet",IMPORT_OBJECT_DUPLICATE:"The import includes create directives for same object multiple times",IMPORT_OBJECT_EXISTS:"The import includes create directives for already existing objects",IMPORT_PREDATED_TRANSFER:"The oldest Transfer in the import file is older than already existing Transfers in the WAPI instance",IMPORT_USE_BEFORE_CREATE:"The import includes create directive for object that is used in Transfer before create dateTime",INPUT_NEEDS_IDENTIFIER:"Missing identifier - automatically calculated identifiers conflict on identical input for 30s To make an identical transfer during that window you need to provide a unique identifier",INPUT_NEEDS_TOKEN:"token must be specified on input or in client config",INPUT_STREAM_ERROR:"Input stream emitted an error",INPUT_STREAM_TIMEOUT:"No data provided to input stream in 30s",INPUT_STREAM_INVALID:"Invalid input stream identifier provided",INPUT_STREAM_NOT_ALLOWED:"Method does not support input stream",INPUT_INVALID:"Invalid input on stream",INVALID_COMPLEX_FILTER:"The provided complex filter does not pass validation",INVALID_FIELD_AGR_COMB:"Provided aggregation field was not found on Model",INVALID_FIELD_FOR_MODEL:"Provided groupBy field was not found on Model",INVALID_LATEST_HASH:"Provided latest_control_hash does not match the latest outgoing Transfer from Wallet",INVALID_MODEL:"Provided Model name is invalid",NO_METADATA_ON_MODEL:"Can't use metadata field for grouping as current Model does not have metadata",RUNNING_BALANCE_WITHOUT_WALLET:"return_running_balance option requires Wallet filter to be specified",SIGNED_AMOUNT_WITHOUT_WALLET:"return_signed_balance option requires Wallet filter to be specified",TOKEN_INVALID_WALLET:"Invalid belongs_to wallet provided",TOKEN_LIMIT_REACHED:"Unable to issue more tokens as Token.limit has been reached",TR_AMOUNT_NOT_DIVISIBLE:"Transfer amount is not divisible by specified Token.divisor",TR_CANCELLED_CANT_RV:"Cancelled Transfer can not be reversed",TR_CANT_UPDATE_TO_PENDING:"Transfer status can only move from 'pending'->'finished'/'cancelled",TR_DEPOSIT_CANT_RV_WITHOUT_FLAG:"Deposits are expected connection points with outside systems, thus extra validation is required. Reversing a Transfer.type = 'deposit' requires reverse_deposit option to be true.",TR_FROM_WALLET_DEPOSIT:"From wallet can't be specified when doing a deposit",TR_FROM_WALLET_STATUS_CONSTRAINT:"From wallet.status doesn't allow this type of transfers",TR_INVALID_BALANCE:"Transfer results in invalid balance for a Wallet",TR_INVALID_CANCELLED:"Cant create cancelled transfer",TR_TIMESTAMP_IN_PAST:"Transfer.created_at must be the latest",TR_TO_WALLET_STATUS_CONSTRAINT:"To wallet.status doesn't allow this type of transfers",TR_TO_WALLET_WITHDRAWAL:"To wallet can't be specified when doing a withdrawal",TR_TOKEN_DISABLED:"Token status is set to 'disabled' - no new transfers allowed",TR_TOKEN_DWONLY:"Token status is set to 'dw-only' - only deposits or withdrawals allowed",TR_TRG_CLOSED:"Cant add Transfer to group. TransferGroup is closed",TR_TRG_STATUS_MISMATCH:"Transfers in transfer_group must match transfer_group.transfer_status",TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG:"Withdrawals are expected connection points with outside systems, thus extra validation is required. Reversing a Transfer.type = 'withdrawal' requires reverse_withdrawal option to be true.",TRANSACTION_NOT_FOUND:"No open DB transaction with provided was found",TRANSACTION_TIMEOUT:"Transaction timed out",TRG_BALANCE_CHECK_REQUIRED_WITHOUT_STATUS_LOCK:"For integrity reasons running balance validations are required if TransferGroup.transfer_status_lock = false",TRG_CANCELLED_CANT_RV:"Cancelled TransferGroup can not be reversed",TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG:"TransferGroup includes Transfer.type = 'deposit', thus for extra validation the reverse_deposit option must be set true",TRG_SINGLE_PENDING_TR_CANT_RV:"Transfer is part of TransferGroup and can not be reversed separately",TRG_WITHDRAWAL_CANT_RV_WITHOUT_FLAG:"TransferGroup includes Transfer.type = 'withdrawal', thus for extra validation the reverse_withdrawal option must be set true",UNCLEAR_AGGREGATOR:"Invalid aggregator function provided",TR_MISSING_FILTER:"Transactions can't reversed or updated without valid filter",TRG_MISSING_FILTER:"Transaction groups can't reversed or updated without valid filter",HTTP_BODY_SIZE:"Http body size can't be more than 100MB",METHOD_DISABLED:"Method is disabled",DATABASE_IMPORT_UNEXPECTED_ERROR:"Unexpected error while importing database backup",DATABASE_IMPORT_NOT_FOUND:"Database import file not found",DATABASE_BACKUP_CREATE_UNEXPECTED_ERROR:"Unexpected error while creating database backup",LIST_DATABASE_BACKUPS_UNEXPECTED_ERROR:"Unexpected error while listing database backups",IMPORT_DATABASE_PROGRESS_NOT_FOUND:"Import database progress not found",IMPORT_DATABASE_PROGRESS_UNEXPECTED_ERROR:"Unexpected error while getting database import progress",DATABASE_BACKUP_PROGRESS_NOT_FOUND:"Database backup progress not found",DATABASE_BACKUP_PROGRESS_UNEXPECTED_ERROR:"Unexpected error while getting database backup progress"};var Bc=ri(kT());var ST=ri(require("crypto"));function as(t=8){return(0,ST.randomBytes)(t).toString("hex")}var Lc={timeouts:{},values:{},set(t,e){this.timeouts[t]=setTimeout(()=>this.clear(t),3e4),this.values[t]=e},get(t){return this.values[t]},getKey(t){let e=JSON.parse(JSON.stringify(t)),r="";return Object.keys(e).sort().forEach(n=>{let a="";e[n]&&typeof e[n]=="object"&&!Array.isArray(e[n])?a=this.getKey(e[n]):a=JSON.stringify(e[n]),r+=n+":"+a}),r},clear(t){this.timeouts[t]&&clearTimeout(this.timeouts[t]),delete this.timeouts[t],delete this.values[t]},clearAll(){Object.keys(this.timeouts).forEach(t=>{clearTimeout(this.timeouts[t])}),this.timeouts={},this.values={}}};function Re(t){if(!t)return(0,Bc.v4)();let e=Lc.getKey(t);if(Lc.get(e))throw new de({message:re.INPUT_NEEDS_IDENTIFIER,data:t});let r=(0,Bc.v4)();return Lc.set(e,r),r}function CT(t){return new Promise(e=>setTimeout(e,t))}function PT(){return Re()}function Pd(t){return JSON.parse(JSON.stringify(t))}function yt(t,e,r){if(e in t){if(t[e]===void 0)throw new Ne({message:`undefined provided for ${e}`,data:t});return t}if(!r)throw new Ne({message:`${e} is required if no default set`,data:t});let n=Pd(t);return n[e]=r,n}function G(t){let e=GT(t);if(e!=null)return{foreign:e}}function J(t){let e=GT(t);if(e!=null)return{identifier:e}}function M({input:t,options:e,validate:r}){var a;let n=Pd(t);return(a=n.options)!=null||(n.options=e!=null?e:{}),r(n)}function GT(t){return t==null?t:t+""}function z$(t){return Object.keys(t).filter(e=>t[e]!==void 0).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function DT(t){let e=t.host;return typeof window!="undefined"&&(e=t.host.replace(/^https:/,"wss:")),e+"?"+z$({apikey:t.apikey,apisecret:t.apisecret,db:t.database,clientVersion:t.clientVersion})}function MT(t){return typeof window=="undefined"?[DT(t),{rejectUnauthorized:t.rejectUnauthorized}]:[DT(t)]}function Gd(t,e){let r={};return Object.keys(t).forEach(n=>{e[n]?typeof e[n]=="string"?r[e[n]]=t[n]:r[n]=e[n](t[n]):r[n]=t[n]}),r}function bt(t){return t.split(",").map(e=>e.split(" ")).map(e=>{let[r,n]=e;return{field:r,direction:n==="desc"?"desc":"asc"}})}function WT(t){return new Date(t).setHours(0,0,0,0)>new Date().setHours(0,0,0,0)}function K$(t){return t%4==0&&(t%100!=0||t%400==0)}var Q$=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,J$=[0,31,28,31,30,31,30,31,31,30,31,30,31];function ET(t){let e=Q$.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],a=+e[3];return n>=1&&n<=12&&a>=1&&a<=(n===2&&K$(r)?29:J$[n])}var X$=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function Y$(t,e){let r=X$.exec(t);if(!r)return!1;let n=+r[1],a=+r[2],s=+r[3],i=r[5];return(n<=23&&a<=59&&s<=59||n===23&&a===59&&s===60)&&(!e||i!=="")}var Z$=/t|\s/i;function RT(t){let e=t.split(Z$);return e.length===1?ET(e[0]):e.length===2&&ET(e[0])&&Y$(e[1])}var ve;(function(o){o.version="2.0",o.acknowledgement="ack",o.ping="ping",o.pong="pong",o.streamChunk="streamChunk",o.streamPause="streamPause",o.streamResume="streamResume"})(ve||(ve={}));var ss=ri(require("stream")),Dd=class extends ss.Readable{constructor(e){super(e)}_read(e){}};var Vc=class extends ss.PassThrough{constructor(){super({objectMode:!0})}write(e,r,n){if(n)throw new TypeError("Stream in objectMode, no encoding supported");return super.write(e,r)}end(e,r,n){if(n)throw new TypeError("Stream in objectMode, no encoding supported");return super.end(e,r)}},Hc=class extends ss.Transform{constructor(e){super(q(P({},e),{writableObjectMode:!0,readableObjectMode:!0}));this.dataTransform=e.dataTransform}_transform(e,r,n){this.dataTransform(e).then(a=>{a?n(null,a):n()}).catch(n)}_flush(e){this.dataTransform().then(r=>{r?e(null,r):e()}).catch(e)}};var da=class{constructor(e){this.streamObject=new Dd({objectMode:!0});this.outStreamObject=new Dd({objectMode:!0});this.started=!1;this.makeRequest=e}start(e){if(this.mode&&this.mode!==e)throw new Error("Already in use as "+this.mode);if(this.started)return;if(this.promise=new Promise((n,a)=>{this.resolve=n,this.reject=a}),this.started=!0,this.mode=e,this.makeRequest===void 0){this.streamObject.push(null),this.resolve(void 0);return}this.makeRequest(this.streamObject).catch(this.reject);let r=[];if(this.mode==="stream"){this.streamObject.on("data",n=>{if(n||this.outStreamObject.push(n),n.error){let a=Mc(n.error);return this.outStreamObject.destroy(a),this.streamObject.destroy(a)}if(!n.prop){r.push(n);return}if(n.dataArr){let a=P({},n);delete a.dataArr,n.dataArr.forEach(s=>{this.outStreamObject.push(q(P({},a),{data:s}))});return}this.outStreamObject.push(n)}).on("end",()=>{let n=r.pop();if(!n)return;let a=n.result;Object.keys(a).forEach(s=>{!Array.isArray(a[s])||(a[s].forEach(i=>{this.outStreamObject.push({type:ve.streamChunk,prop:s,data:i})}),a[s]=[])}),this.outStreamObject.push(n),this.outStreamObject.push(null)}).on("error",n=>{this.outStreamObject.destroy(n)});return}if(this.mode==="promise"){let n=new Map;this.streamObject.on("data",a=>{var i;if(a===void 0)return;if(a.error){let o=Mc(a.error);return this.streamObject.destroy(o)}if(!a.prop){r.push(a);return}let s=(i=n.get(a.prop))!=null?i:[];a.dataArr?s.push(...a.dataArr):s.push(a.data),n.set(a.prop,s)}).on("end",()=>{let a=r.pop();if(!a)return;let s=a.result;if(!n.size)return this.resolve(s);let i=!1;n.forEach((o,f)=>{Array.isArray(s[f])?(o.push(...s[f]),s[f]=o):o.length===1?s[f]=o:(this.streamObject.destroy(new gd({message:"Received multiple chunks for non-array property "+f,code:me.StreamError,data:o})),i=!0)}),i||this.resolve(s)}).on("error",this.reject)}}then(e,r){return this.start("promise"),this.promise.then(e,r)}catch(e){return this.start("promise"),this.promise.catch(e)}stream(){return this.start("stream"),this.outStreamObject}};var Md=class extends da{constructor(e,r){super(e);this.inputStream=r}input(e){return e?typeof e=="function"?(e(this.inputStream),this):(console.warn("currently disabled"),this):this.inputStream}};var cx=ri(lx());var qk="http://json-schema.org/draft-07/schema",Nk="JSONRPCRequest",Bk="A JSON RPC 2.0 request",Lk=[{description:"An individual request",$ref:"#/definitions/request"}],Vk={request:{type:"object",required:["jsonrpc","method"],properties:{jsonrpc:{enum:["2.0"]},method:{type:"string"},id:{type:["string","number","null"],note:["While allowed, null should be avoided: http://www.jsonrpc.org/specification#id1","While allowed, a number with a fractional part should be avoided: http://www.jsonrpc.org/specification#id2"]},params:{type:["array","object"]}}}},yh={$schema:qk,$id:Nk,description:Bk,oneOf:Lk,definitions:Vk};var Hk="http://json-schema.org/draft-07/schema",zk="JSONRPCResponse",Kk="A JSON RPC 2.0 response",Qk=[{$ref:"#/definitions/success"},{$ref:"#/definitions/error"}],Jk={common:{required:["id","jsonrpc"],not:{description:"cannot have result and error at the same time",required:["result","error"]},type:"object",properties:{id:{type:["string","integer","null"],note:["spec says a number which should not contain a fractional part","We choose integer here, but this is unenforceable with some languages"]},jsonrpc:{enum:["2.0"]}}},success:{description:"A success. The result member is then required and can be anything.",allOf:[{$ref:"#/definitions/common"},{required:["result"]}]},error:{allOf:[{$ref:"#/definitions/common"},{required:["error"],properties:{error:{type:"object",required:["code","message"],properties:{code:{type:"integer",note:["unenforceable in some languages"]},message:{type:"string"},data:{description:"optional, can be anything"}}}}}]}},bh={$schema:Hk,$id:zk,description:Kk,oneOf:Qk,definitions:Jk};var Xk="http://json-schema.org/draft-07/schema",Yk="ClientOptions",Zk="Client input options",eS="object",tS={client:{$ref:"#/definitions/ClientType"},connection:{anyOf:[{$ref:"#/definitions/ws_connection"},{$ref:"#/definitions/https_connection"}]}},rS=["client","connection"],nS=!1,aS={ClientType:{$id:"ClientType",type:"string",enum:["ws","https"]},ws_connection:{description:"Connection options for ws api",type:"object",properties:{host:{description:"URL of the API",type:"string"},apikey:{description:"API key for the client",type:"string"},apisecret:{description:"API secret for the client",type:"string"}},required:["host","apikey","apisecret"]},https_connection:{description:"Connection options for https api",type:"object",properties:{host:{description:"URL of the API",type:"string"},jwt:{description:"Auth token for calling api",type:"string"}},required:["host"]}},xh={$schema:Xk,$id:Yk,description:Zk,type:eS,properties:tS,required:rS,additionalProperties:nS,definitions:aS};var sS="http://json-schema.org/draft-07/schema",iS="Consts",oS="Enums and consts used by the system",pS={Flags:{$id:"Flags",$comment:"knex|manual",description:"Allowed filtering functions",type:"object",properties:{allow_timestamps:{description:"Allow setting timestamps in transfer insert/update statements",type:"boolean"},production:{description:"Is running in production mode?",type:"boolean"}},$typescript:'{"additionalProperties":false}'},DbFilterMetadata:{$id:"FilterMetadata",$comment:"knex|manual",type:"object",propertyNames:{type:"string",format:"validkey"},patternProperties:{".*":{type:["string","boolean","number"]}}},DbFilterFunctionWherePrimitive:{$id:"DbFilterFunctionWherePrimitive",$comment:"knex|manual",description:"Filtering for where and orWhere",type:"object",properties:{function:{$ref:"#/definitions/DbFilterFunctionBasic"},field:{type:"string"},operator:{$ref:"#/definitions/DbFilterOperatorExtended"},value:{type:["string","number","boolean"]}},required:["function","field","value"],$typescript:'{"additionalProperties": false}'},DbFilterFunctionWherePrimitiveForeign:{$id:"DbFilterFunctionWherePrimitiveForeign",$comment:"knex|manual",description:"Filtering for where and orWhere",type:"object",properties:{function:{$ref:"#/definitions/DbFilterFunctionBasic"},field:{type:"string"},operator:{$ref:"#/definitions/DbFilterOperatorExtended"},value:{anyOf:[{type:["string","number","boolean"]},{type:"object",properties:{foreign:{type:["string","number"]}},required:["foreign"],$typescript:'{"additionalProperties": false}'}]}},required:["function","field","value"],$typescript:'{"additionalProperties": false}'},DbFilterFunctionWherePrimitiveIdentifier:{$id:"DbFilterFunctionWherePrimitiveIdentifier",$comment:"knex|manual",description:"Filtering for where and orWhere",type:"object",properties:{function:{$ref:"#/definitions/DbFilterFunctionBasic"},field:{type:"string"},operator:{$ref:"#/definitions/DbFilterOperatorExtended"},value:{anyOf:[{type:["string","number","boolean"]},{type:"object",properties:{identifier:{type:["string","number"]}},required:["identifier"],$typescript:'{"additionalProperties": false}'}]}},required:["function","field","value"],$typescript:'{"additionalProperties": false}'},DbFilterFunctionWhereMetadataPrimitive:{$id:"DbFilterFunctionWhereMetadataPrimitive",$comment:"knex|manual",description:"Filtering for where and orWhere",type:"object",properties:{function:{$ref:"#/definitions/DbFilterFunctionMetadataBasic"},field:{type:"string"},operator:{$ref:"#/definitions/DbFilterOperatorExtended"},value:{type:["string","number","boolean"]}},required:["function","field","value"],$typescript:'{"additionalProperties": false}'},DbFilterFunctionMetadataBasic:{$id:"DbFilterFunctionMetadataBasic",$comment:"knex|manual",type:"string",enum:["whereMetadata","orWhereMetadata"]},DbFilterFunctionWhereObject:{$id:"DbFilterFunctionWhereObject",$comment:"knex|manual",description:"Filtering for where and orWhere",type:"object",properties:{function:{$ref:"#/definitions/DbFilterFunctionBasic"},value:{type:"object",properties:{metadata:{$ref:"#/definitions/DbFilterMetadata"}}}},required:["function","value"],$typescript:'{"additionalProperties": false}'},DbFilterFunctionBasic:{$id:"DbFilterFunctionBasic",$comment:"knex|manual",type:"string",enum:["where","orWhere"]},DbFilterFunctionWhereIns:{$id:"DbFilterFunctionWhereIns",$comment:"knex|manual",description:"Filtering for whereIn and orWhereIn",type:"object",properties:{function:{$ref:"#/definitions/DbFilterFunctionIn"},field:{type:"string"},value:{anyOf:[{type:"array",items:{type:"string"},minItems:1},{type:"array",items:{type:"number"},minItems:1}]}},required:["function","field","value"],$typescript:'{"additionalProperties": false}'},DbFilterFunctionIn:{$id:"DbFilterFunctionIn",$comment:"knex|manual",type:"string",enum:["whereIn","orWhereIn"]},DbFilterFunctionWhereMetadataIns:{$id:"DbFilterFunctionWhereMetadataIns",$comment:"knex|manual",description:"Filtering for whereIn and orWhereIn for metadata",type:"object",properties:{function:{$ref:"#/definitions/DbFilterFunctionMetadataIn"},field:{type:"string"},value:{anyOf:[{type:"array",items:{type:"string"},minItems:1},{type:"array",items:{type:"number"},minItems:1}]}},required:["function","field","value"],$typescript:'{"additionalProperties": false}'},DbFilterFunctionMetadataIn:{$id:"DbFilterFunctionMetadataIn",$comment:"knex|manual",type:"string",enum:["whereMetadataIn","orWhereMetadataIn"]},DbFilterFunctionWhereMetadataNulls:{$id:"DbFilterFunctionWhereMetadataNulls",$comment:"knex|manual",description:"Filtering for whereNull and orWhereNull, whereNotNull and orWhereNotNull for metadata",type:"object",properties:{function:{$ref:"#/definitions/DbFilterFunctionMetadataNull"},field:{type:"string"}},required:["function","field"],$typescript:'{"additionalProperties": false}'},DbFilterFunctionMetadataNull:{$id:"DbFilterFunctionMetadataNull",$comment:"knex|manual",type:"string",enum:["whereMetadataNull","orWhereMetadataNull","whereMetadataNotNull","orWhereMetadataNotNull"]},DbFilterFunctionWhereNulls:{$id:"DbFilterFunctionWhereNulls",$comment:"knex|manual",description:"Filtering for whereNull and orWhereNull, whereNotNull and orWhereNotNull",type:"object",properties:{function:{$ref:"#/definitions/DbFilterFunctionNull"},field:{type:"string"}},required:["function","field"],$typescript:'{"additionalProperties": false}'},DbFilterFunctionNull:{$id:"DbFilterFunctionNull",$comment:"knex|manual",type:"string",enum:["whereNull","orWhereNull","whereNotNull","orWhereNotNull"]},DbFilterOperator:{$id:"DbFilterOperator",$comment:"knex|manual",description:"Allowed filtering operators, ignored when value is not primitive",type:"string",enum:["=",">=","<=","<",">"],default:"="},DbFilterOperatorString:{$id:"DbFilterOperatorString",$comment:"knex|manual",description:"Allowed filtering operators for strings",type:"string",enum:["like","ilike"]},DbFilterOperatorExtended:{$id:"DbFilterOperatorExtended",$comment:"knex|manual",description:"Allowed filtering operators, ignored when value is not primitive",type:"string",enum:["=",">=","<=","<",">","like","ilike"],default:"="},DbFilter:{$id:"DbFilter",$comment:"knex|manual",anyOf:[{$ref:"#/definitions/DbFilterMetadata"},{$ref:"#/definitions/DbFilterFunctionWhereInner"},{$ref:"#/definitions/DbFilterFunctionWherePrimitive"},{$ref:"#/definitions/DbFilterFunctionWherePrimitiveForeign"},{$ref:"#/definitions/DbFilterFunctionWherePrimitiveIdentifier"},{$ref:"#/definitions/DbFilterFunctionWhereMetadataPrimitive"},{$ref:"#/definitions/DbFilterFunctionWhereObject"},{$ref:"#/definitions/DbFilterFunctionWhereIns"},{$ref:"#/definitions/DbFilterFunctionWhereMetadataIns"},{$ref:"#/definitions/DbFilterFunctionWhereMetadataNulls"},{$ref:"#/definitions/DbFilterFunctionWhereNulls"}]},DbFilterFunctionWhereInner:{$id:"DbFilterFunctionWhereInner",$comment:"knex|manual",description:"Filtering for where and orWhere",type:"object",properties:{function:{$ref:"#/definitions/DbFilterFunctionBasic"},inner:{type:"array",items:{$ref:"#/definitions/DbFilter"}}},required:["function","inner"],$typescript:'{"additionalProperties": false}'},TokenType:{$id:"TokenType",$comment:"model",description:"DB type values for TokenType",type:"string",enum:["value","share","group","contract"]},TokenStatus:{$id:"TokenStatus",$comment:"model",description:"DB type values for TokenStatus",type:"string",enum:["active","dw-only","disabled"]},TransferGroupStatus:{$id:"TransferGroupStatus",$comment:"model",description:"DB type values for TransferGroupStatus",type:"string",enum:["open","closed"]},TransferStatus:{$id:"TransferStatus",$comment:"model",description:"DB type values for TransferStatus",type:"string",enum:["pending","finished","cancelled"]},TransferStatusInput:{$id:"TransferStatusInput",$comment:"model",description:"DB type input values for TransferStatus",type:"string",enum:["pending","finished"]},TransferGroupType:{$id:"TransferGroupType",$comment:"model",description:"DB type values for TransferGroupType",type:"string",enum:["regular","exchange","distribution"]},TransferType:{$id:"TransferType",$comment:"model",description:"DB type values for TransferType",type:"string",enum:["transfer","deposit","withdrawal"]},WalletType:{$id:"WalletType",$comment:"model",description:"DB type values for WalletType",type:"string",enum:["token","house","regular"]},WalletStatus:{$id:"WalletStatus",$comment:"model",description:"DB type values for WalletStatus",type:"string",enum:["active","disabled"]},WapiSettingType:{$id:"WapiSettingType",$comment:"model",description:"DB type values for WapiSettingType",type:"string",enum:["flag","setting"]},DbModelName:{$id:"DbModelName",$comment:"model",description:"DB Model Names",type:"string",enum:["Token","TransferGroup","TransferLog","Transfer","WalletTokenSetting","Wallet","WapiSetting"]}},cs={$schema:sS,$id:iS,description:oS,definitions:pS};var fS="http://json-schema.org/draft-07/schema",uS="TokenTableInput",dS="TokenTableInput",lS="Units of value which can be transferred in this system",cS="object",mS={foreign:{description:"Name of the token, used for name based token transfers. Must be unique",type:"string",maxLength:255,minLength:1},public:{description:"Boolean indicating if token can be traded with outside seed wallet",default:!0,type:"boolean"},metadata:{description:"Key/value object describing the token",type:["object","null"]},divisor:{description:"Minimum amount of token that can be transferred",type:["number","null"]},limit:{description:"Maximum amount of token that can be issued",type:["number","null"]},type:{description:"Type of the token",default:"value",$ref:"/db/consts.schema.json#/definitions/TokenType"},status:{description:"Current status for the token",default:"active",$ref:"/db/consts.schema.json#/definitions/TokenStatus"}},hS=!1,gS=["foreign"],vo={$schema:fS,$id:uS,title:dS,description:lS,type:cS,properties:mS,additionalProperties:hS,required:gS};var _S="http://json-schema.org/draft-07/schema",TS="TokenTable",yS="TokenTable",bS="Units of value which can be transferred in this system",xS="object",FS={id:{description:"System defined primary key",type:"integer"},foreign:{description:"Name of the token, used for name based token transfers. Must be unique",type:"string",maxLength:255,minLength:1},public:{description:"Boolean indicating if token can be traded with outside seed wallet",default:!0,type:"boolean"},belongs_to:{description:"Foreign key to seed wallet",type:"integer"},created_at:{description:"Datetime when the token was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when the token was last updated",type:"string",format:"date-time"},metadata:{description:"Key/value object describing the token",type:["object","null"]},divisor:{description:"Minimum amount of token that can be transferred",type:["number","null"]},limit:{description:"Maximum amount of token that can be issued",type:["number","null"]},type:{description:"Type of the token",default:"value",$ref:"/db/consts.schema.json#/definitions/TokenType"},status:{description:"Current status for the token",default:"active",$ref:"/db/consts.schema.json#/definitions/TokenStatus"}},wS=!1,$S={TokenTableAccessibleFields:{$id:"TokenTableAccessibleFields",type:"string",enum:["id","foreign","public","metadata","divisor","limit","type","status"]},TokenTableFields:{$id:"TokenTableFields",type:"string",enum:["id","foreign","public","belongs_to","created_at","updated_at","metadata","divisor","limit","type","status"]},TokenTableStringFields:{$id:"TokenTableStringFields",type:"string",enum:["foreign","created_at","updated_at","type","status"]},TokenTableObjectFields:{$id:"TokenTableObjectFields",type:"string",enum:["metadata"]},TokenTableNumberFields:{$id:"TokenTableNumberFields",type:"string",enum:["id","belongs_to","divisor","limit"]},TokenTableBooleanFields:{$id:"TokenTableBooleanFields",type:"string",enum:["public"]}},OS=["id","foreign","public","belongs_to","created_at","updated_at","type","status"],jo={$schema:_S,$id:TS,title:yS,description:bS,type:xS,properties:FS,additionalProperties:wS,definitions:$S,required:OS};var vS="http://json-schema.org/draft-07/schema",jS="TokenTableOptional",IS="TokenTableOptional",kS="Units of value which can be transferred in this system Only require id, other fields are optional",SS="object",CS={id:{description:"System defined primary key",type:"integer"},foreign:{description:"Name of the token, used for name based token transfers. Must be unique",type:"string",maxLength:255,minLength:1},public:{description:"Boolean indicating if token can be traded with outside seed wallet",default:!0,type:"boolean"},belongs_to:{description:"Foreign key to seed wallet",type:"integer"},created_at:{description:"Datetime when the token was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when the token was last updated",type:"string",format:"date-time"},metadata:{description:"Key/value object describing the token",type:["object","null"]},divisor:{description:"Minimum amount of token that can be transferred",type:["number","null"]},limit:{description:"Maximum amount of token that can be issued",type:["number","null"]},type:{description:"Type of the token",default:"value",$ref:"/db/consts.schema.json#/definitions/TokenType"},status:{description:"Current status for the token",default:"active",$ref:"/db/consts.schema.json#/definitions/TokenStatus"}},PS=!1,GS=["id"],Fh={$schema:vS,$id:jS,title:IS,description:kS,type:SS,properties:CS,additionalProperties:PS,required:GS};var DS="http://json-schema.org/draft-07/schema",MS="TransferTableInput",WS="TransferTableInput",ES="A transfer of value from one wallet to another",RS="object",AS={identifier:{description:"Identifier for this transfer. Must be unique",type:"string",maxLength:255,minLength:1},control_hash:{description:'Hash binding this transfer to the from_wallets transfer chain. It is calculated as sha256(latest_outgoing_hash + "-" + NEW.identifier)',type:["string","null"],maxLength:255},from_wallet_id:{description:"Foreign key to wallet funds originate from",type:"integer"},to_wallet_id:{description:"Foreign key to wallet where funds are going",type:"integer"},token_id:{description:"Foreign key to token this transfer refers to",type:"integer"},amount:{description:"The transfer amount",type:"number"},type:{description:"Type of the transfer",default:"transfer",$ref:"/db/consts.schema.json#/definitions/TransferType"},status:{description:"Status of the transfer",default:"finished",$ref:"/db/consts.schema.json#/definitions/TransferStatusInput"},force:{description:"Set to true to force transfer without checking for negative balance constraints",default:!1,type:"boolean"},created_at:{description:"Datetime when this transfer was created - can only be latest",type:"string",format:"date-time"},updated_at:{description:"Datetime when this transfer was updated - can only be latest",type:"string",format:"date-time"},metadata:{description:"Key/value object describing this transfer",type:["object","null"]},transfer_group_id:{description:"Foreign key pointing to the transfer_group this transfer belongs to",type:["integer","null"]},reverses_id:{description:"Foreign key pointing to the transfer this transfer reverses. Must be unique",type:["integer","null"]},status_finalized_at:{description:"DateTime transfer reached final status",type:["string","null"],format:"date-time"}},US=!1,qS=["identifier","from_wallet_id","to_wallet_id","token_id","amount"],Io={$schema:DS,$id:MS,title:WS,description:ES,type:RS,properties:AS,additionalProperties:US,required:qS};var NS="http://json-schema.org/draft-07/schema",BS="TransferTable",LS="TransferTable",VS="A transfer of value from one wallet to another",HS="object",zS={id:{description:"System defined primary key",type:"integer"},identifier:{description:"Identifier for this transfer. Must be unique",type:"string",maxLength:255,minLength:1},control_hash:{description:'Hash binding this transfer to the from_wallets transfer chain. It is calculated as sha256(latest_outgoing_hash + "-" + NEW.identifier)',type:["string","null"],maxLength:255},from_wallet_id:{description:"Foreign key to wallet funds originate from",type:"integer"},to_wallet_id:{description:"Foreign key to wallet where funds are going",type:"integer"},token_id:{description:"Foreign key to token this transfer refers to",type:"integer"},amount:{description:"The transfer amount",type:"number"},type:{description:"Type of the transfer",default:"transfer",$ref:"/db/consts.schema.json#/definitions/TransferType"},status:{description:"Status of the transfer",default:"finished",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},force:{description:"Set to true to force transfer without checking for negative balance constraints",default:!1,type:"boolean"},auto_hash:{description:"When set to true it will automatically calculate the control_hash",default:!1,type:"boolean"},created_at:{description:"Datetime when this transfer was created - can only be latest",type:"string",format:"date-time"},updated_at:{description:"Datetime when this transfer was updated - can only be latest",type:"string",format:"date-time"},metadata:{description:"Key/value object describing this transfer",type:["object","null"]},transfer_group_id:{description:"Foreign key pointing to the transfer_group this transfer belongs to",type:["integer","null"]},reverses_id:{description:"Foreign key pointing to the transfer this transfer reverses. Must be unique",type:["integer","null"]},status_finalized_at:{description:"DateTime transfer reached final status",type:["string","null"],format:"date-time"},group_validate:{description:"Boolean showing if the transfer_group has validate_final_balance_only",default:!1,type:"boolean"}},KS=!1,QS={TransferTableAccessibleFields:{$id:"TransferTableAccessibleFields",type:"string",enum:["id","identifier","control_hash","from_wallet_id","to_wallet_id","token_id","amount","type","status","force","created_at","updated_at","metadata","transfer_group_id","reverses_id","status_finalized_at"]},TransferTableFields:{$id:"TransferTableFields",type:"string",enum:["id","identifier","control_hash","from_wallet_id","to_wallet_id","token_id","amount","type","status","force","auto_hash","created_at","updated_at","metadata","transfer_group_id","reverses_id","status_finalized_at"]},TransferTableStringFields:{$id:"TransferTableStringFields",type:"string",enum:["identifier","control_hash","type","status","created_at","updated_at","status_finalized_at"]},TransferTableObjectFields:{$id:"TransferTableObjectFields",type:"string",enum:["metadata"]},TransferTableNumberFields:{$id:"TransferTableNumberFields",type:"string",enum:["id","from_wallet_id","to_wallet_id","token_id","amount","transfer_group_id","reverses_id"]},TransferTableBooleanFields:{$id:"TransferTableBooleanFields",type:"string",enum:["force","auto_hash"]}},JS=["id","identifier","from_wallet_id","to_wallet_id","token_id","amount","type","status","force","auto_hash","created_at","updated_at"],ko={$schema:NS,$id:BS,title:LS,description:VS,type:HS,properties:zS,additionalProperties:KS,definitions:QS,required:JS};var XS="http://json-schema.org/draft-07/schema",YS="TransferTableOptional",ZS="TransferTableOptional",eC="A transfer of value from one wallet to another Only require id, other fields are optional",tC="object",rC={id:{description:"System defined primary key",type:"integer"},identifier:{description:"Identifier for this transfer. Must be unique",type:"string",maxLength:255,minLength:1},control_hash:{description:'Hash binding this transfer to the from_wallets transfer chain. It is calculated as sha256(latest_outgoing_hash + "-" + NEW.identifier)',type:["string","null"],maxLength:255},from_wallet_id:{description:"Foreign key to wallet funds originate from",type:"integer"},to_wallet_id:{description:"Foreign key to wallet where funds are going",type:"integer"},token_id:{description:"Foreign key to token this transfer refers to",type:"integer"},amount:{description:"The transfer amount",type:"number"},type:{description:"Type of the transfer",default:"transfer",$ref:"/db/consts.schema.json#/definitions/TransferType"},status:{description:"Status of the transfer",default:"finished",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},force:{description:"Set to true to force transfer without checking for negative balance constraints",default:!1,type:"boolean"},auto_hash:{description:"When set to true it will automatically calculate the control_hash",default:!1,type:"boolean"},created_at:{description:"Datetime when this transfer was created - can only be latest",type:"string",format:"date-time"},updated_at:{description:"Datetime when this transfer was updated - can only be latest",type:"string",format:"date-time"},metadata:{description:"Key/value object describing this transfer",type:["object","null"]},transfer_group_id:{description:"Foreign key pointing to the transfer_group this transfer belongs to",type:["integer","null"]},reverses_id:{description:"Foreign key pointing to the transfer this transfer reverses. Must be unique",type:["integer","null"]},status_finalized_at:{description:"DateTime transfer reached final status",type:["string","null"],format:"date-time"},group_validate:{description:"Boolean showing if the transfer_group has validate_final_balance_only",default:!1,type:"boolean"}},nC=!1,aC=["id"],wh={$schema:XS,$id:YS,title:ZS,description:eC,type:tC,properties:rC,additionalProperties:nC,required:aC};var sC="http://json-schema.org/draft-07/schema",iC="TransferGroupTableInput",oC="TransferGroupTableInput",pC="An entity collecting transfers into a group locked by status",fC="object",uC={identifier:{description:"Identifier for this transfer. Must be unique",type:"string",maxLength:255,minLength:1},status:{description:"Lifecycle status for transfer group",default:"open",$ref:"/db/consts.schema.json#/definitions/TransferGroupStatus"},transfer_status:{description:"Status of the transfer",default:"pending",$ref:"/db/consts.schema.json#/definitions/TransferStatusInput"},metadata:{description:"Key/value object describing this transfer_group",type:["object","null"]},reverses_id:{description:"Foreign key pointing to the transfer_group this transfer_group reverses",type:["integer","null"]},status_finalized_at:{description:"Time transfer_group was closed",type:["string","null"],format:"date-time"},transfer_status_finalized_at:{description:"Time transfer_status reached final state. Must be unique",type:["string","null"],format:"date-time"},type:{description:"Type of the transfer group",default:"regular",$ref:"/db/consts.schema.json#/definitions/TransferGroupType"}},dC=!1,lC=["identifier"],So={$schema:sC,$id:iC,title:oC,description:pC,type:fC,properties:uC,additionalProperties:dC,required:lC};var cC="http://json-schema.org/draft-07/schema",mC="TransferGroupTable",hC="TransferGroupTable",gC="An entity collecting transfers into a group locked by status",_C="object",TC={id:{description:"System defined primary key",type:"integer"},identifier:{description:"Identifier for this transfer. Must be unique",type:"string",maxLength:255,minLength:1},status:{description:"Lifecycle status for transfer group",default:"open",$ref:"/db/consts.schema.json#/definitions/TransferGroupStatus"},transfer_status:{description:"Status of the transfer",default:"pending",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},metadata:{description:"Key/value object describing this transfer_group",type:["object","null"]},created_at:{description:"Datetime when this transfer was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when this transfer was updated",type:"string",format:"date-time"},reverses_id:{description:"Foreign key pointing to the transfer_group this transfer_group reverses",type:["integer","null"]},status_finalized_at:{description:"Time transfer_group was closed",type:["string","null"],format:"date-time"},transfer_status_finalized_at:{description:"Time transfer_status reached final state. Must be unique",type:["string","null"],format:"date-time"},type:{description:"Type of the transfer group",default:"regular",$ref:"/db/consts.schema.json#/definitions/TransferGroupType"},validate_final_balance_only:{description:"Boolean if only the final balances of wallets should be validated",default:!1,type:"boolean"}},yC=!1,bC={TransferGroupTableAccessibleFields:{$id:"TransferGroupTableAccessibleFields",type:"string",enum:["id","identifier","status","transfer_status","metadata","reverses_id","status_finalized_at","transfer_status_finalized_at","type"]},TransferGroupTableFields:{$id:"TransferGroupTableFields",type:"string",enum:["id","identifier","status","transfer_status","metadata","created_at","updated_at","reverses_id","status_finalized_at","transfer_status_finalized_at","type","validate_final_balance_only"]},TransferGroupTableStringFields:{$id:"TransferGroupTableStringFields",type:"string",enum:["identifier","status","transfer_status","created_at","updated_at","status_finalized_at","transfer_status_finalized_at","type"]},TransferGroupTableObjectFields:{$id:"TransferGroupTableObjectFields",type:"string",enum:["metadata"]},TransferGroupTableNumberFields:{$id:"TransferGroupTableNumberFields",type:"string",enum:["id","reverses_id"]},TransferGroupTableBooleanFields:{$id:"TransferGroupTableBooleanFields",type:"string",enum:["validate_final_balance_only"]}},xC=["id","identifier","status","transfer_status","created_at","updated_at","type","validate_final_balance_only"],Co={$schema:cC,$id:mC,title:hC,description:gC,type:_C,properties:TC,additionalProperties:yC,definitions:bC,required:xC};var FC="http://json-schema.org/draft-07/schema",wC="TransferGroupTableOptional",$C="TransferGroupTableOptional",OC="An entity collecting transfers into a group locked by status Only require id, other fields are optional",vC="object",jC={id:{description:"System defined primary key",type:"integer"},identifier:{description:"Identifier for this transfer. Must be unique",type:"string",maxLength:255,minLength:1},status:{description:"Lifecycle status for transfer group",default:"open",$ref:"/db/consts.schema.json#/definitions/TransferGroupStatus"},transfer_status:{description:"Status of the transfer",default:"pending",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},metadata:{description:"Key/value object describing this transfer_group",type:["object","null"]},created_at:{description:"Datetime when this transfer was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when this transfer was updated",type:"string",format:"date-time"},reverses_id:{description:"Foreign key pointing to the transfer_group this transfer_group reverses",type:["integer","null"]},status_finalized_at:{description:"Time transfer_group was closed",type:["string","null"],format:"date-time"},transfer_status_finalized_at:{description:"Time transfer_status reached final state. Must be unique",type:["string","null"],format:"date-time"},type:{description:"Type of the transfer group",default:"regular",$ref:"/db/consts.schema.json#/definitions/TransferGroupType"},validate_final_balance_only:{description:"Boolean if only the final balances of wallets should be validated",default:!1,type:"boolean"}},IC=!1,kC=["id"],$h={$schema:FC,$id:wC,title:$C,description:OC,type:vC,properties:jC,additionalProperties:IC,required:kC};var SC="http://json-schema.org/draft-07/schema",CC="TransferLogTableInput",PC="TransferLogTableInput",GC="This table is readonly, so no input is valid",DC="READONLY",MC="object",WC={},EC=!1,Po={$schema:SC,$id:CC,title:PC,description:GC,$comment:DC,type:MC,properties:WC,additionalProperties:EC};var RC="http://json-schema.org/draft-07/schema",AC="TransferLogTable",UC="TransferLogTable",qC="Individual parts of a transfer, will be updated internally by db. Immutable",NC="READONLY",BC="object",LC={id:{description:"System defined primary key",type:"integer"},transfer_id:{description:"Foreign key pointing to the transfer this log belongs to",type:"integer"},wallet_id:{description:"Foreign key pointing to the wallet this log refers to",type:"integer"},token_id:{description:"Foreign key pointing to the token this log refers to",type:"integer"},type:{description:"Type of this log",$ref:"/db/consts.schema.json#/definitions/TransferType"},amount:{description:"The amount the wallet balance is changed by",type:"number"},pending_amount:{description:"The pending balance of wallet after this transfer_log",type:"number"},finished_amount:{description:"The finished balance of wallet after this transfer_log",type:"number"},status:{description:"Status of this log - same as Transfer.status",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},allow_negative:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be negative",default:!1,type:"boolean"},allow_positive:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be positive. Used for token balance to deny positive balance.",default:!0,type:"boolean"},force:{description:"Boolean indicating if the latest transfer from this wallet was forced to ignore negative balance checks",default:!1,type:"boolean"},created_at:{description:"Datetime this log was created",type:"string",format:"date-time"},latest_control_hash:{description:"Latest hash related to this wallet",type:["string","null"],maxLength:255},pending_amount_to:{description:"The incoming pending balance",type:"number"},pending_amount_from:{description:"The outgoing pending balance",type:"number"},group_balance:{description:"Running balance for the wallet in this group",type:["number","null"]},transfer_group_id:{description:"Foreign key pointing to the transfer_group this transfer_log belongs to",type:["integer","null"]},current:{description:"Boolean showing if this transfer_log is the latest for this wallet/token combination",default:!1,type:"boolean"},available_balance:{description:"Available balance that is sum of pending_amount_from and finished_amount",type:"number"},token_limit:{description:"If wallet = token.belongs_to and token has limit",type:["number","null"]}},VC=!1,HC={TransferLogTableAccessibleFields:{$id:"TransferLogTableAccessibleFields",type:"string",enum:["id","transfer_id","wallet_id","token_id","type","amount","pending_amount","finished_amount","status","created_at","pending_amount_to","pending_amount_from","available_balance","token_limit"]},TransferLogTableFields:{$id:"TransferLogTableFields",type:"string",enum:["id","transfer_id","wallet_id","token_id","type","amount","pending_amount","finished_amount","status","allow_negative","allow_positive","force","created_at","latest_control_hash","pending_amount_to","pending_amount_from","group_balance","current","available_balance","token_limit"]},TransferLogTableStringFields:{$id:"TransferLogTableStringFields",type:"string",enum:["type","status","created_at","latest_control_hash"]},TransferLogTableNumberFields:{$id:"TransferLogTableNumberFields",type:"string",enum:["id","transfer_id","wallet_id","token_id","amount","pending_amount","finished_amount","pending_amount_to","pending_amount_from","group_balance","available_balance","token_limit"]},TransferLogTableBooleanFields:{$id:"TransferLogTableBooleanFields",type:"string",enum:["allow_negative","allow_positive","force","current"]}},zC=["id","transfer_id","wallet_id","token_id","type","amount","pending_amount","finished_amount","status","allow_negative","allow_positive","force","created_at","pending_amount_to","pending_amount_from","current","available_balance"],Go={$schema:RC,$id:AC,title:UC,description:qC,$comment:NC,type:BC,properties:LC,additionalProperties:VC,definitions:HC,required:zC};var KC="http://json-schema.org/draft-07/schema",QC="TransferLogTableOptional",JC="TransferLogTableOptional",XC="Individual parts of a transfer, will be updated internally by db. Immutable Only require id, other fields are optional",YC="READONLY",ZC="object",eP={id:{description:"System defined primary key",type:"integer"},transfer_id:{description:"Foreign key pointing to the transfer this log belongs to",type:"integer"},wallet_id:{description:"Foreign key pointing to the wallet this log refers to",type:"integer"},token_id:{description:"Foreign key pointing to the token this log refers to",type:"integer"},type:{description:"Type of this log",$ref:"/db/consts.schema.json#/definitions/TransferType"},amount:{description:"The amount the wallet balance is changed by",type:"number"},pending_amount:{description:"The pending balance of wallet after this transfer_log",type:"number"},finished_amount:{description:"The finished balance of wallet after this transfer_log",type:"number"},status:{description:"Status of this log - same as Transfer.status",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},allow_negative:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be negative",default:!1,type:"boolean"},allow_positive:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be positive. Used for token balance to deny positive balance.",default:!0,type:"boolean"},force:{description:"Boolean indicating if the latest transfer from this wallet was forced to ignore negative balance checks",default:!1,type:"boolean"},created_at:{description:"Datetime this log was created",type:"string",format:"date-time"},latest_control_hash:{description:"Latest hash related to this wallet",type:["string","null"],maxLength:255},pending_amount_to:{description:"The incoming pending balance",type:"number"},pending_amount_from:{description:"The outgoing pending balance",type:"number"},group_balance:{description:"Running balance for the wallet in this group",type:["number","null"]},transfer_group_id:{description:"Foreign key pointing to the transfer_group this transfer_log belongs to",type:["integer","null"]},current:{description:"Boolean showing if this transfer_log is the latest for this wallet/token combination",default:!1,type:"boolean"},available_balance:{description:"Available balance that is sum of pending_amount_from and finished_amount",type:"number"},token_limit:{description:"If wallet = token.belongs_to and token has limit",type:["number","null"]}},tP=!1,rP=["id"],Oh={$schema:KC,$id:QC,title:JC,description:XC,$comment:YC,type:ZC,properties:eP,additionalProperties:tP,required:rP};var nP="http://json-schema.org/draft-07/schema",aP="WalletTableInput",sP="WalletTableInput",iP="Entities who can make transfers in this system",oP="object",pP={foreign:{description:"User provided key for wallet. Must be unique",type:"string",maxLength:64,minLength:1},name:{description:"Name of the wallet",type:["string","null"],maxLength:255},metadata:{description:"Key/value metadata object",type:["object","null"]},type:{description:"Type of the wallet",default:"regular",$ref:"/db/consts.schema.json#/definitions/WalletType"},status:{description:"Current status for the wallet",default:"active",$ref:"/db/consts.schema.json#/definitions/WalletStatus"}},fP=!1,uP=["foreign"],Do={$schema:nP,$id:aP,title:sP,description:iP,type:oP,properties:pP,additionalProperties:fP,required:uP};var dP="http://json-schema.org/draft-07/schema",lP="WalletTable",cP="WalletTable",mP="Entities who can make transfers in this system",hP="object",gP={id:{description:"System defined primary key",type:"integer"},foreign:{description:"User provided key for wallet. Must be unique",type:"string",maxLength:64,minLength:1},name:{description:"Name of the wallet",type:["string","null"],maxLength:255},metadata:{description:"Key/value metadata object",type:["object","null"]},type:{description:"Type of the wallet",default:"regular",$ref:"/db/consts.schema.json#/definitions/WalletType"},default_allow_negative:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be negative",default:!1,type:"boolean"},default_allow_positive:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be positive. Used for token balance to deny positive balance.",default:!0,type:"boolean"},created_at:{description:"Datetime when the wallet was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when the wallet was last updated",type:"string",format:"date-time"},status:{description:"Current status for the wallet",default:"active",$ref:"/db/consts.schema.json#/definitions/WalletStatus"},default_dtw_to:{description:"Bitmap indicating default what types of transfers can originate from wallet",default:"110",type:"string",maxLength:255,minLength:1},default_dtw_from:{description:"Bitmap indicating default what types of transfers can end to wallet",default:"011",type:"string",maxLength:255,minLength:1}},_P=!1,TP={WalletTableAccessibleFields:{$id:"WalletTableAccessibleFields",type:"string",enum:["id","foreign","name","metadata","type","status"]},WalletTableFields:{$id:"WalletTableFields",type:"string",enum:["id","foreign","name","metadata","type","default_allow_negative","default_allow_positive","created_at","updated_at","status"]},WalletTableStringFields:{$id:"WalletTableStringFields",type:"string",enum:["foreign","name","type","created_at","updated_at","status"]},WalletTableObjectFields:{$id:"WalletTableObjectFields",type:"string",enum:["metadata"]},WalletTableNumberFields:{$id:"WalletTableNumberFields",type:"string",enum:["id"]},WalletTableBooleanFields:{$id:"WalletTableBooleanFields",type:"string",enum:["default_allow_negative","default_allow_positive"]}},yP=["id","foreign","type","default_allow_negative","default_allow_positive","created_at","updated_at","status"],Mo={$schema:dP,$id:lP,title:cP,description:mP,type:hP,properties:gP,additionalProperties:_P,definitions:TP,required:yP};var bP="http://json-schema.org/draft-07/schema",xP="WalletTableOptional",FP="WalletTableOptional",wP="Entities who can make transfers in this system Only require id, other fields are optional",$P="object",OP={id:{description:"System defined primary key",type:"integer"},foreign:{description:"User provided key for wallet. Must be unique",type:"string",maxLength:64,minLength:1},name:{description:"Name of the wallet",type:["string","null"],maxLength:255},metadata:{description:"Key/value metadata object",type:["object","null"]},type:{description:"Type of the wallet",default:"regular",$ref:"/db/consts.schema.json#/definitions/WalletType"},default_allow_negative:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be negative",default:!1,type:"boolean"},default_allow_positive:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be positive. Used for token balance to deny positive balance.",default:!0,type:"boolean"},created_at:{description:"Datetime when the wallet was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when the wallet was last updated",type:"string",format:"date-time"},status:{description:"Current status for the wallet",default:"active",$ref:"/db/consts.schema.json#/definitions/WalletStatus"},default_dtw_to:{description:"Bitmap indicating default what types of transfers can originate from wallet",default:"110",type:"string",maxLength:255,minLength:1},default_dtw_from:{description:"Bitmap indicating default what types of transfers can end to wallet",default:"011",type:"string",maxLength:255,minLength:1}},vP=!1,jP=["id"],vh={$schema:bP,$id:xP,title:FP,description:wP,type:$P,properties:OP,additionalProperties:vP,required:jP};var IP="http://json-schema.org/draft-07/schema",kP="WalletTokenSettingTableInput",SP="WalletTokenSettingTableInput",CP="Settings between a wallet and token",PP="object",GP={},DP=!1,Wo={$schema:IP,$id:kP,title:SP,description:CP,type:PP,properties:GP,additionalProperties:DP};var MP="http://json-schema.org/draft-07/schema",WP="WalletTokenSettingTable",EP="WalletTokenSettingTable",RP="Settings between a wallet and token",AP="object",UP={id:{description:"System defined primary key",type:"integer"},wallet_id:{description:"Foreign key to wallet these settings refer to",type:"integer"},token_id:{description:"Foreign key to token these settings refer to",type:"integer"},allow_negative:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be negative",default:!1,type:"boolean"},allow_positive:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be positive. Used for token balance to deny positive balance.",default:!0,type:"boolean"},created_at:{description:"Datetime when the token was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when the token was last updated",type:"string",format:"date-time"},dtw_to:{description:"Bitmap indicating default what types of transfers can originate from wallet",default:"110",type:"string",maxLength:255,minLength:1},dtw_from:{description:"Bitmap indicating default what types of transfers can end to wallet",default:"011",type:"string",maxLength:255,minLength:1}},qP=!1,NP={WalletTokenSettingTableAccessibleFields:{$id:"WalletTokenSettingTableAccessibleFields",type:"string",enum:["id"]},WalletTokenSettingTableFields:{$id:"WalletTokenSettingTableFields",type:"string",enum:["id","wallet_id","token_id","allow_negative","allow_positive","created_at","updated_at"]},WalletTokenSettingTableStringFields:{$id:"WalletTokenSettingTableStringFields",type:"string",enum:["created_at","updated_at"]},WalletTokenSettingTableNumberFields:{$id:"WalletTokenSettingTableNumberFields",type:"string",enum:["id","wallet_id","token_id"]},WalletTokenSettingTableBooleanFields:{$id:"WalletTokenSettingTableBooleanFields",type:"string",enum:["allow_negative","allow_positive"]}},BP=["id","wallet_id","token_id","allow_negative","allow_positive","created_at","updated_at"],Eo={$schema:MP,$id:WP,title:EP,description:RP,type:AP,properties:UP,additionalProperties:qP,definitions:NP,required:BP};var LP="http://json-schema.org/draft-07/schema",VP="WalletTokenSettingTableOptional",HP="WalletTokenSettingTableOptional",zP="Settings between a wallet and token Only require id, other fields are optional",KP="object",QP={id:{description:"System defined primary key",type:"integer"},wallet_id:{description:"Foreign key to wallet these settings refer to",type:"integer"},token_id:{description:"Foreign key to token these settings refer to",type:"integer"},allow_negative:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be negative",default:!1,type:"boolean"},allow_positive:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be positive. Used for token balance to deny positive balance.",default:!0,type:"boolean"},created_at:{description:"Datetime when the token was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when the token was last updated",type:"string",format:"date-time"},dtw_to:{description:"Bitmap indicating default what types of transfers can originate from wallet",default:"110",type:"string",maxLength:255,minLength:1},dtw_from:{description:"Bitmap indicating default what types of transfers can end to wallet",default:"011",type:"string",maxLength:255,minLength:1}},JP=!1,XP=["id"],jh={$schema:LP,$id:VP,title:HP,description:zP,type:KP,properties:QP,additionalProperties:JP,required:XP};var YP="http://json-schema.org/draft-07/schema",ZP="WapiSettingTableInput",e0="WapiSettingTableInput",t0="Database settings",r0="object",n0={type:{description:"",default:"flag",$ref:"/db/consts.schema.json#/definitions/WapiSettingType"},name:{description:"name of setting. Must be unique",type:"string",maxLength:32,minLength:1},value:{description:"value of setting",type:"string",minLength:1},applied:{description:"is setting applied",default:!1,type:"boolean"}},a0=!1,s0=["name","value"],Ro={$schema:YP,$id:ZP,title:e0,description:t0,type:r0,properties:n0,additionalProperties:a0,required:s0};var i0="http://json-schema.org/draft-07/schema",o0="WapiSettingTable",p0="WapiSettingTable",f0="Database settings",u0="object",d0={id:{description:"System defined primary key",type:"integer"},type:{description:"",default:"flag",$ref:"/db/consts.schema.json#/definitions/WapiSettingType"},name:{description:"name of setting. Must be unique",type:"string",maxLength:32,minLength:1},value:{description:"value of setting",type:"string",minLength:1},applied:{description:"is setting applied",default:!1,type:"boolean"},created_at:{description:"Datetime when the flag was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when the flag was last updated",type:"string",format:"date-time"}},l0=!1,c0={WapiSettingTableAccessibleFields:{$id:"WapiSettingTableAccessibleFields",type:"string",enum:["id","type","name","value","applied"]},WapiSettingTableFields:{$id:"WapiSettingTableFields",type:"string",enum:["id","type","name","value","applied","created_at","updated_at"]},WapiSettingTableStringFields:{$id:"WapiSettingTableStringFields",type:"string",enum:["type","name","value","created_at","updated_at"]},WapiSettingTableNumberFields:{$id:"WapiSettingTableNumberFields",type:"string",enum:["id"]},WapiSettingTableBooleanFields:{$id:"WapiSettingTableBooleanFields",type:"string",enum:["applied"]}},m0=["id","type","name","value","applied","created_at","updated_at"],Ao={$schema:i0,$id:o0,title:p0,description:f0,type:u0,properties:d0,additionalProperties:l0,definitions:c0,required:m0};var h0="http://json-schema.org/draft-07/schema",g0="WapiSettingTableOptional",_0="WapiSettingTableOptional",T0="Database settings Only require id, other fields are optional",y0="object",b0={id:{description:"System defined primary key",type:"integer"},type:{description:"",default:"flag",$ref:"/db/consts.schema.json#/definitions/WapiSettingType"},name:{description:"name of setting. Must be unique",type:"string",maxLength:32,minLength:1},value:{description:"value of setting",type:"string",minLength:1},applied:{description:"is setting applied",default:!1,type:"boolean"},created_at:{description:"Datetime when the flag was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when the flag was last updated",type:"string",format:"date-time"}},x0=!1,F0=["id"],Ih={$schema:h0,$id:g0,title:_0,description:T0,type:y0,properties:b0,additionalProperties:x0,required:F0};var w0="http://json-schema.org/draft-07/schema",$0="AggregateTransfersFnInput",O0="AggregateTransfersFnInput",v0="Input for aggregateTransfers",j0="object",I0={wallet:{description:"Foreign of the wallet connected to transfers",type:["string","integer"]},token:{description:"Foreign of the token transferred",type:["string","integer"]},from_wallet:{description:"Foreign of the wallet transfers are made from",type:["string","integer"]},to_wallet:{description:"Foreign of the wallet transfers are made to",type:["string","integer"]},transfer_group:{description:"Foreign of the transfer_group the transfers are a part of",type:["string","integer"]},status:{description:"Status of the transfers",$ref:"/db/transfer/transfer.schema.input.json#/properties/status"},metadata:{description:"Metadata filter",$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"},aggregators:{type:"array",items:{$ref:"/txs/aggregate-transfer-many/aggregate-transfer-many.schema.input.json#/definitions/aggregate_transfer_many_aggregator"}},groups:{$ref:"/txs/aggregate-transfer-many/aggregate-transfer-many.schema.input.json#/definitions/aggregate_transfer_many_groups"},options:{$ref:"#/definitions/aggregate_transfers_fn_options"}},k0={aggregate_transfers_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/aggregate-transfer-many/aggregate-transfer-many.schema.input.json#/definitions/aggregate_transfer_many_tx_options"}]}},S0=!1,C0=!0,Uo={$schema:w0,$id:$0,title:O0,description:v0,type:j0,properties:I0,definitions:k0,additionalProperties:S0,$aggregateQueryBuilder:C0};var P0="http://json-schema.org/draft-07/schema",G0="AggregateTransfersFnOutput",D0="AggregateTransfersFnOutput",M0="Output of aggregateTransfers",W0="object",E0="/txs/aggregate-transfer-many/aggregate-transfer-many.schema.output.json",qo={$schema:P0,$id:G0,title:D0,description:M0,type:W0,$ref:E0};var R0="http://json-schema.org/draft-07/schema",A0="CreateAccessTokenFnInput",U0="CreateAccessTokenFnInput",q0="Input for createAccessToken",N0="object",B0={token:{anyOf:[{$ref:"/txs/create-access-token/create-access-token.schema.input.json#/definitions/create_access_token_limited"},{$ref:"/txs/create-access-token/create-access-token.schema.input.json#/definitions/create_access_token_admin"}]},options:{$ref:"#/definitions/create_access_token_fn_options"}},L0={create_access_token_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/create-access-token/create-access-token.schema.input.json#/definitions/create_access_token_tx_options"}]}},V0=!1,No={$schema:R0,$id:A0,title:U0,description:q0,type:N0,properties:B0,definitions:L0,additionalProperties:V0};var H0="http://json-schema.org/draft-07/schema",z0="CreateAccessTokenFnOutput",K0="CreateAccessTokenFnOutput",Q0="Output of createAccessToken",J0="object",X0="/txs/create-access-token/create-access-token.schema.output.json",Bo={$schema:H0,$id:z0,title:K0,description:Q0,type:J0,$ref:X0};var Y0="http://json-schema.org/draft-07/schema",Z0="CreateContractFnInput",eG="CreateContractFnInput",tG="Input for createContract",rG="object",nG=[{$ref:"#/definitions/create_contract_input"},{type:"object",properties:{options:{$ref:"#/definitions/create_contract_fn_options"}},$typescript:'{"additionalProperties": false}'}],aG={create_contract_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/create-contract/create-contract.schema.input.json#/definitions/create_contract_tx_options"}],$typescript:'{"additionalProperties": false}'},create_contract_input:{type:"object",properties:{foreign:{description:"Unique foreign of the created Contract",type:["string","integer"]},metadata:{allOf:[{$ref:"/db/token/token.schema.input.json#/properties/metadata"}]},value_token:{description:"Foreign of the token this contract is valued in",type:["string","integer"]},value_amount:{description:"Amount of value this Contract has",type:"number"},owner:{description:"Foreign of the wallet this contract should initially belong to",type:["string","integer"]},buyer:{allOf:[{$ref:"#/definitions/create_contract_buyer_input"}]}},required:["foreign","value_amount","value_token"],$typescript:'{"additionalProperties": false}'},create_contract_buyer_input:{type:"object",properties:{wallet:{description:"Foreign of the wallet buying this contract",type:["string","integer"]},token:{description:"Foreign of the token buyer will buy with, defaults to Contract value token",type:["string","integer"]},amount:{description:"Amount the buyer will pay, defaults to contract value amount",type:"number"},metadata:{allOf:[{$ref:"/db/token/token.schema.input.json#/properties/metadata"}]},latest_control_hash:{description:"Latest control_hash on the buyer wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]}},required:["wallet"],additionalProperties:!1}},sG='{"additionalProperties": false}',Lo={$schema:Y0,$id:Z0,title:eG,description:tG,type:rG,allOf:nG,definitions:aG,$typescript:sG};var iG="http://json-schema.org/draft-07/schema",oG="CreateContractFnOutput",pG="CreateContractFnOutput",fG="Output of createContract",uG="object",dG="/txs/create-contract/create-contract.schema.output.json",Vo={$schema:iG,$id:oG,title:pG,description:fG,type:uG,$ref:dG};var lG="http://json-schema.org/draft-07/schema",cG="CreateDepositFnInput",mG="CreateDepositFnInput",hG="Input for createDeposit",gG="object",_G=[{$ref:"#/definitions/create_deposit_input"},{type:"object",properties:{options:{$ref:"#/definitions/create_deposit_fn_options"}},$typescript:'{"additionalProperties": false}'}],TG={create_deposit_fn_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/create_deposit_fn_additional_options"}]},create_deposit_fn_additional_options:{type:"object",properties:{return_balance:{description:"return balance after deposit",type:"boolean",default:!1},create_wallet_if_not_exists:{type:"boolean",description:"If true then the wallet will be created if not found. Only valid with 'foreign'",default:!1}},$typescript:'{"additionalProperties": false}'},create_deposit_input:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Id of the token to deposit as",type:["string","integer"]},wallet:{description:"Id of the wallet to deposit to",type:["string","integer"]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},status:{description:"status of the deposit",enum:["pending","finished"],default:"finished"},transfer_group:{description:"Id of the transfer_group this deposit is linked to",type:["string"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["wallet","amount"],$typescript:'{"additionalProperties": false}'}},yG='{"additionalProperties": false}',Ho={$schema:lG,$id:cG,title:mG,description:hG,type:gG,allOf:_G,definitions:TG,$typescript:yG};var bG="http://json-schema.org/draft-07/schema",xG="CreateDepositFnOutput",FG="CreateDepositFnOutput",wG="Output of deposit",$G="/txs/create-deposit/create-deposit.schema.output.json",zo={$schema:bG,$id:xG,title:FG,description:wG,$ref:$G};var OG="http://json-schema.org/draft-07/schema",vG="CreateExchangeFnInput",jG="CreateExchangeFnInput",IG="Input for createExchange",kG="object",SG={identifier:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/identifier"},from_identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},from_wallet:{description:"Foreign of Wallet where from_token is debited from/to_token is credited to",type:["string","integer"]},from_token:{description:"Foreign of Token that is transferred from->to",type:["string","integer"]},from_amount:{description:"Amount of from_token transferred",$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},to_identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},to_wallet:{description:"Foreign of Wallet where from_token is credited to/to_token is debited from. If not specified then to_token.belongs_to is used",type:["string","integer"]},to_token:{description:"Foreign of Token that is transferred to->from",type:["string","integer"]},to_amount:{description:"Amount of to_token transferred. If not specified then from_amount is used",$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},status:{description:"The state at which the exchange is created",type:"string",enum:["pending","finished"]},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},options:{$ref:"#/definitions/create_exchange_fn_options"}},CG=["from_wallet","from_token","from_amount","to_token","to_wallet"],PG={create_exchange_fn_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/create_exchange_additional_options"}]},exchange_data:{type:"object",properties:{identifier:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/identifier"},from_identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},from_latest_control_hash:{description:"Latest control_hash on the from_wallet+from_token combo. Not required if no from_wallet specified",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},from_wallet:{description:"Wallet where from_token is debited from/to_token is credited to. If not specified then from_token.belongs_to is used",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},from_token:{description:"Token that is transferred from->to",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},from_amount:{description:"Amount of from_token transferred",$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},to_identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},to_latest_control_hash:{description:"Latest control_hash on the to_wallet+to_token combo. Not required if no to_wallet specified",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},to_wallet:{description:"Wallet where from_token is credited to/to_token is debited from. If not specified then to_token.belongs_to is used",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_token:{description:"Token that is transferred to->from",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},to_amount:{description:"Amount of to_token transferred. If not specified then from_amount is used",$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},status:{description:"The state at which the exchange is created",type:"string",enum:["pending","finished"]},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"}},additionalProperties:!1},create_exchange_additional_options:{description:"Optional flags for input",type:"object",default:{},$typescript:'{"additionalProperties":false}'}},GG=!1,Ko={$schema:OG,$id:vG,title:jG,description:IG,type:kG,properties:SG,required:CG,definitions:PG,additionalProperties:GG};var DG="http://json-schema.org/draft-07/schema",MG="CreateExchangeFnOutput",WG="CreateExchangeFnOutput",EG="Output of createExchange",RG=[{$ref:"/txs/create-transfer-group/create-transfer-group.schema.output.json"}],Qo={$schema:DG,$id:MG,title:WG,description:EG,allOf:RG};var AG="http://json-schema.org/draft-07/schema",UG="CreateTokenFnInput",qG="CreateTokenFnInput",NG="Input for createToken",BG=[{$ref:"#/definitions/create_token_fn_input_data"},{$ref:"#/definitions/create_token_fn_options_property"}],LG={create_token_fn_options:{allOf:[{$ref:"/txs/create-token/create-token.schema.input.json#/definitions/create_token_tx_options"}]},create_token_fn_options_property:{type:"object",properties:{options:{$ref:"#/definitions/create_token_fn_options"}},$typescript:'{"additionalProperties": false}'},create_token_fn_input_data:{type:"object",properties:{foreign:{$ref:"/db/token/token.schema.input.json#/properties/foreign"},public:{$ref:"/db/token/token.schema.input.json#/properties/public"},metadata:{$ref:"/db/token/token.schema.input.json#/properties/metadata"},divisor:{$ref:"/db/token/token.schema.input.json#/properties/divisor"},limit:{$ref:"/db/token/token.schema.input.json#/properties/limit"},belongs_to:{description:"Id of the wallet this token belongs_to",type:["string","integer"]}},required:["foreign"],$typescript:'{"additionalProperties": false}'}},VG='{"additionalProperties": false}',Jo={$schema:AG,$id:UG,title:qG,description:NG,allOf:BG,definitions:LG,$typescript:VG};var HG="http://json-schema.org/draft-07/schema",zG="CreateTokenFnOutput",KG="CreateTokenFnOutput",QG="Output of createToken",JG="/txs/create-token/create-token.schema.output.json",Xo={$schema:HG,$id:zG,title:KG,description:QG,$ref:JG};var XG="http://json-schema.org/draft-07/schema",YG="CreateTransferFnInput",ZG="CreateTransferFnInput",eD="Input for transfer",tD=[{$ref:"#/definitions/create_transfer_input"},{$ref:"#/definitions/create_transfer_withdrawal_input"},{$ref:"#/definitions/create_transfer_deposit_input"}],rD={create_transfer_fn_options:{$comment:"Using allOf so that references dont break",type:"object",allOf:[{$ref:"/txs/create-transfer/create-transfer.schema.input.json#/definitions/create_transfer_tx_options"}]},create_transfer_fn_options_property:{type:"object",properties:{options:{$ref:"#/definitions/create_transfer_fn_options"}},$typescript:'{"additionalProperties": false}'},create_transfer_input:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Foreign of the token to transfer as",type:["string","integer"]},from_wallet:{description:"Foreign of the wallet to deposit to",type:["string","integer"]},to_wallet:{description:"Foreign of the wallet to deposit to",type:["string","integer"]},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},type:{type:"string",enum:["transfer"]},status:{description:"status of the transfer",enum:["pending","finished"],default:"finished"},transfer_group:{description:"Id of the transfer_group this transfer is linked to",type:["string"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"},options:{$ref:"#/definitions/create_transfer_fn_options"}},required:["from_wallet","to_wallet","amount"],$typescript:'{"additionalProperties": false}'},create_transfer_withdrawal_input:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Foreign of the token to transfer as",type:["string","integer"]},wallet:{description:"Foreign of the wallet to withdraw from",type:["string","integer"]},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},type:{type:"string",enum:["withdrawal"]},status:{description:"status of the transfer",enum:["pending","finished"],default:"finished"},transfer_group:{description:"Id of the transfer_group this transfer is linked to",type:["string"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"},options:{$ref:"#/definitions/create_transfer_fn_options"}},required:["wallet","amount","type"],$typescript:'{"additionalProperties": false}'},create_transfer_deposit_input:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Foreign of the token to transfer as",type:["string","integer"]},wallet:{description:"Foreign of the wallet to deposit to",type:["string","integer"]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},type:{type:"string",enum:["deposit"]},status:{description:"status of the transfer",enum:["pending","finished"],default:"finished"},transfer_group:{description:"Id of the transfer_group this transfer is linked to",type:["string"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"},options:{$ref:"#/definitions/create_transfer_fn_options"}},required:["wallet","amount","type"],$typescript:'{"additionalProperties": false}'},create_transfer_wild_input:{anyOf:[{$ref:"#/definitions/create_transfer_input"},{$ref:"#/definitions/create_transfer_withdrawal_input"},{$ref:"#/definitions/create_transfer_deposit_input"}]}},nD='{"additionalProperties": false}',Yo={$schema:XG,$id:YG,title:ZG,description:eD,oneOf:tD,definitions:rD,$typescript:nD};var aD="http://json-schema.org/draft-07/schema",sD="CreateTransferFnOutput",iD="CreateTransferFnOutput",oD="Output of transfer",pD="/txs/create-transfer/create-transfer.schema.output.json",Zo={$schema:aD,$id:sD,title:iD,description:oD,$ref:pD};var fD="http://json-schema.org/draft-07/schema",uD="CreateTransferGroupFnInput",dD="CreateTransferGroupFnInput",lD="Input for createTransferGroup",cD="object",mD=[{$ref:"#/definitions/create_transfer_group_fn_input_data"},{$ref:"#/definitions/create_transfer_group_fn_options_property"}],hD={create_transfer_group_fn_options:{$comment:"Using allOf, because otherwise references break",type:"object",allOf:[{$ref:"/txs/create-transfer-group/create-transfer-group.schema.input.json#/definitions/create_transfer_group_tx_options"}]},create_transfer_group_fn_options_property:{type:"object",properties:{options:{$ref:"#/definitions/create_transfer_group_fn_options"}},$typescript:'{"additionalProperties": false}'},create_transfer_group_fn_input_data:{type:"object",properties:{identifier:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/identifier"},status:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/status"},transfer_status:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/transfer_status"},metadata:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/metadata"},children:{description:"Array of children",type:"array",items:{$ref:"#/definitions/child_transfer_data_fn"}}},$typescript:'{"additionalProperties": false}'},child_transfer_data_fn:{anyOf:[{$ref:"#/definitions/child_transfer_data_regular_fn"},{$ref:"#/definitions/child_transfer_data_withdrawal_fn"},{$ref:"#/definitions/child_transfer_data_deposit_fn"}]},child_transfer_data_regular_fn:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Foreign of the token to transfer as",type:["string","integer"]},from_wallet:{description:"Foreign of the wallet to deposit to",type:["string","integer"]},to_wallet:{description:"Foreign of the wallet to deposit to",type:["string","integer"]},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},type:{type:"string",enum:["transfer"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["from_wallet","to_wallet","amount"],$typescript:'{"additionalProperties": false}'},child_transfer_data_withdrawal_fn:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Foreign of the token to transfer as",type:["string","integer"]},wallet:{description:"Foreign of the wallet to withdraw from",type:["string","integer"]},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},type:{type:"string",enum:["withdrawal"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["wallet","amount","type"],$typescript:'{"additionalProperties": false}'},child_transfer_data_deposit_fn:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Foreign of the token to transfer as",type:["string","integer"]},wallet:{description:"Foreign of the wallet to deposit to",type:["string","integer"]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},type:{type:"string",enum:["deposit"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["wallet","amount","type"],$typescript:'{"additionalProperties": false}'}},gD='{"additionalProperties": false}',ep={$schema:fD,$id:uD,title:dD,description:lD,type:cD,allOf:mD,definitions:hD,$typescript:gD};var _D="http://json-schema.org/draft-07/schema",TD="CreateTransferGroupFnOutput",yD="CreateTransferGroupFnOutput",bD="Output of createTransferGroup",xD="object",FD="/txs/create-transfer-group/create-transfer-group.schema.output.json",tp={$schema:_D,$id:TD,title:yD,description:bD,type:xD,$ref:FD};var wD="http://json-schema.org/draft-07/schema",$D="CreateTransfersFnInput",OD="CreateTransfersFnInput",vD="Input for createTransfers",jD="object",ID={transfers:{type:"array",minItems:1,items:{$ref:"/fns/create-transfer/create-transfer.schema.input.json#/definitions/create_transfer_wild_input"}},options:{$ref:"#/definitions/create_transfers_fn_options"}},kD={create_transfers_fn_options:{allOf:[{$ref:"/txs/create-transfer-many/create-transfer-many.schema.input.json#/definitions/create_transfer_many_tx_options"}]}},SD=["transfers"],CD=!1,rp={$schema:wD,$id:$D,title:OD,description:vD,type:jD,properties:ID,definitions:kD,required:SD,additionalProperties:CD};var PD="http://json-schema.org/draft-07/schema",GD="CreateTransfersFnOutput",DD="CreateTransfersFnOutput",MD="Output of createTransfers",WD="/txs/create-transfer-many/create-transfer-many.schema.output.json",np={$schema:PD,$id:GD,title:DD,description:MD,$ref:WD};var ED="http://json-schema.org/draft-07/schema",RD="CreateWalletFnInput",AD="CreateWalletFnInput",UD="Input for createWallet",qD="object",ND=[{$ref:"#/definitions/create_wallet_fn_input_data"},{$ref:"#/definitions/create_wallet_fn_options_property"}],BD={create_wallet_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/create-wallet/create-wallet.schema.input.json#/definitions/create_wallet_tx_options"}]},create_wallet_fn_options_property:{type:"object",properties:{options:{$ref:"#/definitions/create_wallet_fn_options"}},$typescript:'{"additionalProperties": false}'},create_wallet_fn_input_data:{type:"object",properties:{foreign:{$ref:"/db/wallet/wallet.schema.input.json#/properties/foreign"},name:{$ref:"/db/wallet/wallet.schema.input.json#/properties/name"},metadata:{$ref:"/db/wallet/wallet.schema.input.json#/properties/metadata"},status:{$ref:"/db/wallet/wallet.schema.input.json#/properties/status"}},required:["foreign"],$typescript:'{"additionalProperties": false}'}},LD='{"additionalProperties": false}',ap={$schema:ED,$id:RD,title:AD,description:UD,type:qD,allOf:ND,definitions:BD,$typescript:LD};var VD="http://json-schema.org/draft-07/schema",HD="CreateWalletFnOutput",zD="CreateWalletFnOutput",KD="Output of createWallet",QD="object",JD="/txs/create-wallet/create-wallet.schema.output.json",sp={$schema:VD,$id:HD,title:zD,description:KD,type:QD,$ref:JD};var XD="http://json-schema.org/draft-07/schema",YD="CreateWithdrawalFnInput",ZD="CreateWithdrawalFnInput",eM="Input for withdraw",tM="object",rM=[{$ref:"#/definitions/create_withdrawal_input"},{type:"object",properties:{options:{$ref:"#/definitions/create_withdrawal_fn_options"}},$typescript:'{"additionalProperties": false}'}],nM={create_withdrawal_fn_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/create_withdrawal_fn_additional_options"}]},create_withdrawal_fn_additional_options:{type:"object",properties:{return_balance:{description:"Return balance after withdrawal",type:"boolean"}},default:{},$typescript:'{"additionalProperties": false}'},create_withdrawal_input:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Foreign of the token to deposit as",type:["string","integer"]},wallet:{description:"Foreign of the wallet to deposit to",type:["string","integer"]},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},status:{description:"status of the withdrawal",enum:["pending","finished"],default:"finished"},transfer_group:{description:"Id of the transfer_group this withdrawal is linked to",type:["string"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["wallet","amount"],$typescript:'{"additionalProperties": false}'}},aM='{"additionalProperties": false}',ip={$schema:XD,$id:YD,title:ZD,description:eM,type:tM,allOf:rM,definitions:nM,$typescript:aM};var sM="http://json-schema.org/draft-07/schema",iM="CreateWithdrawalFnOutput",oM="CreateWithdrawalFnOutput",pM="Output of withdraw",fM="/txs/create-withdrawal/create-withdrawal.schema.output.json",op={$schema:sM,$id:iM,title:oM,description:pM,$ref:fM};var uM="http://json-schema.org/draft-07/schema",dM="FindBalancesFnInput",lM="FindBalancesFnInput",cM="Input for findBalances",mM="object",hM={token:{description:"Id of the token to get balance",type:["string","integer"]},wallet:{description:"Id of the wallet to get balance from",type:["string","integer"]},options:{$ref:"#/definitions/find_balances_fn_options"}},gM={find_balances_fn_options:{description:"findBalances function options",allOf:[{$ref:"/fns/fn-consts.schema.json#/definitions/i_fn_find_options_extra"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"/txs/find-balance-many/find-balance-many.schema.input.json#/definitions/find_balance_many_ordering_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_select_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_deselect_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_options"}]}},_M=!0,TM=!1,pp={$schema:uM,$id:dM,title:lM,description:cM,type:mM,properties:hM,definitions:gM,$queryBuilder:_M,additionalProperties:TM};var yM="http://json-schema.org/draft-07/schema",bM="FindBalancesFnOutput",xM="FindBalancesFnOutput",FM="Output of findBalances",wM="object",$M="/txs/find-balance-many/find-balance-many.schema.output.json",fp={$schema:yM,$id:bM,title:xM,description:FM,type:wM,$ref:$M};var OM="http://json-schema.org/draft-07/schema",vM="FindTokensFnInput",jM="FindTokensFnInput",IM="Input for findTokens",kM="object",SM={foreign:{description:"Foreign of the token",type:["string","integer"]},type:{$ref:"/db/token/token.schema.json#/properties/type"},belongs_to:{description:"Foreign of the wallet connected to token",type:["string","integer"]},metadata:{description:"Metadata filter",$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"},options:{$ref:"#/definitions/find_tokens_fn_options"}},CM={find_tokens_fn_options:{description:"findtokens function options",allOf:[{$ref:"/fns/fn-consts.schema.json#/definitions/i_fn_find_options_extra"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"/txs/find-token-many/find-token-many.schema.input.json#/definitions/find_token_many_ordering_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_select_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_deselect_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_options"}]}},PM=!0,GM=!1,up={$schema:OM,$id:vM,title:jM,description:IM,type:kM,properties:SM,definitions:CM,$queryBuilder:PM,additionalProperties:GM};var DM="http://json-schema.org/draft-07/schema",MM="FindTokensFnOutput",WM="FindTokensFnOutput",EM="Output of findTokens",RM="object",AM="/txs/find-token-many/find-token-many.schema.output.json",dp={$schema:DM,$id:MM,title:WM,description:EM,type:RM,$ref:AM};var UM="http://json-schema.org/draft-07/schema",qM="FindTransferGroupsFnInput",NM="FindTransferGroupsFnInput",BM="Input for findTransferGroups",LM="object",VM={identifier:{description:"Identifier of the transfer_group",type:["string","integer"]},transfer_status:{description:"Status of the transfers",$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/transfer_status"},status:{description:"Status of the transfer_group",$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/status"},metadata:{description:"Metadata filter",$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"},reverses:{description:"Identifier of the transfer_group the transfer_group reverses",type:["string","integer"]},type:{description:"Type of the transfer group",$ref:"/db/consts.schema.json#/definitions/TransferGroupType"},options:{$ref:"#/definitions/find_transfer_groups_fn_options"}},HM={find_transfer_groups_fn_options:{description:"findTransferGroups function options",allOf:[{$ref:"/fns/fn-consts.schema.json#/definitions/i_fn_find_options_extra"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"/txs/find-transfer-group-many/find-transfer-group-many.schema.input.json#/definitions/find_transfer_group_many_ordering_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/find_transfer_groups_fn_extra_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_select_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_deselect_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_options"}]},find_transfer_groups_fn_extra_options:{description:"simplified options for findTransferGroups",type:"object",properties:{},$typescript:'{"additionalProperties":false}'}},zM=!0,KM=!1,lp={$schema:UM,$id:qM,title:NM,description:BM,type:LM,properties:VM,definitions:HM,$queryBuilder:zM,additionalProperties:KM};var QM="http://json-schema.org/draft-07/schema",JM="FindTransferGroupsFnOutput",XM="FindTransferGroupsFnOutput",YM="Output of findTransferGroups",ZM="object",eW="/txs/find-transfer-group-many/find-transfer-group-many.schema.output.json",cp={$schema:QM,$id:JM,title:XM,description:YM,type:ZM,$ref:eW};var tW="http://json-schema.org/draft-07/schema",rW="FindTransfersFnInput",nW="FindTransfersFnInput",aW="Input for findTransfers",sW="object",iW={wallet:{description:"Foreign of the wallet connected to transfers",type:["string","integer"]},token:{description:"Foreign of the token transferred",type:["string","integer"]},from_wallet:{description:"Foreign of the wallet transfers are made from",type:["string","integer"]},to_wallet:{description:"Foreign of the wallet transfers are made to",type:["string","integer"]},transfer_group:{description:"Foreign of the transfer_group the transfers are a part of",type:["string","integer"]},status:{description:"Status of the transfers",$ref:"/db/transfer/transfer.schema.input.json#/properties/status"},metadata:{description:"Metadata filter",$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"},options:{$ref:"#/definitions/find_transfers_fn_options"}},oW={find_transfers_fn_options:{description:"findTransfers function options",allOf:[{$ref:"/fns/fn-consts.schema.json#/definitions/i_fn_find_options_extra"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"/txs/find-transfer-many/find-transfer-many.schema.input.json#/definitions/find_transfer_many_ordering_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/find_transfers_fn_extra_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_select_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_deselect_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_options"}]},find_transfers_fn_extra_options:{description:"simplified options for findTransfers",type:"object",properties:{return_running_balance:{description:"return running balance for specified wallet under filter",type:"boolean"},return_signed_amount:{description:"return running balance for specified wallet under filter",type:"boolean"},return_running_balance_for_wallet:{description:"foreign key for which wallet should running balance be returned for",type:["string","integer"]},return_signed_amount_for_wallet:{description:"foreign key for which wallet should signed amounts be returned for",type:["string","integer"]}},$typescript:'{"additionalProperties":false}'}},pW=!0,fW=!1,mp={$schema:tW,$id:rW,title:nW,description:aW,type:sW,properties:iW,definitions:oW,$queryBuilder:pW,additionalProperties:fW};var uW="http://json-schema.org/draft-07/schema",dW="FindTransfersFnOutput",lW="FindTransfersFnOutput",cW="Output of findTransfers",mW="object",hW="/txs/find-transfer-many/find-transfer-many.schema.output.json",hp={$schema:uW,$id:dW,title:lW,description:cW,type:mW,$ref:hW};var gW="http://json-schema.org/draft-07/schema",_W="FindWalletsFnInput",TW="FindWalletsFnInput",yW="Input for findWallets",bW="object",xW={foreign:{$ref:"/db/wallet/wallet.schema.json#/properties/foreign"},name:{$ref:"/db/wallet/wallet.schema.json#/properties/name"},type:{$ref:"/db/wallet/wallet.schema.json#/properties/type"},status:{$ref:"/db/wallet/wallet.schema.json#/properties/status"},metadata:{description:"Metadata filter",$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"},options:{$ref:"#/definitions/find_wallets_fn_options"}},FW={find_wallets_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/fns/fn-consts.schema.json#/definitions/i_fn_find_options_extra"},{$ref:"/txs/find-wallet-many/find-wallet-many.schema.input.json#/definitions/find_wallet_many_tx_options"},{$ref:"#/definitions/find_wallets_fn_extra_options"}]},find_wallets_fn_extra_options:{type:"object",properties:{include_balance_for_token:{description:"Foreign of token to include balance for",type:["string","number"]}},$typescript:'{"additionalProperties":false}'}},wW=!0,$W=!1,gp={$schema:gW,$id:_W,title:TW,description:yW,type:bW,properties:xW,definitions:FW,$queryBuilder:wW,additionalProperties:$W};var OW="http://json-schema.org/draft-07/schema",vW="FindWalletsFnOutput",jW="FindWalletsFnOutput",IW="Output of findWallets",kW="object",SW="/txs/find-wallet-many/find-wallet-many.schema.output.json",_p={$schema:OW,$id:vW,title:jW,description:IW,type:kW,$ref:SW};var CW="http://json-schema.org/draft-07/schema",PW="FnConsts",GW="Generics used by functions",DW={i_fn_find_options:{description:"extended find options for client functions",allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_ordering_options"},{$ref:"#/definitions/i_fn_find_options_extra"}]},i_fn_find_options_extra:{description:"extra find options for client functions",$typescript:'{"additionalProperties":false}',type:"object",properties:{order_by:{description:"Ordering options in string format",type:"string"}}}},yp={$schema:CW,$id:PW,description:GW,definitions:DW};var MW="http://json-schema.org/draft-07/schema",WW="GetBalanceFnInput",EW="GetBalanceFnInput",RW="Input for Getbalance",AW="object",UW={token:{description:"Id of the token to get balance",type:["string","integer"]},wallet:{description:"Id of the wallet to get balance from",type:["string","integer"]},datetime:{description:"Date and time this balance should be got",type:"string"},options:{$ref:"#/definitions/get_balance_fn_options"}},qW={get_balance_fn_options:{allOf:[{$ref:"/txs/get-balance/get-balance.schema.input.json#/definitions/get_balance_tx_options"}]}},NW=["wallet"],BW=!1,bp={$schema:MW,$id:WW,title:EW,description:RW,type:AW,properties:UW,definitions:qW,required:NW,additionalProperties:BW};var LW="http://json-schema.org/draft-07/schema",VW="GetBalanceFnOutput",HW="GetBalanceFnOutput",zW="Output of balance",KW="object",QW="/txs/get-balance/get-balance.schema.output.json",xp={$schema:LW,$id:VW,title:HW,description:zW,type:KW,$ref:QW};var JW="http://json-schema.org/draft-07/schema",XW="GetBalanceHistoryFnInput",YW="GetBalanceHistoryFnInput",ZW="Input for getBalanceHistory",eE="object",tE={token:{description:"Id of the token to get balance",type:["string","integer"]},wallet:{description:"Id of the wallet to get balance from",type:["string","integer"]},options:{$ref:"#/definitions/get_balance_history_fn_options"}},rE={get_balance_history_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/get-balance-history/get-balance-history.schema.input.json#/definitions/get_balance_history_tx_options"}]}},nE=["wallet"],aE=!1,Fp={$schema:JW,$id:XW,title:YW,description:ZW,type:eE,properties:tE,definitions:rE,required:nE,additionalProperties:aE};var sE="http://json-schema.org/draft-07/schema",iE="GetBalanceHistoryFnOutput",oE="GetBalanceHistoryFnOutput",pE="Output of getBalanceHistory",fE="object",uE="/txs/get-balance-history/get-balance-history.schema.output.json",wp={$schema:sE,$id:iE,title:oE,description:pE,type:fE,$ref:uE};var dE="http://json-schema.org/draft-07/schema",lE="GetFlagsFnInput",cE="GetFlagsFnInput",mE="Input for getFlags",hE="object",gE={options:{$ref:"#/definitions/get_flags_fn_options"}},_E={},TE={get_flags_fn_options:{allOf:[{$ref:"/txs/get-flags/get-flags.schema.input.json#/definitions/get_flags_tx_options"}]}},yE=!1,$p={$schema:dE,$id:lE,title:cE,description:mE,type:hE,properties:gE,default:_E,definitions:TE,additionalProperties:yE};var bE="http://json-schema.org/draft-07/schema",xE="GetFlagsFnOutput",FE="GetFlagsFnOutput",wE="Output of getFlags",$E="/txs/get-flags/get-flags.schema.output.json",Op={$schema:bE,$id:xE,title:FE,description:wE,$ref:$E};var OE="http://json-schema.org/draft-07/schema",vE="GetStatisticsFnInput",jE="GetStatisticsFnInput",IE="Input for getStatistics",kE="object",SE={model:{$ref:"/txs/get-statistics/get-statistics.schema.input.json#/definitions/statistics_model"},groups:{$ref:"/txs/get-statistics/get-statistics.schema.input.json#/definitions/statistics_groups"},aggregator:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_aggregator"},filter:{$ref:"/txs/get-statistics/get-statistics.schema.input.json#/definitions/statistics_filter"},options:{$ref:"#/definitions/get_statistics_fn_options"}},CE={get_statistics_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/get-statistics/get-statistics.schema.input.json#/definitions/get_statistics_tx_options"}]}},PE=!1,vp={$schema:OE,$id:vE,title:jE,description:IE,type:kE,properties:SE,definitions:CE,additionalProperties:PE};var GE="http://json-schema.org/draft-07/schema",DE="GetStatisticsFnOutput",ME="GetStatisticsFnOutput",WE="Output of getStatistics",EE="object",RE="/txs/get-statistics/get-statistics.schema.output.json",jp={$schema:GE,$id:DE,title:ME,description:WE,type:EE,$ref:RE};var AE="http://json-schema.org/draft-07/schema",UE="GetTokenFnInput",qE="GetTokenFnInput",NE="Input for getToken",BE="object",LE={foreign:{$ref:"/db/token/token.schema.json#/properties/foreign"},options:{$ref:"#/definitions/get_token_fn_options"}},VE={get_token_fn_options:{allOf:[{$ref:"/txs/get-token/get-token.schema.input.json#/definitions/get_token_tx_options"}]}},HE=!1,Ip={$schema:AE,$id:UE,title:qE,description:NE,type:BE,properties:LE,definitions:VE,additionalProperties:HE};var zE="http://json-schema.org/draft-07/schema",KE="GetTokenFnOutput",QE="GetTokenFnOutput",JE="Output of getToken",XE="/txs/get-token/get-token.schema.output.json",kp={$schema:zE,$id:KE,title:QE,description:JE,$ref:XE};var YE="http://json-schema.org/draft-07/schema",ZE="GetTransferFnInput",eR="GetTransferFnInput",tR="Input for getTransfer",rR="object",nR={transfer:{description:"Transfer identifier",type:["string","integer"]},options:{$ref:"#/definitions/get_transfer_fn_options"}},aR={get_transfer_fn_options:{description:"Optional flags for input",allOf:[{$ref:"/txs/get-transfer/get-transfer.schema.input.json#/definitions/get_transfer_tx_options"}]}},sR=["transfer"],iR=!1,Sp={$schema:YE,$id:ZE,title:eR,description:tR,type:rR,properties:nR,definitions:aR,required:sR,additionalProperties:iR};var oR="http://json-schema.org/draft-07/schema",pR="GetTransferFnOutput",fR="GetTransferFnOutput",uR="Output of getTransfer",dR="object",lR="/txs/get-transfer/get-transfer.schema.output.json",Cp={$schema:oR,$id:pR,title:fR,description:uR,type:dR,$ref:lR};var cR="http://json-schema.org/draft-07/schema",mR="GetTransferGroupFnInput",hR="GetTransferGroupFnInput",gR="Input for getTransferGroup",_R="object",TR={transfer_group:{description:"identifier of the transfer group to reverse",type:["string","number"]},options:{$ref:"#/definitions/get_transfer_group_fn_options"}},yR={get_transfer_group_fn_options:{description:"Optional flags for input",allOf:[{$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/get_transfer_group_tx_options"}]}},bR=["transfer_group"],xR=!1,Pp={$schema:cR,$id:mR,title:hR,description:gR,type:_R,properties:TR,definitions:yR,required:bR,additionalProperties:xR};var FR="http://json-schema.org/draft-07/schema",wR="GetTransferGroupFnOutput",$R="GetTransferGroupFnOutput",OR="Output of getTransferGroup",vR="object",jR="/txs/get-transfer-group/get-transfer-group.schema.output.json",Gp={$schema:FR,$id:wR,title:$R,description:OR,type:vR,$ref:jR};var IR="http://json-schema.org/draft-07/schema",kR="GetWalletFnInput",SR="GetWalletFnInput",CR="Input for getWallet",PR="object",GR={wallet:{description:"Wallet foreign",type:["string","integer"]},options:{$ref:"#/definitions/get_wallet_fn_options"}},DR={get_wallet_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/get_wallet_tx_options"}]}},MR=["wallet"],WR=!1,Dp={$schema:IR,$id:kR,title:SR,description:CR,type:PR,properties:GR,definitions:DR,required:MR,additionalProperties:WR};var ER="http://json-schema.org/draft-07/schema",RR="GetWalletFnOutput",AR="GetWalletFnOutput",UR="Output of getWallet",qR="object",NR="/txs/get-wallet/get-wallet.schema.output.json",Mp={$schema:ER,$id:RR,title:AR,description:UR,type:qR,$ref:NR};var BR="http://json-schema.org/draft-07/schema",LR="ImportDataFnInput",VR="ImportDataFnInput",HR="Input for import",zR="object",KR={actions:{type:"array",items:{$ref:"#/definitions/import_data_fn_stream_chunk"}},options:{$ref:"#/definitions/import_data_fn_options"}},QR={import_data_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/import-actions/import-actions.schema.input.json#/definitions/import_actions_tx_options"}]},import_data_fn_stream_chunk:{type:"object",anyOf:[{$ref:"#/definitions/import_wallet"},{$ref:"#/definitions/import_token"},{$ref:"#/definitions/import_transfer_group"},{$ref:"#/definitions/import_transfer"},{$ref:"#/definitions/import_reverse_transfer"},{$ref:"#/definitions/import_reverse_transfer_group"}]},import_wallet:{type:"object",properties:{target:{description:"Target of the action",type:"string",enum:["wallet"]},data:{allOf:[{$ref:"/fns/create-wallet/create-wallet.schema.input.json#/definitions/create_wallet_fn_input_data"}]}},required:["target","data"],$typescript:'{"additionalProperties": false}'},import_token:{type:"object",properties:{target:{description:"Target of the action",type:"string",enum:["token"]},data:{allOf:[{$ref:"/fns/create-token/create-token.schema.input.json#/definitions/create_token_fn_input_data"}]}},required:["target","data"],$typescript:'{"additionalProperties": false}'},import_transfer_group_extension:{type:"object",properties:{created_at:{type:"string",format:"date-time"},status_finalized_at:{type:"string",format:"date-time"},transfer_status_finalized_at:{type:"string",format:"date-time"}},$typescript:'{"additionalProperties": false}'},import_transfer_group_data:{allOf:[{$ref:"/fns/create-transfer-group/create-transfer-group.schema.input.json#/definitions/create_transfer_group_fn_input_data"},{$ref:"#/definitions/import_transfer_group_extension"}]},import_transfer_group:{type:"object",properties:{target:{description:"Target of the action",type:"string",enum:["transfer_group"]},data:{allOf:[{$ref:"#/definitions/import_transfer_group_data"}]}},required:["target","data"],$typescript:'{"additionalProperties": false}'},import_transfer_extension:{type:"object",properties:{created_at:{type:"string",format:"date-time"},status_finalized_at:{type:"string",format:"date-time"}},$typescript:'{"additionalProperties": false}'},import_transfer_data:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Foreign of the token to transfer as",type:["string","integer"]},from_wallet:{description:"Foreign of the wallet to deposit to",type:["string","integer"]},to_wallet:{description:"Foreign of the wallet to deposit to",type:["string","integer"]},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},type:{type:"string",enum:["transfer"]},status:{description:"status of the transfer",enum:["pending","cancelled","finished"],default:"finished"},transfer_group:{description:"Id of the transfer_group this transfer is linked to",type:["string"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"},status_finalized_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/status_finalized_at"}},required:["from_wallet","to_wallet","amount"],$typescript:'{"additionalProperties": false}'},import_withdrawal_data:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Foreign of the token to transfer as",type:["string","integer"]},wallet:{description:"Foreign of the wallet to withdraw from",type:["string","integer"]},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},type:{type:"string",enum:["withdrawal"]},status:{description:"status of the transfer",enum:["pending","cancelled","finished"],default:"finished"},transfer_group:{description:"Id of the transfer_group this transfer is linked to",type:["string"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"},status_finalized_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/status_finalized_at"}},required:["wallet","amount","type"],$typescript:'{"additionalProperties": false}'},import_deposit_data:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},token:{description:"Foreign of the token to transfer as",type:["string","integer"]},wallet:{description:"Foreign of the wallet to deposit to",type:["string","integer"]},amount:{description:"amount to deposit",type:"number"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},type:{type:"string",enum:["deposit"]},status:{description:"status of the transfer",enum:["pending","cancelled","finished"],default:"finished"},transfer_group:{description:"Id of the transfer_group this transfer is linked to",type:["string"]},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"},status_finalized_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/status_finalized_at"}},required:["wallet","amount","type"],$typescript:'{"additionalProperties": false}'},create_transfer_data_wild:{anyOf:[{$ref:"#/definitions/import_transfer_data"},{$ref:"#/definitions/import_withdrawal_data"},{$ref:"#/definitions/import_deposit_data"}]},import_transfer:{type:"object",properties:{target:{description:"Target of the action",type:"string",enum:["transfer"]},data:{allOf:[{$ref:"#/definitions/create_transfer_data_wild"}]}},required:["target","data"],$typescript:'{"additionalProperties": false}'},import_reverse_transfer_options:{type:"object",properties:{metadata_action:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action"}},$typescript:'{"additionalProperties": false}'},import_reverse_transfer_extension:{type:"object",properties:{options:{allOf:[{$ref:"#/definitions/import_reverse_transfer_options"}]}},$typescript:'{"additionalProperties": false}'},import_reverse_transfer_data:{allOf:[{$ref:"/fns/reverse-transfer/reverse-transfer.schema.input.json#/definitions/reverse_transfer_fn_input_data"},{$ref:"#/definitions/import_reverse_transfer_extension"}]},import_reverse_transfer:{type:"object",properties:{target:{description:"Target of the action",type:"string",enum:["reverse_transfer"]},data:{allOf:[{$ref:"#/definitions/import_reverse_transfer_data"}]}},required:["target","data"],$typescript:'{"additionalProperties": false}'},import_reverse_transfer_group_options:{type:"object",properties:{metadata_action:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action"},transfer_metadata_action:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action"}},$typescript:'{"additionalProperties": false}'},import_reverse_transfer_group_extension:{type:"object",properties:{options:{allOf:[{$ref:"#/definitions/import_reverse_transfer_group_options"}]}},$typescript:'{"additionalProperties": false}'},import_reverse_transfer_group_data:{allOf:[{$ref:"/fns/reverse-transfer-group/reverse-transfer-group.schema.input.json#/definitions/reverse_transfer_group_fn_input_data"},{$ref:"#/definitions/import_reverse_transfer_group_extension"}]},import_reverse_transfer_group:{type:"object",properties:{target:{description:"Target of the action",type:"string",enum:["reverse_transfer_group"]},data:{allOf:[{$ref:"#/definitions/import_reverse_transfer_group_data"}]}},required:["target","data"],$typescript:'{"additionalProperties": false}'}},JR="import_data_fn_stream_chunk",XR=!1,Ss={$schema:BR,$id:LR,title:VR,description:HR,type:zR,properties:KR,definitions:QR,$allowStreamInput:JR,additionalProperties:XR};var YR="http://json-schema.org/draft-07/schema",ZR="ImportDataFnOutput",eA="ImportDataFnOutput",tA="Output of import",rA="object",nA="/txs/import-actions/import-actions.schema.output.json",Wp={$schema:YR,$id:ZR,title:eA,description:tA,type:rA,$ref:nA};var aA="http://json-schema.org/draft-07/schema",sA="ReverseTransferFnInput",iA="ReverseTransferFnInput",oA="Input for reverseTransfer",pA=[{$ref:"#/definitions/reverse_transfer_fn_input_data"},{$ref:"#/definitions/reverse_transfer_fn_options_property"}],fA={reverse_transfer_fn_options:{allOf:[{$ref:"/txs/reverse-transfer/reverse-transfer.schema.input.json#/definitions/reverse_transfer_tx_options"}]},reverse_transfer_fn_options_property:{type:"object",properties:{options:{$ref:"#/definitions/reverse_transfer_fn_options"}},$typescript:'{"additionalProperties": false}'},reverse_transfer_fn_input_data:{type:"object",properties:{transfer:{description:"Transfer identifier",type:["string","integer"]},status:{description:"Status of the created transfer",$ref:"/db/transfer/transfer.schema.input.json#/properties/status"},identifier:{description:"Identifier for the created transfer",$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},force:{description:"Force create the reverse transfer ignoring balance",$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{description:"Metadata for the reversed transfers",$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},extend_metadata:{description:"Key value object to extend metadata with on created transfer",$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/metadata"}},required:["transfer"],$typescript:'{"additionalProperties": false}'}},uA='{"additionalProperties": false}',Ep={$schema:aA,$id:sA,title:iA,description:oA,allOf:pA,definitions:fA,$typescript:uA};var dA="http://json-schema.org/draft-07/schema",lA="ReverseTransferFnOutput",cA="ReverseTransferFnOutput",mA="Output of reverseTransfer",hA="/txs/reverse-transfer/reverse-transfer.schema.output.json",Rp={$schema:dA,$id:lA,title:cA,description:mA,$ref:hA};var gA="http://json-schema.org/draft-07/schema",_A="ReverseTransferGroupFnInput",TA="ReverseTransferGroupFnInput",yA="Input for reverseTransferGroup",bA=[{$ref:"#/definitions/reverse_transfer_group_fn_input_data"},{$ref:"#/definitions/reverse_transfer_group_fn_options_property"}],xA={reverse_transfer_group_fn_options:{allOf:[{$ref:"/txs/reverse-transfer-group/reverse-transfer-group.schema.input.json#/definitions/reverse_transfer_group_tx_options"}]},reverse_transfer_group_fn_options_property:{type:"object",properties:{options:{$ref:"#/definitions/reverse_transfer_group_fn_options"}},$typescript:'{"additionalProperties": false}'},reverse_transfer_group_fn_input_data:{type:"object",properties:{transfer_group:{description:"identifier of the transfer group to reverse",type:["string","number"]},status:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/status"},transfer_status:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/transfer_status"},identifier:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/identifier"},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/metadata"},transfer_metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},extend_metadata:{description:"Key value object to extend metadata with on created transfer",$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/metadata"},transfer_extend_metadata:{description:"Key value object to extend metadata with on created transfer",$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"}},required:["transfer_group"],$typescript:'{"additionalProperties": false}'}},FA='{"additionalProperties": false}',Ap={$schema:gA,$id:_A,title:TA,description:yA,allOf:bA,definitions:xA,$typescript:FA};var wA="http://json-schema.org/draft-07/schema",$A="ReverseTransferGroupFnOutput",OA="ReverseTransferGroupFnOutput",vA="Output of reverseTransferGroup",jA="/txs/reverse-transfer-group/reverse-transfer-group.schema.output.json",Up={$schema:wA,$id:$A,title:OA,description:vA,$ref:jA};var IA="http://json-schema.org/draft-07/schema",kA="ReverseTransfersFnInput",SA="ReverseTransfersFnInput",CA="Input for reverseTransfers",PA="object",GA={wallet:{description:"Foreign of the wallet connected to transfers",type:["string","integer"]},token:{description:"Foreign of the token transferred",type:["string","integer"]},from_wallet:{description:"Foreign of the wallet transfers are made from",type:["string","integer"]},to_wallet:{description:"Foreign of the wallet transfers are made to",type:["string","integer"]},transfer_group:{description:"Foreign of the transfer_group the transfers are a part of",type:["string","integer"]},status:{description:"Status of the transfers",$ref:"/db/transfer/transfer.schema.input.json#/properties/status"},metadata:{description:"Metadata filter",$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"},reverse:{$ref:"/txs/reverse-transfer-many/reverse-transfer-many.schema.input.json#/definitions/reverse_transfer_many_modifications"},options:{$ref:"#/definitions/reverse_transfers_fn_options"}},DA={reverse_transfers_fn_options:{description:"findTransfers function options",allOf:[{$ref:"/txs/reverse-transfer-many/reverse-transfer-many.schema.input.json#/definitions/reverse_transfer_many_tx_options"}]},reverse_transfers_fn_modifications:{description:"In case the transfer will be made then apply these modifications",allOf:[{$ref:"/txs/reverse-transfer-many/reverse-transfer-many.schema.input.json#/definitions/reverse_transfer_many_modifications"}]}},MA=!0,WA=!1,qp={$schema:IA,$id:kA,title:SA,description:CA,type:PA,properties:GA,definitions:DA,$reverseQueryBuilder:MA,additionalProperties:WA};var EA="http://json-schema.org/draft-07/schema",RA="ReverseTransfersFnOutput",AA="ReverseTransfersFnOutput",UA="Output of reverseTransfers",qA="object",NA="/txs/reverse-transfer-many/reverse-transfer-many.schema.output.json",Np={$schema:EA,$id:RA,title:AA,description:UA,type:qA,$ref:NA};var BA="http://json-schema.org/draft-07/schema",LA="SetFlagsFnInput",VA="SetFlagsFnInput",HA="Input for setFlags",zA=[{$ref:"#/definitions/set_flags_properties"}],KA={set_flags_fn_options:{allOf:[{$ref:"/txs/set-flags/set-flags.schema.input.json#/definitions/set_flags_tx_options"}]},set_flags_properties:{allOf:[{$ref:"/db/consts.schema.json#/definitions/Flags"},{$ref:"#/definitions/set_flags_options_property"}]},set_flags_options_property:{type:"object",properties:{options:{$ref:"#/definitions/set_flags_fn_options"}},$typescript:'{"additionalProperties": false}'}},QA='{"additionalProperties": false}',Bp={$schema:BA,$id:LA,title:VA,description:HA,allOf:zA,definitions:KA,$typescript:QA};var JA="http://json-schema.org/draft-07/schema",XA="SetFlagsFnOutput",YA="SetFlagsFnOutput",ZA="Output of setFlags",eU="/txs/set-flags/set-flags.schema.output.json",Lp={$schema:JA,$id:XA,title:YA,description:ZA,$ref:eU};var tU="http://json-schema.org/draft-07/schema",rU="UpdateTokenFnInput",nU="UpdateTokenFnInput",aU="Input for updateToken",sU="object",iU={token:{description:"Token foreign",type:["string","number"]},metadata:{$ref:"/db/token/token.schema.json#/properties/metadata"},public:{$ref:"/db/token/token.schema.json#/properties/public"},status:{$ref:"/db/token/token.schema.json#/properties/status"},options:{$ref:"#/definitions/update_token_fn_options"}},oU={update_token_fn_fields:{description:"Updateable fields",type:"object",allOf:[{$ref:"/txs/update-token/update-token.schema.input.json#/definitions/update_token_fields"}]},update_token_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/update-token/update-token.schema.input.json#/definitions/update_token_tx_options"}]}},pU=!1,fU=["token"],Vp={$schema:tU,$id:rU,title:nU,description:aU,type:sU,properties:iU,definitions:oU,additionalProperties:pU,required:fU};var uU="http://json-schema.org/draft-07/schema",dU="UpdateTokenFnOutput",lU="UpdateTokenFnOutput",cU="Output of updateToken",mU="object",hU="/txs/update-token/update-token.schema.output.json",Hp={$schema:uU,$id:dU,title:lU,description:cU,type:mU,$ref:hU};var gU="http://json-schema.org/draft-07/schema",_U="UpdateTransferFnInput",TU="UpdateTransferFnInput",yU="Input for updateTransfer",bU="object",xU={transfer:{description:"Transfer identifier",type:["string","integer"]},status:{description:"Status the transfer should be set to",enum:["finished","cancelled"]},metadata:{$ref:"/db/transfer/transfer.schema.json#/properties/metadata"},options:{$ref:"#/definitions/update_transfer_fn_options"}},FU={update_transfer_fn_options:{allOf:[{$ref:"/txs/update-transfer/update-transfer.schema.input.json#/definitions/update_transfer_tx_options"}]}},wU=!1,$U=["transfer"],zp={$schema:gU,$id:_U,title:TU,description:yU,type:bU,properties:xU,definitions:FU,additionalProperties:wU,required:$U};var OU="http://json-schema.org/draft-07/schema",vU="UpdateTransferFnOutput",jU="UpdateTransferFnOutput",IU="Output of updateTransfer",kU="object",SU="/txs/update-transfer/update-transfer.schema.output.json",Kp={$schema:OU,$id:vU,title:jU,description:IU,type:kU,$ref:SU};var CU="http://json-schema.org/draft-07/schema",PU="UpdateTransferGroupFnInput",GU="UpdateTransferGroupFnInput",DU="Input for updateTransferGroup",MU=[{$ref:"#/definitions/update_transfer_group_fn_status"},{$ref:"#/definitions/update_transfer_group_fn_transfer_status"}],WU={update_transfer_group_fn_options:{$comment:"Using allOf so that references dont break",type:"object",allOf:[{$ref:"/txs/update-transfer-group/update-transfer-group.schema.input.json#/definitions/update_transfer_group_tx_options"}]},update_transfer_group_fn_status:{type:"object",properties:{transfer_group:{description:"identifier of the transfer group to reverse",type:["string","number"]},status:{description:"Lifecycle status of the TransferGroup",$ref:"/db/consts.schema.json#/definitions/TransferGroupStatus"},transfer_status:{description:"Status all the transfers should be set at.",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},options:{$ref:"#/definitions/update_transfer_group_fn_options"}},required:["transfer_group","status"],$typescript:'{"additionalProperties": false}'},update_transfer_group_fn_transfer_status:{type:"object",properties:{transfer_group:{description:"identifier of the transfer group to reverse",type:["string","number"]},status:{description:"Lifecycle status of the TransferGroup",$ref:"/db/consts.schema.json#/definitions/TransferGroupStatus"},transfer_status:{description:"Status all the transfers should be set at.",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},options:{$ref:"#/definitions/update_transfer_group_fn_options"}},required:["transfer_group","transfer_status"],$typescript:'{"additionalProperties": false}'}},Qp={$schema:CU,$id:PU,title:GU,description:DU,anyOf:MU,definitions:WU};var EU="http://json-schema.org/draft-07/schema",RU="UpdateTransferGroupFnOutput",AU="UpdateTransferGroupFnOutput",UU="Output of updateTransferGroup",qU="object",NU="/txs/update-transfer-group/update-transfer-group.schema.output.json",Jp={$schema:EU,$id:RU,title:AU,description:UU,type:qU,$ref:NU};var BU="http://json-schema.org/draft-07/schema",LU="UpdateTransferGroupsFnInput",VU="UpdateTransferGroupsFnInput",HU="Input for updateTransferGroups",zU="object",KU={transfer_status:{description:"Status of the transfers",$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/transfer_status"},status:{description:"Status of the transfer_group",$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/status"},metadata:{description:"Metadata filter",$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"},reverses:{description:"Identifier of the transfer_group the transfer_group reverses",type:["string","integer"]},type:{description:"Type of the transfer group",$ref:"/db/consts.schema.json#/definitions/TransferGroupType"},update:{$ref:"#/definitions/update_transfer_groups_fn_update_fields"},options:{$ref:"#/definitions/update_transfer_groups_fn_options"}},QU={update_transfer_groups_fn_update_fields:{type:"object",allOf:[{$ref:"/txs/update-transfer-group/update-transfer-group.schema.input.json#/definitions/update_transfer_group_data"}]},update_transfer_groups_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/update-transfer-group/update-transfer-group.schema.input.json#/definitions/update_transfer_group_tx_options"}]}},JU=!0,XU=!1,Xp={$schema:BU,$id:LU,title:VU,description:HU,type:zU,properties:KU,definitions:QU,$updateQueryBuilder:JU,additionalProperties:XU};var YU="http://json-schema.org/draft-07/schema",ZU="UpdateTransferGroupsFnOutput",eq="UpdateTransferGroupsFnOutput",tq="Output of updateTransferGroups",rq="object",nq="/txs/update-transfer-group-many/update-transfer-group-many.schema.output.json",Yp={$schema:YU,$id:ZU,title:eq,description:tq,type:rq,$ref:nq};var aq="http://json-schema.org/draft-07/schema",sq="UpdateTransfersFnInput",iq="UpdateTransfersFnInput",oq="Input for updateTransfers",pq="object",fq={wallet:{description:"Foreign of the wallet connected to transfers",type:["string","integer"]},token:{description:"Foreign of the token transferred",type:["string","integer"]},from_wallet:{description:"Foreign of the wallet transfers are made from",type:["string","integer"]},to_wallet:{description:"Foreign of the wallet transfers are made to",type:["string","integer"]},transfer_group:{description:"Foreign of the transfer_group the transfers are a part of",type:["string","integer"]},status:{description:"Status of the transfers",$ref:"/db/transfer/transfer.schema.input.json#/properties/status"},metadata:{description:"Metadata filter",$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"},update:{$ref:"/txs/update-transfer/update-transfer.schema.input.json#/definitions/update_transfer_fields"},options:{$ref:"#/definitions/update_transfers_fn_options"}},uq={update_transfers_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/update-transfer-many/update-transfer-many.schema.input.json#/definitions/update_transfer_many_tx_options"}]},update_transfers_fn_update_fields:{type:"object",allOf:[{$ref:"/txs/update-transfer/update-transfer.schema.input.json#/definitions/update_transfer_fields"}]}},dq=!0,lq=!1,Zp={$schema:aq,$id:sq,title:iq,description:oq,type:pq,properties:fq,definitions:uq,$updateQueryBuilder:dq,additionalProperties:lq};var cq="http://json-schema.org/draft-07/schema",mq="UpdateTransfersFnOutput",hq="UpdateTransfersFnOutput",gq="Output of updateTransfers",_q="object",Tq="/txs/update-transfer-many/update-transfer-many.schema.output.json",ef={$schema:cq,$id:mq,title:hq,description:gq,type:_q,$ref:Tq};var yq="http://json-schema.org/draft-07/schema",bq="UpdateWalletFnInput",xq="UpdateWalletFnInput",Fq="Input for updateWallet",wq="object",$q={wallet:{description:"Wallet foreign",type:["string","integer"]},metadata:{$ref:"/db/wallet/wallet.schema.json#/properties/metadata"},name:{$ref:"/db/wallet/wallet.schema.input.json#/properties/name"},status:{$ref:"/db/wallet/wallet.schema.input.json#/properties/status"},options:{$ref:"#/definitions/update_wallet_fn_options"}},Oq={update_wallet_fn_fields:{description:"Updatable fields",type:"object",allOf:[{$ref:"/txs/update-wallet/update-wallet.schema.input.json#/definitions/update_wallet_fields"}]},update_wallet_fn_options:{description:"Optional flags for input",type:"object",allOf:[{$ref:"/txs/update-wallet/update-wallet.schema.input.json#/definitions/update_wallet_tx_options"}]}},vq=!1,jq=["wallet"],tf={$schema:yq,$id:bq,title:xq,description:Fq,type:wq,properties:$q,definitions:Oq,additionalProperties:vq,required:jq};var Iq="http://json-schema.org/draft-07/schema",kq="UpdateWalletFnOutput",Sq="UpdateWalletFnOutput",Cq="Output of updateWallet",Pq="object",Gq="/txs/update-wallet/update-wallet.schema.output.json",rf={$schema:Iq,$id:kq,title:Sq,description:Cq,type:Pq,$ref:Gq};var Dq="http://json-schema.org/draft-07/schema",Mq="AggregateTransferManyTxInput",Wq="AggregateTransferManyTxInput",Eq="Input for aggregateTransferMany",Rq="object",Aq={transfer:{$ref:"/txs/find-transfer-many/find-transfer-many.schema.input.json#/definitions/find_transfer_many_filter"},aggregators:{description:"Array of aggregators to apply",type:"array",items:{$ref:"#/definitions/aggregate_transfer_many_aggregator"}},groups:{$ref:"#/definitions/aggregate_transfer_many_groups"},options:{$ref:"#/definitions/aggregate_transfer_many_tx_options"}},Uq={aggregate_transfer_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/aggregate_transfer_many_additional_options"}]},aggregate_transfer_many_additional_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags to aggregate data",type:"object",properties:{return_all_intervals:{description:"Add empty values for each interval if no matching data",type:"object",properties:{start_time:{type:"string"},end_time:{type:"string"}},additionalProperties:!1,required:["start_time","end_time"]}}},aggregate_transfer_many_groups:{type:"array",maxItems:5,items:{$ref:"#/definitions/aggregate_transfer_many_group"}},aggregate_transfer_many_group:{anyOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_group_period"},{$ref:"#/definitions/aggregate_transfer_many_group_field"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_group_metadata_field"}]},aggregate_transfer_many_group_field:{type:"object",properties:{type:{type:"string",enum:["field"]},field:{$ref:"#/definitions/aggregate_transfer_many_group_by_fields"},alias:{type:"string"}},required:["type","field"],additionalProperties:!1},aggregate_transfer_many_group_by_fields:{type:"string",enum:["type","status","from_wallet","to_wallet","wallet","token","transfer_group"]},aggregate_transfer_many_aggregator:{description:"Aggregator description",anyOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_aggregator_simple"},{$ref:"#/definitions/aggregate_transfer_many_aggregator_complex"}]},aggregate_transfer_many_aggregator_complex:{description:"Function and field to group",type:"object",properties:{function:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_aggregator_simple"},field:{description:"Field to group by",type:"string",enum:["from.amount","to.amount","amount","abs.amount","transfer_group","from_wallet","to_wallet","wallet","token","id"]},alias:{description:"Alias to group under",type:"string"}},$typescript:'{"additionalProperties":false}'}},qq=!1,nf={$schema:Dq,$id:Mq,title:Wq,description:Eq,type:Rq,properties:Aq,definitions:Uq,additionalProperties:qq};var Nq="http://json-schema.org/draft-07/schema",Bq="AggregateTransferManyTxOutput",Lq="AggregateTransferManyTxOutput",Vq="Output of aggregateTransferMany",Hq="object",zq={rows:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_aggregate_results"},metadata:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_aggregating_metadata"}},Kq=!1,af={$schema:Nq,$id:Bq,title:Lq,description:Vq,type:Hq,properties:zq,additionalProperties:Kq};var Qq="http://json-schema.org/draft-07/schema",Jq="AuthenticationCheckTxInput",Xq="AuthenticationCheckTxInput",Yq="Input for authenticationCheck",Zq="object",e1={options:{$ref:"#/definitions/authentication_check_tx_options"}},t1={authentication_check_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/authentication_check_additional_options"}]},authentication_check_additional_options:{description:"Optional flags for input",type:"object",default:{},$typescript:'{"additionalProperties":false}'}},r1=!1,sf={$schema:Qq,$id:Jq,title:Xq,description:Yq,type:Zq,properties:e1,definitions:t1,additionalProperties:r1};var n1="http://json-schema.org/draft-07/schema",a1="AuthenticationCheckTxOutput",s1="AuthenticationCheckTxOutput",i1="Output of authenticationCheck",o1="object",p1={},f1=!1,of={$schema:n1,$id:a1,title:s1,description:i1,type:o1,properties:p1,additionalProperties:f1};var u1="http://json-schema.org/draft-07/schema",d1="CreateAccessTokenTxInput",l1="CreateAccessTokenTxInput",c1="Input for createAccessToken",m1="object",h1={token:{anyOf:[{$ref:"#/definitions/create_access_token_limited"},{$ref:"#/definitions/create_access_token_admin"}]},options:{$ref:"#/definitions/create_access_token_tx_options"}},g1={create_access_token_limited:{type:"object",properties:{type:{enum:["limited"]},scopes:{type:"array",items:{type:"string",enum:["aggregateTransferMany","findBalanceMany","findTokenMany","findTransferGroupMany","findTransferMany","findWalletMany","getBalance","getBalanceHistory","getStatistics","getToken","getTokenMany","getTransfer","getTransferGroup","getWallet","getWalletMany"]}},filters:{description:"Forced filters for requests",type:"object",$ref:"#/definitions/create_access_token_forced_filters"},expiresIn:{description:"JWT expiration time in minutes",type:"number"},options:{$ref:"#/definitions/create_access_token_tx_options"}},required:["scopes","type","expiresIn"],additionalProperties:!1},create_access_token_admin:{type:"object",properties:{type:{enum:["admin"]},expiresIn:{description:"JWT expiration time in minutes",type:"number"},options:{$ref:"#/definitions/create_access_token_tx_options"}},required:["type","expiresIn"],additionalProperties:!1},create_access_token_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/create_access_token_additional_options"}]},create_access_token_additional_options:{description:"Optional flags for input",type:"object",default:{},$typescript:'{"additionalProperties":false}'},create_access_token_forced_filters:{type:"object",properties:{wallet_foreign:{type:"string"},from_wallet_foreign:{type:"string"},to_wallet_foreign:{type:"string"},token_foreign:{type:"string"}},additionalProperties:!1}},_1=!1,pf={$schema:u1,$id:d1,title:l1,description:c1,type:m1,properties:h1,definitions:g1,additionalProperties:_1};var T1="http://json-schema.org/draft-07/schema",y1="CreateAccessTokenTxOutput",b1="CreateAccessTokenTxOutput",x1="Output of createAccessToken",F1="object",w1={authToken:{type:"string"}},$1=["token"],O1=!1,ff={$schema:T1,$id:y1,title:b1,description:x1,type:F1,properties:w1,required:$1,additionalProperties:O1};var v1="http://json-schema.org/draft-07/schema",j1="CreateContractTxInput",I1="CreateContractTxInput",k1="Input for createContract",S1="object",C1={token:{allOf:[{$ref:"#/definitions/create_contract_token"}]},exchange:{allOf:[{$ref:"#/definitions/create_contract_exchange"}]},options:{$ref:"#/definitions/create_contract_tx_options"}},P1={create_contract_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/create_contract_additional_options"}]},create_contract_additional_options:{description:"Optional flags for input",type:"object",default:{},$typescript:'{"additionalProperties":false}'},create_contract_token:{type:"object",properties:{foreign:{allOf:[{$ref:"/db/token/token.schema.input.json#/properties/foreign"}]},metadata:{allOf:[{$ref:"/db/token/token.schema.input.json#/properties/metadata"}]},deposits:{allOf:[{$ref:"#/definitions/create_contract_deposits"}]},owner:{description:"The inital owner of the contract, defaults to foreign = 'house'",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}},additionalProperties:!1,required:["foreign","deposits"]},create_contract_deposit:{type:"object",properties:{token:{description:"Token that is moved",allOf:[{$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"}]},amount:{allOf:[{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"}]}},additionalProperties:!1,required:["token","amount"]},create_contract_deposits:{type:"array",items:{allOf:[{$ref:"#/definitions/create_contract_deposit"}]},minItems:1},create_contract_exchange:{type:"object",properties:{from_wallet:{description:"Wallet the contract will belong to at the end (buyer)",allOf:[{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}]},from_latest_control_hash:{description:"Latest control_hash on the from_wallet+from_token combo",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},from_token:{description:"Token that is transferred from from_wallet in exchange of the contract",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},to_wallet:{description:"Wallet the payment for the contract is sent to (seller)",allOf:[{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}]},amount:{allOf:[{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"}]},status:{description:"The state at which the exchange is created",type:"string",enum:["pending","finished"]},force:{allOf:[{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"}]},metadata:{allOf:[{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"}]}},additionalProperties:!1,required:["from_wallet","amount"]}},G1=["token"],D1=!1,uf={$schema:v1,$id:j1,title:I1,description:k1,type:S1,properties:C1,definitions:P1,required:G1,additionalProperties:D1};var M1="http://json-schema.org/draft-07/schema",W1="CreateContractTxOutput",E1="CreateContractTxOutput",R1="Output of createContract",A1="object",U1={token:{$ref:"/db/token/token.schema.json"},exchange:{description:"Created exchange for the Contract",allOf:[{$ref:"/txs/create-transfer-group/create-transfer-group.schema.output.json"}]}},q1=["token"],N1=!1,df={$schema:M1,$id:W1,title:E1,description:R1,type:A1,properties:U1,required:q1,additionalProperties:N1};var B1="http://json-schema.org/draft-07/schema",L1="CreateDepositTxInput",V1="CreateDepositTxInput",H1="Input for createDeposit",z1="object",K1={deposit:{$ref:"/txs/create-transfer/create-transfer.schema.input.json#/definitions/transfer_data_deposit"},options:{$ref:"#/definitions/create_deposit_tx_options"}},Q1={create_deposit_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"/txs/create-transfer/create-transfer.schema.input.json#/definitions/create_transfer_additional_options"}]}},J1=!1,X1=["deposit"],lf={$schema:B1,$id:L1,title:V1,description:H1,type:z1,properties:K1,definitions:Q1,additionalProperties:J1,required:X1};var Y1="http://json-schema.org/draft-07/schema",Z1="CreateDepositTxOutput",eN="CreateDepositTxOutput",tN="The transfer of funds and optionally the destination wallet balance",rN=[{$ref:"/txs/create-transfer/create-transfer.schema.output.json"}],cf={$schema:Y1,$id:Z1,title:eN,description:tN,allOf:rN};var nN="http://json-schema.org/draft-07/schema",aN="CreateDistributionTxInput",sN="CreateDistributionTxInput",iN="Input for createDistribution",oN="object",pN={distribution:{$ref:"#/definitions/distribution"},options:{$ref:"#/definitions/create_distribution_tx_options"}},fN={create_distribution_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/create_distribution_additional_options"}]},create_distribution_additional_options:{description:"Optional flags for input",type:"object",default:{dryrun:!1},properties:{dryrun:{type:"boolean",default:!1}},$typescript:'{"additionalProperties":false}'},leftover_target:{type:"object",properties:{rule:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_distributor_leftover_rule"}]},target:{type:"object",properties:{wallet:{allOf:[{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}]},metadata:{allOf:[{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"}]}},required:["wallet"],additionalProperties:!1}},required:["rule"],additionalProperties:!1},distribution:{description:"Distribute funds from one wallet between multiple wallets",type:"object",properties:{identifier:{description:"Unique identifier for this distribution",type:"string"},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},from_wallet:{description:"Wallet where funds are debited",allOf:[{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}]},token:{description:"Token that is moved",allOf:[{$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"}]},amount:{allOf:[{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"}]},status:{allOf:[{$ref:"/db/transfer/transfer.schema.input.json#/properties/status"}]},force:{allOf:[{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"}]},metadata:{allOf:[{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"}]},copy_wallet_metadata_fields:{description:"Copy metadata information from Wallet metadata to transfer metadata",type:"array",items:{$ref:"#/definitions/copy_metadata_field"}},transfer_group:{description:"TransferGroup the transfer belongs to",allOf:[{$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"}]},targets:{anyOf:[{$ref:"#/definitions/target_wallets"},{$ref:"#/definitions/target_token"}]},leftover:{allOf:[{$ref:"#/definitions/leftover_target"}]}},required:["identifier","from_wallet","token","amount","targets","leftover"],additionalProperties:!1},copy_metadata_field:{description:"Copy metadata info from property to property",type:"object",properties:{from_property:{type:"string"},to_property:{type:"string"}},required:["from_property"],additionalProperties:!1},target_token:{description:"Wallets will receive funds based on their balance of this token",allOf:[{$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"}]},target_wallet:{type:"object",properties:{wallet:{description:"Wallet where funds are credited",allOf:[{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}]},portion:{description:"Number specifying the portion of funds to be credited",type:["string","number"]},metadata:{allOf:[{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"}]}},required:["wallet"],additionalProperties:!1},target_wallets:{type:"array",items:{$ref:"#/definitions/target_wallet"},minItems:1}},uN=["distribution"],dN=!1,mf={$schema:nN,$id:aN,title:sN,description:iN,type:oN,properties:pN,definitions:fN,required:uN,additionalProperties:dN};var lN="http://json-schema.org/draft-07/schema",cN="CreateDistributionTxOutput",mN="CreateDistributionTxOutput",hN="Output of createDistribution",gN="object",_N={transfer_group:{description:"Created distribution transfer group",allOf:[{$ref:"/db/transfer-group/transfer-group.schema.json"}]},transfers:{description:"Created transfers",type:"array",items:{$ref:"/db/transfer/transfer.schema.json"}}},TN=["transfer_group","transfers"],yN=!1,hf={$schema:lN,$id:cN,title:mN,description:hN,type:gN,properties:_N,required:TN,additionalProperties:yN};var bN="http://json-schema.org/draft-07/schema",xN="CreateTokenTxInput",FN="CreateTokenTxInput",wN="Input for createToken function",$N="object",ON={token:{$ref:"#/definitions/create_token_input"},options:{$ref:"#/definitions/create_token_tx_options"}},vN={create_token_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"}]},create_token_input:{type:"object",properties:{foreign:{$ref:"/db/token/token.schema.json#/properties/foreign"},public:{$ref:"/db/token/token.schema.json#/properties/public"},metadata:{$ref:"/db/token/token.schema.json#/properties/metadata"},divisor:{$ref:"/db/token/token.schema.json#/properties/divisor"},limit:{$ref:"/db/token/token.schema.json#/properties/limit"},type:{$ref:"/db/token/token.schema.json#/properties/type"},belongs_to:{description:"Wallet this token belongs_to",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}},additionalProperties:!1,required:["foreign"]}},jN=["token"],IN=!1,gf={$schema:bN,$id:xN,title:FN,description:wN,type:$N,properties:ON,definitions:vN,required:jN,additionalProperties:IN};var kN="http://json-schema.org/draft-07/schema",SN="CreateTokenTxOutput",CN="CreateTokenTxOutput",PN="The created token and respective wallet",GN="object",DN={token:{$ref:"/db/token/token.schema.json"},wallet:{$ref:"/db/wallet/wallet.schema.json"}},MN=!1,WN=["token","wallet"],_f={$schema:kN,$id:SN,title:CN,description:PN,type:GN,properties:DN,additionalProperties:MN,required:WN};var EN="http://json-schema.org/draft-07/schema",RN="CreateTransferTxInput",AN="CreateTransferTxInput",UN="Input for createTransfer",qN="object",NN={transfer:{$ref:"#/definitions/transfer_data"},options:{$ref:"#/definitions/create_transfer_tx_options"}},BN={create_transfer_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/create_transfer_additional_options"}]},create_transfer_additional_options:{description:"Additional flags to determine the return",type:"object",default:{},properties:{return_from_balance:{$id:"return_from_balance",description:"Whether the request should also return from wallet balance",type:"boolean",default:!1},return_to_balance:{$id:"return_to_balance",description:"Whether the request should also return to wallet balance",type:"boolean",default:!1},create_to_wallet_if_not_exists:{type:"boolean",description:"If true then the wallet will be created if not found. Only valid with 'foreign'",default:!1}},$typescript:'{"additionalProperties": false}'},transfer_data:{anyOf:[{$ref:"#/definitions/transfer_data_regular"},{$ref:"#/definitions/transfer_data_deposit"},{$ref:"#/definitions/transfer_data_withdrawal"}]},transfer_data_regular:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},from_wallet:{description:"Wallet where funds are debited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_wallet:{description:"Wallet where funds are credited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{description:"Token that is moved",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},amount:{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},type:{description:"Type of transfer",enum:["transfer"]},status:{$ref:"/db/transfer/transfer.schema.input.json#/properties/status"},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},transfer_group:{description:"TransferGroup the transfer belongs to",$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["from_wallet","to_wallet","token","amount","type"],$typescript:'{"additionalProperties": false}'},transfer_data_deposit:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},from_wallet:{description:"Wallet where funds are debited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_wallet:{description:"Wallet where funds are credited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{description:"Token that is moved",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},amount:{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},type:{description:"Type of transfer",enum:["deposit"]},status:{$ref:"/db/transfer/transfer.schema.input.json#/properties/status"},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},transfer_group:{description:"TransferGroup the transfer belongs to",$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["to_wallet","token","amount"],$typescript:'{"additionalProperties": false}'},transfer_data_withdrawal:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},from_wallet:{description:"Wallet where funds are debited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_wallet:{description:"Wallet where funds are credited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{description:"Token that is moved",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},amount:{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},type:{description:"Type of transfer",enum:["withdrawal"]},status:{$ref:"/db/transfer/transfer.schema.input.json#/properties/status"},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},transfer_group:{description:"TransferGroup the transfer belongs to",$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["from_wallet","token","amount"],$typescript:'{"additionalProperties": false}'}},LN=["transfer"],VN=!1,Tf={$schema:EN,$id:RN,title:AN,description:UN,type:qN,properties:NN,definitions:BN,required:LN,additionalProperties:VN};var HN="http://json-schema.org/draft-07/schema",zN="CreateTransferTxOutput",KN="CreateTransferTxOutput",QN="Output of createTransfer",JN="object",XN={transfer:{description:"Created transfer object",$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"},from_balance:{description:"Debited wallet balance",$ref:"/txs/get-balance/get-balance.schema.output.json#/definitions/balance"},to_balance:{description:"Credited wallet balance",$ref:"/txs/get-balance/get-balance.schema.output.json#/definitions/balance"}},YN=!1,ZN=["transfer"],yf={$schema:HN,$id:zN,title:KN,description:QN,type:JN,properties:XN,additionalProperties:YN,required:ZN};var eB="http://json-schema.org/draft-07/schema",tB="CreateTransferGroupTxInput",rB="CreateTransferGroupTxInput",nB="Input for createTransferGroup",aB="object",sB={transfer_group:{$ref:"#/definitions/transfer_group_data"},options:{$ref:"#/definitions/create_transfer_group_tx_options"}},iB={create_transfer_group_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/create_transfer_group_additional_options"}]},create_transfer_group_additional_options:{description:"Optional flags for input",type:"object",default:{},properties:{create_to_wallet_if_not_exists:{type:"boolean",description:"If true then the wallet will be created if not found. Only valid with 'foreign'",default:!1},validate_final_balance_only:{type:"boolean",description:"If true then transfers within a group will ignore balance restrictions. Only final transfers for wallets are checked. Only valid with transfer_status_lock",default:!1}},$typescript:'{"additionalProperties": false}'},transfer_group_data:{type:"object",description:"Input for the transferGroup to create",properties:{identifier:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/identifier"},status:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/status"},transfer_status:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/transfer_status"},metadata:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/metadata"},children:{description:"Array of children",type:"array",items:{$ref:"#/definitions/child_transfer_data"}}},additionalProperties:!1},child_transfer_data:{anyOf:[{$ref:"#/definitions/child_transfer_data_regular"},{$ref:"#/definitions/child_transfer_data_deposit"},{$ref:"#/definitions/child_transfer_data_withdrawal"}]},child_transfer_data_regular:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},from_wallet:{description:"Wallet where funds are debited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_wallet:{description:"Wallet where funds are credited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{description:"Token that is moved",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},amount:{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},type:{description:"Type of transfer",enum:["transfer"]},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["from_wallet","to_wallet","token","amount","type"],$typescript:'{"additionalProperties": false}'},child_transfer_data_deposit:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},from_wallet:{description:"Wallet where funds are debited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_wallet:{description:"Wallet where funds are credited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{description:"Token that is moved",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},amount:{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},type:{description:"Type of transfer",enum:["deposit"]},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["to_wallet","token","amount"],$typescript:'{"additionalProperties": false}'},child_transfer_data_withdrawal:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},latest_control_hash:{description:"Latest control_hash on the from_wallet",anyOf:[{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},{type:"null"}]},from_wallet:{description:"Wallet where funds are debited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_wallet:{description:"Wallet where funds are credited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{description:"Token that is moved",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},amount:{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},type:{description:"Type of transfer",enum:["withdrawal"]},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},created_at:{$ref:"/db/transfer/transfer.schema.input.json#/properties/created_at"}},required:["from_wallet","token","amount"],$typescript:'{"additionalProperties": false}'}},oB=[],pB=!1,bf={$schema:eB,$id:tB,title:rB,description:nB,type:aB,properties:sB,definitions:iB,required:oB,additionalProperties:pB};var fB="http://json-schema.org/draft-07/schema",uB="CreateTransferGroupTxOutput",dB="CreateTransferGroupTxOutput",lB="Output of createTransferGroup",cB="object",mB={transfer_group:{$ref:"/db/transfer-group/transfer-group.schema.json"},transfers:{description:"Created transfer objects",type:"array",items:{$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"}}},hB=["transfer_group"],gB=!1,xf={$schema:fB,$id:uB,title:dB,description:lB,type:cB,properties:mB,required:hB,additionalProperties:gB};var _B="http://json-schema.org/draft-07/schema",TB="CreateTransferManyTxInput",yB="CreateTransferManyTxInput",bB="Input for CreateTransferMany",xB="object",FB={transfers:{description:"An array of transfers",type:"array",items:{$ref:"/txs/create-transfer/create-transfer.schema.input.json#/definitions/transfer_data"}},options:{$ref:"#/definitions/create_transfer_many_tx_options"}},wB={create_transfer_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/create_transfer_many_additional_options"}]},create_transfer_many_additional_options:{description:"Optional flags for input",type:"object",default:{},properties:{return_from_balance:{$id:"return_from_balance",description:"Whether the request should also return from wallet balance",type:"boolean",default:!1},return_to_balance:{$id:"return_to_balance",description:"Whether the request should also return to wallet balance",type:"boolean",default:!1},create_to_wallet_if_not_exists:{type:"boolean",description:"If true then the wallet will be created if not found. Only valid with 'foreign'",default:!1}},$typescript:'{"additionalProperties": false}'}},$B=["transfers"],OB=!1,Ff={$schema:_B,$id:TB,title:yB,description:bB,type:xB,properties:FB,definitions:wB,required:$B,additionalProperties:OB};var vB="http://json-schema.org/draft-07/schema",jB="CreateTransferManyTxOutput",IB="CreateTransferManyTxOutput",kB="Output of CreateTransferMany",SB="object",CB={transfers:{description:"Created transfer objects",type:"array",items:{$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"}},from_balances:{description:"Debited wallet balances",type:"array",items:{$ref:"/txs/get-balance/get-balance.schema.output.json#/definitions/balance"}},to_balances:{description:"Credited wallet balances",type:"array",items:{$ref:"/txs/get-balance/get-balance.schema.output.json#/definitions/balance"}}},PB=["transfers"],GB=!1,wf={$schema:vB,$id:jB,title:IB,description:kB,type:SB,properties:CB,required:PB,additionalProperties:GB};var DB="http://json-schema.org/draft-07/schema",MB="CreateWalletTxInput",WB="CreateWalletTxInput",EB="Input for createWallet",RB="object",AB={wallet:{$ref:"/db/wallet/wallet.schema.input.json"},options:{$ref:"#/definitions/create_wallet_tx_options"}},UB={create_wallet_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"}]}},qB=!1,NB=["wallet"],$f={$schema:DB,$id:MB,title:WB,description:EB,type:RB,properties:AB,definitions:UB,additionalProperties:qB,required:NB};var BB="http://json-schema.org/draft-07/schema",LB="CreateWalletTxOutput",VB="CreateWalletTxOutput",HB="The created wallet",zB="object",KB={wallet:{$ref:"/db/wallet/wallet.schema.json"}},QB=!1,JB=["wallet"],Of={$schema:BB,$id:LB,title:VB,description:HB,type:zB,properties:KB,additionalProperties:QB,required:JB};var XB="http://json-schema.org/draft-07/schema",YB="CreateWithdrawalTxInput",ZB="CreateWithdrawalTxInput",eL="Input for createWithdrawal",tL="object",rL={withdrawal:{$ref:"/txs/create-transfer/create-transfer.schema.input.json#/definitions/transfer_data_withdrawal"},options:{$ref:"#/definitions/create_withdrawal_tx_options"}},nL={create_withdrawal_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"/txs/create-transfer/create-transfer.schema.input.json#/definitions/create_transfer_additional_options"}]}},aL=["withdrawal"],sL=!1,vf={$schema:XB,$id:YB,title:ZB,description:eL,type:tL,properties:rL,definitions:nL,required:aL,additionalProperties:sL};var iL="http://json-schema.org/draft-07/schema",oL="CreateWithdrawalTxOutput",pL="CreateWithdrawalTxOutput",fL="Output of createWithdrawal",uL=[{$ref:"/txs/create-transfer/create-transfer.schema.output.json"}],jf={$schema:iL,$id:oL,title:pL,description:fL,allOf:uL};var dL="http://json-schema.org/draft-07/schema",lL="ExportDatabaseTxInput",cL="ExportDatabaseTxInput",mL="Input for exportDatabase",hL="object",gL={export_name:{description:"Name of the created export file",type:"string"}},_L={},TL=!1,If={$schema:dL,$id:lL,title:cL,description:mL,type:hL,properties:gL,definitions:_L,additionalProperties:TL};var yL="http://json-schema.org/draft-07/schema",bL="ExportDatabaseTxOutput",xL="ExportDatabaseTxOutput",FL="Output of exportDatabase",wL="object",$L={message:{type:"string"}},OL=!1,kf={$schema:yL,$id:bL,title:xL,description:FL,type:wL,properties:$L,additionalProperties:OL};var vL="http://json-schema.org/draft-07/schema",jL="FindBalanceManyTxInput",IL="FindBalanceManyTxInput",kL="Input for findBalanceMany",SL="object",CL={balance:{$ref:"#/definitions/find_balance_many_filter"},options:{$ref:"#/definitions/find_balance_many_tx_options"}},PL={find_balance_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"#/definitions/find_balance_many_ordering_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/find_balance_many_additional_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_select_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_deselect_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_options"}]},find_balance_many_additional_options:{description:"Optional flags for input",type:"object",default:{},$typescript:'{"additionalProperties":false}'},find_balance_many_ordering_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags for input ordering",type:"object",properties:{order:{description:"Ordering options",type:"array",items:{$ref:"#/definitions/find_balance_many_ordering_input"}}}},find_balance_many_ordering_input:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_ordering_input"},{$ref:"#/definitions/find_balance_many_ordering_input_field"}]},find_balance_many_ordering_input_field:{type:"object",properties:{field:{$ref:"/db/transfer-log/transfer-log.schema.json#/definitions/TransferLogTableFields"}},$typescript:'{"additionalProperties": false}'},balance_filter_foreign_fields:{type:"string",enum:["wallet","token"]},advanced_balance_filter_fields_foreign:{type:"object",properties:{field:{$ref:"#/definitions/balance_filter_foreign_fields"}},required:["field"],$typescript:'{"additionalProperties": false}'},balance_filter:{type:"object",properties:{wallet:{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},transfer:{$ref:"/txs/get-transfer/get-transfer.schema.input.json#/definitions/unique_transfer_filter"},type:{$ref:"/db/transfer-log/transfer-log.schema.json#/properties/type"},amount:{$ref:"/db/transfer-log/transfer-log.schema.json#/properties/amount"},pending_amount:{$ref:"/db/transfer-log/transfer-log.schema.json#/properties/pending_amount"},finished_amount:{$ref:"/db/transfer-log/transfer-log.schema.json#/properties/finished_amount"},status:{$ref:"/db/transfer-log/transfer-log.schema.json#/properties/status"},metadata:{$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"}},$typescript:'{"additionalProperties": false}'},advanced_balance_filter_inner:{type:"object",properties:{inner:{type:"array",items:{$ref:"#/definitions/advanced_balance_filter"}}},$typescript:'{"additionalProperties":false}'},advanced_balance_filter_where_inner:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereInner"},{$ref:"#/definitions/advanced_balance_filter_inner"}]},advanced_balance_filter_where_primitive:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWherePrimitive"},{$ref:"#/definitions/advanced_balance_filter_fields"}]},advanced_balance_filter_where_primitive_foreign:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWherePrimitiveForeign"},{$ref:"#/definitions/advanced_balance_filter_fields_foreign"}]},advanced_balance_filter_where_object:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereObject"},{$ref:"#/definitions/advanced_balance_filter_values"}]},advanced_balance_filter_where_in:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereIns"},{$ref:"#/definitions/advanced_balance_filter_fields_w_foreign"}]},advanced_balance_filter_where_null:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereNulls"},{$ref:"#/definitions/advanced_balance_filter_fields"}]},advanced_balance_filter_fields:{type:"object",properties:{field:{type:"string",enum:["type","amount","pending_amount","finished_amount","status","metadata","updated_at"]}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_balance_filter_fields_w_foreign:{type:"object",properties:{field:{anyOf:[{$ref:"/db/transfer-log/transfer-log.schema.json#/definitions/TransferLogTableFields"},{$ref:"#/definitions/balance_filter_foreign_fields"}]}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_balance_filter_values:{type:"object",properties:{value:{$ref:"#/definitions/balance_filter"}},required:["value"],$typescript:'{"additionalProperties": false}'},advanced_balance_filter:{anyOf:[{$ref:"#/definitions/advanced_balance_filter_where_inner"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataIns"},{$ref:"#/definitions/advanced_balance_filter_where_object"},{$ref:"#/definitions/advanced_balance_filter_where_primitive"},{$ref:"#/definitions/advanced_balance_filter_where_primitive_foreign"},{$ref:"#/definitions/advanced_balance_filter_where_in"},{$ref:"#/definitions/advanced_balance_filter_where_null"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataNulls"}]},advanced_balance_filter_array:{type:"array",items:{$ref:"#/definitions/advanced_balance_filter"}},find_balance_many_filter:{oneOf:[{$ref:"#/definitions/balance_filter"},{$ref:"#/definitions/advanced_balance_filter_array"}]}},GL=!1,Sf={$schema:vL,$id:jL,title:IL,description:kL,type:SL,properties:CL,definitions:PL,additionalProperties:GL};var DL="http://json-schema.org/draft-07/schema",ML="FindBalanceManyTxOutput",WL="FindBalanceManyTxOutput",EL="Output of findBalanceMany",RL="object",AL={balances:{description:"Found balances",type:"array",items:{$ref:"/txs/get-balance/get-balance.schema.output.json#/definitions/balance"}},metadata:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_find_metadata"}},UL=["balances","metadata"],qL=!1,Cf={$schema:DL,$id:ML,title:WL,description:EL,type:RL,properties:AL,required:UL,additionalProperties:qL};var NL="http://json-schema.org/draft-07/schema",BL="FindTokenManyTxInput",LL="FindTokenManyTxInput",VL="Input for findTokenMany",HL="object",zL={token:{$ref:"#/definitions/find_token_many_filter"},options:{$ref:"#/definitions/find_token_many_tx_options"}},KL={find_token_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"#/definitions/find_token_many_ordering_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/find_token_many_additional_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_select_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_deselect_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_options"}]},find_token_many_additional_options:{description:"Optional flags for input",type:"object",default:{},$typescript:'{"additionalProperties":false}'},find_token_many_ordering_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags for input ordering",type:"object",properties:{order:{description:"Ordering options",type:"array",items:{$ref:"#/definitions/find_token_many_ordering_input"}}}},find_token_many_ordering_input:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_ordering_input"},{$ref:"#/definitions/find_token_many_ordering_input_field"}]},find_token_many_ordering_input_field:{type:"object",properties:{field:{$ref:"/db/token/token.schema.json#/definitions/TokenTableFields"}},$typescript:'{"additionalProperties": false}'},token_filter_foreign_fields:{type:"string",enum:["belongs_to"]},token_filter:{type:"object",properties:{foreign:{description:"Foreign of token to return",$ref:"/db/token/token.schema.json#/properties/foreign"},type:{$ref:"/db/token/token.schema.json#/properties/type"},metadata:{$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"},belongs_to:{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}},$typescript:'{"additionalProperties": false}'},advanced_token_filter_inner:{type:"object",properties:{inner:{type:"array",items:{$ref:"#/definitions/advanced_token_filter"}}},$typescript:'{"additionalProperties":false}'},advanced_token_filter_where_inner:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereInner"},{$ref:"#/definitions/advanced_token_filter_inner"}]},advanced_token_filter_where_primitive:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWherePrimitive"},{$ref:"#/definitions/advanced_token_filter_fields"}]},advanced_token_filter_where_primitive_foreign:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWherePrimitiveForeign"},{$ref:"#/definitions/advanced_token_filter_fields_foreign"}]},advanced_token_filter_where_object:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereObject"},{$ref:"#/definitions/advanced_token_filter_values"}]},advanced_token_filter_where_in:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereIns"},{$ref:"#/definitions/advanced_token_filter_fields_w_foreign"}]},advanced_token_filter_where_null:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereNulls"},{$ref:"#/definitions/advanced_token_filter_fields"}]},advanced_token_filter_fields:{type:"object",properties:{field:{$ref:"/db/token/token.schema.json#/definitions/TokenTableFields"}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_token_filter_fields_foreign:{type:"object",properties:{field:{$ref:"#/definitions/token_filter_foreign_fields"}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_token_filter_fields_w_foreign:{type:"object",properties:{field:{anyOf:[{$ref:"/db/token/token.schema.json#/definitions/TokenTableFields"},{$ref:"#/definitions/token_filter_foreign_fields"}]}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_token_filter_values:{type:"object",properties:{value:{$ref:"#/definitions/token_filter"}},required:["value"],$typescript:'{"additionalProperties": false}'},advanced_token_filter:{anyOf:[{$ref:"#/definitions/advanced_token_filter_where_inner"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataIns"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataPrimitive"},{$ref:"#/definitions/advanced_token_filter_where_object"},{$ref:"#/definitions/advanced_token_filter_where_primitive"},{$ref:"#/definitions/advanced_token_filter_where_primitive_foreign"},{$ref:"#/definitions/advanced_token_filter_where_in"},{$ref:"#/definitions/advanced_token_filter_where_null"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataNulls"}]},advanced_token_filter_array:{type:"array",items:{$ref:"#/definitions/advanced_token_filter"}},find_token_many_filter:{oneOf:[{$ref:"#/definitions/token_filter"},{$ref:"#/definitions/advanced_token_filter_array"}]}},QL=!1,Pf={$schema:NL,$id:BL,title:LL,description:VL,type:HL,properties:zL,definitions:KL,additionalProperties:QL};var JL="http://json-schema.org/draft-07/schema",XL="FindTokenManyTxOutput",YL="FindTokenManyTxOutput",ZL="Output of findTokenMany",eV="object",tV={tokens:{description:"Found tokens",type:"array",items:{$ref:"/txs/get-token/get-token.schema.output.json#/definitions/token"}},metadata:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_find_metadata"}},rV=["tokens","metadata"],nV=!1,Gf={$schema:JL,$id:XL,title:YL,description:ZL,type:eV,properties:tV,required:rV,additionalProperties:nV};var aV="http://json-schema.org/draft-07/schema",sV="FindTransferGroupManyTxInput",iV="FindTransferGroupManyTxInput",oV="Input for findTransferGroupMany",pV="object",fV={transfer_group:{$ref:"#/definitions/find_transfer_group_many_filter"},options:{$ref:"#/definitions/find_transfer_group_many_tx_options"}},uV={find_transfer_group_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"#/definitions/find_transfer_group_many_ordering_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/find_transfer_group_many_additional_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_select_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_deselect_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_options"}]},find_transfer_group_many_additional_options:{$typescript:'{"additionalProperties":false}',type:"object",properties:{return_transfers:{description:"Return running balance for each transfer_group for wallet in question",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}}},find_transfer_group_many_ordering_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags for input ordering",type:"object",properties:{order:{description:"Ordering options",type:"array",items:{$ref:"#/definitions/find_transfer_group_many_ordering_input"}}}},find_transfer_group_many_ordering_input:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_ordering_input"},{$ref:"#/definitions/find_transfer_group_many_ordering_input_field"}]},find_transfer_group_many_ordering_input_field:{type:"object",properties:{field:{$ref:"/db/transfer-group/transfer-group.schema.json#/definitions/TransferGroupTableFields"}},$typescript:'{"additionalProperties": false}'},transfer_group_filter_identifier_fields:{type:"string",enum:["transfer_group","reverses"]},advanced_transfer_group_filter_fields_identifier:{type:"object",properties:{field:{$ref:"#/definitions/transfer_group_filter_identifier_fields"}},required:["field"],$typescript:'{"additionalProperties": false}'},transfer_group_filter:{type:"object",properties:{identifier:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/identifier"},status:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/status"},type:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/type"},transfer_status:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/transfer_status"},reverses:{$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"},metadata:{$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"}},$typescript:'{"additionalProperties": false}'},advanced_transfer_group_filter_inner:{type:"object",properties:{inner:{type:"array",items:{$ref:"#/definitions/advanced_transfer_group_filter"}}},$typescript:'{"additionalProperties":false}'},advanced_transfer_group_filter_where_inner:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereInner"},{$ref:"#/definitions/advanced_transfer_group_filter_inner"}]},advanced_transfer_group_filter_where_primitive:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWherePrimitive"},{$ref:"#/definitions/advanced_transfer_group_filter_fields"}]},advanced_transfer_group_filter_where_primitive_identifier:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWherePrimitiveIdentifier"},{$ref:"#/definitions/advanced_transfer_group_filter_fields_identifier"}]},advanced_transfer_group_filter_where_object:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereObject"},{$ref:"#/definitions/advanced_transfer_group_filter_values"}]},advanced_transfer_group_filter_where_in:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereIns"},{$ref:"#/definitions/advanced_transfer_group_filter_fields_w_foreign"}]},advanced_transfer_group_filter_where_null:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereNulls"},{$ref:"#/definitions/advanced_transfer_group_filter_fields"}]},advanced_transfer_group_filter_fields:{type:"object",properties:{field:{$ref:"/db/transfer-group/transfer-group.schema.json#/definitions/TransferGroupTableFields"}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_transfer_group_filter_fields_w_foreign:{type:"object",properties:{field:{anyOf:[{$ref:"/db/transfer-group/transfer-group.schema.json#/definitions/TransferGroupTableFields"},{$ref:"#/definitions/transfer_group_filter_identifier_fields"}]}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_transfer_group_filter_values:{type:"object",properties:{value:{$ref:"#/definitions/transfer_group_filter"}},required:["value"],$typescript:'{"additionalProperties": false}'},advanced_transfer_group_filter:{anyOf:[{$ref:"#/definitions/advanced_transfer_group_filter_where_inner"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataIns"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataPrimitive"},{$ref:"#/definitions/advanced_transfer_group_filter_where_object"},{$ref:"#/definitions/advanced_transfer_group_filter_where_primitive"},{$ref:"#/definitions/advanced_transfer_group_filter_where_primitive_identifier"},{$ref:"#/definitions/advanced_transfer_group_filter_where_in"},{$ref:"#/definitions/advanced_transfer_group_filter_where_null"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataNulls"}]},advanced_transfer_group_filter_array:{type:"array",items:{$ref:"#/definitions/advanced_transfer_group_filter"}},find_transfer_group_many_filter:{oneOf:[{$ref:"#/definitions/transfer_group_filter"},{$ref:"#/definitions/advanced_transfer_group_filter_array"}]}},dV=["transfer_group"],lV=!1,Df={$schema:aV,$id:sV,title:iV,description:oV,type:pV,properties:fV,definitions:uV,required:dV,additionalProperties:lV};var cV="http://json-schema.org/draft-07/schema",mV="FindTransferGroupManyTxOutput",hV="FindTransferGroupManyTxOutput",gV="Output of find-transfer-group-many",_V="object",TV={transfer_groups:{description:"Found transfers",type:"array",items:{$ref:"/txs/get-transfer-group/get-transfer-group.schema.output.json#/definitions/transfer_group"}},metadata:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_find_metadata"}},yV=["transfer_groups","metadata"],bV=!1,Mf={$schema:cV,$id:mV,title:hV,description:gV,type:_V,properties:TV,required:yV,additionalProperties:bV};var xV="http://json-schema.org/draft-07/schema",FV="FindTransferManyTxInput",wV="FindTransferManyTxInput",$V="Input for findTransferMany",OV="object",vV={transfer:{$ref:"#/definitions/find_transfer_many_filter"},options:{$ref:"#/definitions/find_transfer_many_tx_options"}},jV={find_transfer_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"#/definitions/find_transfer_many_ordering_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/find_transfer_many_additional_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_select_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_deselect_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_options"}]},find_transfer_many_additional_options:{$typescript:'{"additionalProperties":false}',type:"object",properties:{return_running_balance_for_wallet:{description:"Return running balance for each transfer for wallet in question",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},return_signed_amount_for_wallet:{description:"Return amount as signed value for each transfer for wallet in question",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}}},find_transfer_many_ordering_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags for input ordering",type:"object",properties:{order:{description:"Ordering options",type:"array",items:{$ref:"#/definitions/find_transfer_many_ordering_input"}}}},find_transfer_many_ordering_input:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_ordering_input"},{$ref:"#/definitions/find_transfer_many_ordering_input_field"}]},find_transfer_many_ordering_input_field:{type:"object",properties:{field:{$ref:"/db/transfer/transfer.schema.json#/definitions/TransferTableAccessibleFields"}},$typescript:'{"additionalProperties": false}'},transfer_filter_foreign_fields:{type:"string",enum:["from_wallet","to_wallet","wallet","token"]},transfer_filter_identifier_fields:{type:"string",enum:["transfer_group"]},transfer_filter:{type:"object",properties:{from_wallet:{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_wallet:{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},wallet:{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},status:{$ref:"/db/transfer/transfer.schema.json#/properties/status"},transfer_group:{$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"},metadata:{$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"}},$typescript:'{"additionalProperties": false}'},advanced_transfer_filter_inner:{type:"object",properties:{inner:{type:"array",items:{$ref:"#/definitions/advanced_transfer_filter"}}},$typescript:'{"additionalProperties":false}'},advanced_transfer_filter_where_inner:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereInner"},{$ref:"#/definitions/advanced_transfer_filter_inner"}]},advanced_transfer_filter_where_primitive:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWherePrimitive"},{$ref:"#/definitions/advanced_transfer_filter_fields"}]},advanced_transfer_filter_where_primitive_foreign:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWherePrimitiveForeign"},{$ref:"#/definitions/advanced_transfer_filter_fields_foreign"}]},advanced_transfer_filter_where_primitive_identifier:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWherePrimitiveIdentifier"},{$ref:"#/definitions/advanced_transfer_filter_fields_identifier"}]},advanced_transfer_filter_where_object:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereObject"},{$ref:"#/definitions/advanced_transfer_filter_values"}]},advanced_transfer_filter_where_in:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereIns"},{$ref:"#/definitions/advanced_transfer_filter_fields_w_foreign"}]},advanced_transfer_filter_where_null:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereNulls"},{$ref:"#/definitions/advanced_transfer_filter_fields"}]},advanced_transfer_filter_fields:{type:"object",properties:{field:{$ref:"/db/transfer/transfer.schema.json#/definitions/TransferTableAccessibleFields"}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_transfer_filter_fields_foreign:{type:"object",properties:{field:{$ref:"#/definitions/transfer_filter_foreign_fields"}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_transfer_filter_fields_identifier:{type:"object",properties:{field:{$ref:"#/definitions/transfer_filter_identifier_fields"}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_transfer_filter_fields_w_foreign:{type:"object",properties:{field:{anyOf:[{$ref:"/db/transfer/transfer.schema.json#/definitions/TransferTableAccessibleFields"},{$ref:"#/definitions/transfer_filter_foreign_fields"}]}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_transfer_filter_values:{type:"object",properties:{value:{$ref:"#/definitions/transfer_filter"}},required:["value"],$typescript:'{"additionalProperties": false}'},advanced_transfer_filter:{anyOf:[{$ref:"#/definitions/advanced_transfer_filter_where_inner"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataIns"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataPrimitive"},{$ref:"#/definitions/advanced_transfer_filter_where_object"},{$ref:"#/definitions/advanced_transfer_filter_where_primitive"},{$ref:"#/definitions/advanced_transfer_filter_where_primitive_foreign"},{$ref:"#/definitions/advanced_transfer_filter_where_primitive_identifier"},{$ref:"#/definitions/advanced_transfer_filter_where_in"},{$ref:"#/definitions/advanced_transfer_filter_where_null"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataNulls"}]},advanced_transfer_filter_array:{type:"array",items:{$ref:"#/definitions/advanced_transfer_filter"}},find_transfer_many_filter:{oneOf:[{$ref:"#/definitions/transfer_filter"},{$ref:"#/definitions/advanced_transfer_filter_array"}]}},IV=["transfer"],kV=!1,Wf={$schema:xV,$id:FV,title:wV,description:$V,type:OV,properties:vV,definitions:jV,required:IV,additionalProperties:kV};var SV="http://json-schema.org/draft-07/schema",CV="FindTransferManyTxOutput",PV="FindTransferManyTxOutput",GV="Output of findTransferMany",DV="object",MV={transfers:{description:"Found transfers",type:"array",items:{$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"}},metadata:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_find_metadata"}},WV=["transfers","metadata"],EV=!1,Ef={$schema:SV,$id:CV,title:PV,description:GV,type:DV,properties:MV,required:WV,additionalProperties:EV};var RV="http://json-schema.org/draft-07/schema",AV="FindWalletManyTxInput",UV="FindWalletManyTxInput",qV="Input for findWalletMany",NV="object",BV={wallet:{$ref:"#/definitions/find_wallet_many_filter"},options:{$ref:"#/definitions/find_wallet_many_tx_options"}},LV={find_wallet_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"#/definitions/find_wallet_many_ordering_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/find_wallet_many_additional_options"},{$ref:"#/definitions/find_wallet_many_select_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_options"}]},find_wallet_many_additional_options:{description:"Optional flags for input",type:"object",properties:{include_balance_for_token:{description:"If specified each wallet will have its balance included",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"}},default:{},$typescript:'{"additionalProperties":false}'},find_wallet_many_ordering_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags for input ordering",type:"object",properties:{order:{description:"Ordering options",type:"array",items:{$ref:"#/definitions/find_wallet_many_ordering_input"}}}},find_wallet_many_ordering_input:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_ordering_input"},{$ref:"#/definitions/find_wallet_many_ordering_input_field"}]},find_wallet_many_ordering_input_field:{type:"object",properties:{field:{$ref:"#/definitions/advanced_wallet_filter_fields"}},$typescript:'{"additionalProperties": false}'},find_wallet_many_filter:{oneOf:[{$ref:"#/definitions/wallet_filter"},{$ref:"#/definitions/advanced_wallet_filter_array"}]},wallet_filter:{type:"object",properties:{foreign:{$ref:"/db/wallet/wallet.schema.json#/properties/foreign"},name:{$ref:"/db/wallet/wallet.schema.json#/properties/name"},type:{$ref:"/db/wallet/wallet.schema.json#/properties/type"},status:{$ref:"/db/wallet/wallet.schema.json#/properties/status"},metadata:{$ref:"/db/consts.schema.json#/definitions/DbFilterMetadata"}},$typescript:'{"additionalProperties":false}'},advanced_wallet_filter_where_inner:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereInner"},{$ref:"#/definitions/advanced_wallet_filter_inner"}]},advanced_wallet_filter_inner:{type:"object",properties:{inner:{type:"array",items:{$ref:"#/definitions/advanced_wallet_filter"}}},$typescript:'{"additionalProperties":false}'},advanced_wallet_filter_where_primitive:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWherePrimitive"},{$ref:"#/definitions/advanced_wallet_filter_fields_object"}]},advanced_wallet_filter_where_object:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereObject"},{$ref:"#/definitions/advanced_wallet_filter_values"}]},advanced_wallet_filter_where_in:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereIns"},{$ref:"#/definitions/advanced_wallet_filter_fields_object"}]},advanced_wallet_filter_where_null:{allOf:[{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereNulls"},{$ref:"#/definitions/advanced_wallet_filter_fields_object"}]},advanced_wallet_filter_fields_object:{type:"object",properties:{field:{$ref:"#/definitions/advanced_wallet_filter_fields"}},required:["field"],$typescript:'{"additionalProperties": false}'},advanced_wallet_filter_fields:{type:"string",enum:["id","balance_pending_amount","balance_finished_amount","balance_available_balance","foreign","name","type","status","created_at"]},advanced_wallet_filter_string_fields:{type:"string",enum:["foreign","name","type","status","created_at"]},advanced_wallet_filter_number_fields:{type:"string",enum:["id","balance_pending_amount","balance_finished_amount","balance_available_balance"]},advanced_wallet_filter_values:{type:"object",properties:{value:{$ref:"#/definitions/wallet_filter"}},required:["value"],$typescript:'{"additionalProperties": false}'},advanced_wallet_filter:{anyOf:[{$ref:"#/definitions/advanced_wallet_filter_where_inner"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataIns"},{$ref:"/db/consts.schema.json#/definitions/DbFilterFunctionWhereMetadataPrimitive"},{$ref:"#/definitions/advanced_wallet_filter_where_primitive"},{$ref:"#/definitions/advanced_wallet_filter_where_object"},{$ref:"#/definitions/advanced_wallet_filter_where_in"},{$ref:"#/definitions/advanced_wallet_filter_where_null"}]},advanced_wallet_filter_array:{type:"array",items:{$ref:"#/definitions/advanced_wallet_filter"}},find_wallet_many_select_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags to limit search result",type:"object",properties:{select:{description:"Select options",type:"array",items:{$ref:"/txs/find-wallet-many/find-wallet-many.schema.output.json#/definitions/wallet_with_balance_fields"}}}}},VV=!1,Rf={$schema:RV,$id:AV,title:UV,description:qV,type:NV,properties:BV,definitions:LV,additionalProperties:VV};var HV="http://json-schema.org/draft-07/schema",zV="FindWalletManyTxOutput",KV="FindWalletManyTxOutput",QV="Output of findWalletMany",JV="object",XV={wallets:{type:"array",items:{anyOf:[{$ref:"/db/wallet/wallet.schema.json"},{type:"null"},{$ref:"#/definitions/wallet_with_balance"}]}},metadata:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_find_metadata"}},YV={wallet_with_balance:{type:"object",properties:{id:{description:"System defined primary key",type:"integer"},foreign:{description:"User provided key for wallet. Must be unique",type:"string"},name:{description:"Name of the wallet",type:["string","null"]},metadata:{description:"Key/value metadata object",type:["object","null"]},type:{description:"Type of the wallet",default:"regular",$ref:"/db/consts.schema.json#/definitions/WalletType"},status:{description:"Current status for the wallet",default:"active",type:"string"},default_allow_negative:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be negative",default:!1,type:"boolean"},default_allow_positive:{description:"Boolean indicating if wallet (pending_amount + finished_amount) can be positive. Used for token balance to deny positive balance.",default:!0,type:"boolean"},created_at:{description:"Datetime when the wallet was created",type:"string",format:"date-time"},updated_at:{description:"Datetime when the wallet was last updated",type:"string",format:"date-time"},balance_transfer_id:{description:"Latest transfer id",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/transfer_id"},balance_token_id:{description:"Token ID of balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/token_id"},balance_token_foreign:{description:"Token Foreign of balance",$ref:"/db/token/token.schema.json#/properties/foreign"},balance_pending_amount:{description:"Current pending balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/pending_amount"},balance_pending_amount_to:{description:"Sum of incoming pending transfers",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/pending_amount_to"},balance_pending_amount_from:{description:"Sum of outgoing pending transfers",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/pending_amount_from"},balance_finished_amount:{description:"Current finished balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/finished_amount"},balance_amount:{description:"Current finished and pending balance sum",type:"number"},balance_available_balance:{description:"Available balance that is sum of pending_amount_from and finished_amount",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/available_balance"},balance_latest_control_hash:{description:"Latest control_hash associated with wallet token combination",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/latest_control_hash"},balance_updated_at:{description:"Last modification date of balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/created_at"}},additionalProperties:!1},wallet_with_balance_fields:{type:"string",enum:["id","foreign","name","metadata","type","status","default_allow_negative","default_allow_positive","created_at","updated_at","balance_transfer_id","balance_token_id","balance_token_foreign","balance_pending_amount","balance_pending_amount_to","balance_pending_amount_from","balance_finished_amount","balance_amount","balance_latest_control_hash","balance_updated_at","balance_available_balance"]}},ZV=["wallets","metadata"],eH=!1,Af={$schema:HV,$id:zV,title:KV,description:QV,type:JV,properties:XV,definitions:YV,required:ZV,additionalProperties:eH};var tH="http://json-schema.org/draft-07/schema",rH="FinishTransactionTxInput",nH="FinishTransactionTxInput",aH="Input for finishTransaction",sH="object",iH={action:{description:"Finish transaction with commit/rollback",default:"commit",type:"string",enum:["commit","rollback"]},options:{$ref:"#/definitions/finish_transaction_tx_options"}},oH={finish_transaction_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/finish_transaction_additional_options"}]},finish_transaction_additional_options:{type:"object",properties:{transaction_id:{description:"Id of the transaction context to run the query in",type:"string"}},required:["transaction_id"],$typescript:'{"additionalProperties": false}'}},pH=["action","options"],fH=!1,Uf={$schema:tH,$id:rH,title:nH,description:aH,type:sH,properties:iH,definitions:oH,required:pH,additionalProperties:fH};var uH="http://json-schema.org/draft-07/schema",dH="FinishTransactionTxOutput",lH="FinishTransactionTxOutput",cH="Output of finishTransaction",mH="object",hH={success:{type:"boolean"},message:{description:"Error message when success is false",type:"string"}},gH=["success"],_H=!1,qf={$schema:uH,$id:dH,title:lH,description:cH,type:mH,properties:hH,required:gH,additionalProperties:_H};var TH="http://json-schema.org/draft-07/schema",yH="GetBalanceTxInput",bH="GetBalanceTxInput",xH="Input for getBalance",FH="object",wH={balance:{$ref:"#/definitions/unique_balance_filter"},options:{$ref:"#/definitions/get_balance_tx_options"}},$H={get_balance_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/get_balance_additional_options"}]},get_balance_additional_options:{description:"Optional flags for input",type:"object",properties:{create_wallet_if_not_exists:{type:"boolean",description:"If true then the missing wallet will be created if not found. Only valid with 'foreign'",default:!1},create_token_if_not_exists:{type:"boolean",description:"If true then the missing token will be created if not found. Only valid with 'foreign'",default:!1},create_if_not_exists:{type:"boolean",description:"If true then the missing balance will be created if not found. ",default:!1}},default:{},$typescript:'{"additionalProperties": false}'},unique_balance_filter:{type:"object",properties:{wallet:{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},datetime:{description:"Time the balance should be retrieved at",type:"string"}},required:["wallet","token"],additionalProperties:!1}},OH=["balance"],vH=!1,Nf={$schema:TH,$id:yH,title:bH,description:xH,type:FH,properties:wH,definitions:$H,required:OH,additionalProperties:vH};var jH="http://json-schema.org/draft-07/schema",IH="GetBalanceTxOutput",kH="GetBalanceTxOutput",SH="Output of getBalance",CH="object",PH={balance:{description:"requested balance",$ref:"#/definitions/balance"}},GH={balance:{type:"object",properties:{transfer_id:{description:"Latest transfer id",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/transfer_id"},token_id:{description:"Token ID of balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/token_id"},token_foreign:{description:"Token Foreign of balance",$ref:"/db/token/token.schema.json#/properties/foreign"},wallet_id:{description:"Wallet ID of balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/wallet_id"},wallet_foreign:{description:"Wallet Foreign of balance",$ref:"/db/wallet/wallet.schema.json#/properties/foreign"},pending_amount:{description:"Current pending balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/pending_amount"},pending_amount_to:{description:"Sum of incoming pending transfers",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/pending_amount_to"},pending_amount_from:{description:"Sum of outgoing pending transfers",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/pending_amount_from"},available_balance:{description:"Available balance that is sum of pending_amount_from and finished_amount",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/available_balance"},finished_amount:{description:"Current finished balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/finished_amount"},amount:{description:"Current finished and pending balance sum",type:"number"},latest_control_hash:{description:"Latest control_hash associated with wallet token combination",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/latest_control_hash"},updated_at:{description:"Last modification date of balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/created_at"}},required:["token_id","token_foreign","wallet_id","wallet_foreign","pending_amount","finished_amount","amount","latest_control_hash","updated_at"],additionalProperties:!1},balance_fields:{description:"Fields on the balance object",type:"string",enum:["transfer_id","token_id","token_foreign","wallet_id","wallet_foreign","pending_amount","pending_amount_to","pending_amount_from","finished_amount","available_balance","amount","latest_control_hash","updated_at"]}},DH=!1,Bf={$schema:jH,$id:IH,title:kH,description:SH,type:CH,properties:PH,definitions:GH,additionalProperties:DH};var MH="http://json-schema.org/draft-07/schema",WH="GetBalanceHistoryTxInput",EH="GetBalanceHistoryTxInput",RH="Input for getBalanceHistory",AH="object",UH={balance:{$ref:"/txs/get-balance/get-balance.schema.input.json#/definitions/unique_balance_filter"},options:{$ref:"#/definitions/get_balance_history_tx_options"}},qH={get_balance_history_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/get_balance_history_additional_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_limiting_options"},{$ref:"#/definitions/get_balance_history_ordering_options"},{$ref:"#/definitions/balance_history_select_options"},{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_options"}]},get_balance_history_additional_options:{description:"Optional flags for input",type:"object",properties:{create_wallet_if_not_exists:{type:"boolean",description:"If true then the missing wallet will be created if not found. Only valid with 'foreign'",default:!1},create_token_if_not_exists:{type:"boolean",description:"If true then the missing token will be created if not found. Only valid with 'foreign'",default:!1}},default:{},$typescript:'{"additionalProperties":false}'},get_balance_history_ordering_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags for input ordering",type:"object",properties:{order:{description:"Ordering options",type:"string",enum:["asc","desc"]}}},balance_history_select_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags to limit search result",type:"object",properties:{select:{description:"Select options",type:"array",items:{$ref:"/txs/get-balance-history/get-balance-history.schema.output.json#/definitions/balance_history_fields"}}}}},NH=!1,Lf={$schema:MH,$id:WH,title:EH,description:RH,type:AH,properties:UH,definitions:qH,additionalProperties:NH};var BH="http://json-schema.org/draft-07/schema",LH="GetBalanceHistoryTxOutput",VH="GetBalanceHistoryTxOutput",HH="Output of getBalanceHistory",zH="object",KH={balances:{description:"Resolved balance change objects",type:"array",items:{$ref:"#/definitions/balance_history"}},metadata:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_find_metadata"}},QH={balance_history:{type:"object",properties:{balance_id:{description:"The internal ID of the balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/id"},token_id:{description:"Token ID of balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/token_id"},token_foreign:{description:"Token Foreign of balance",$ref:"/db/token/token.schema.json#/properties/foreign"},wallet_id:{description:"Wallet ID of balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/wallet_id"},wallet_foreign:{description:"Wallet Foreign of balance",$ref:"/db/wallet/wallet.schema.json#/properties/foreign"},pending_amount:{description:"Current pending balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/pending_amount"},pending_amount_to:{description:"Sum of incoming pending transfers",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/pending_amount_to"},pending_amount_from:{description:"Sum of outgoing pending transfers",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/pending_amount_from"},available_balance:{description:"Available balance that is sum of pending_amount_from and finished_amount",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/available_balance"},finished_amount:{description:"Current finished balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/finished_amount"},amount:{description:"Current finished and pending balance sum",type:"number"},latest_control_hash:{description:"Latest control_hash associated with wallet token combination",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/latest_control_hash"},updated_at:{description:"Last modification date of balance",$ref:"/db/transfer-log/transfer-log.schema.json#/properties/created_at"},transfer_id:{$ref:"/db/transfer/transfer.schema.json#/properties/id"},transfer_identifier:{$ref:"/db/transfer/transfer.schema.json#/properties/identifier"},transfer_control_hash:{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},transfer_from_wallet_id:{$ref:"/db/transfer/transfer.schema.json#/properties/from_wallet_id"},transfer_from_wallet_foreign:{$ref:"/db/wallet/wallet.schema.json#/properties/foreign"},transfer_to_wallet_id:{$ref:"/db/transfer/transfer.schema.json#/properties/to_wallet_id"},transfer_to_wallet_foreign:{$ref:"/db/wallet/wallet.schema.json#/properties/foreign"},transfer_amount:{$ref:"/db/transfer/transfer.schema.json#/properties/amount"},transfer_type:{$ref:"/db/transfer/transfer.schema.json#/properties/type"},transfer_status:{$ref:"/db/transfer/transfer.schema.json#/properties/status"},transfer_force:{$ref:"/db/transfer/transfer.schema.json#/properties/force"},transfer_created_at:{$ref:"/db/transfer/transfer.schema.json#/properties/created_at"},transfer_updated_at:{$ref:"/db/transfer/transfer.schema.json#/properties/updated_at"},transfer_metadata:{$ref:"/db/transfer/transfer.schema.json#/properties/metadata"},transfer_transfer_group_id:{$ref:"/db/transfer/transfer.schema.json#/properties/transfer_group_id"},transfer_transfer_group_identifier:{description:"Transfer Group identifier if transfer belongs to a group",type:"string"},transfer_reverses_id:{$ref:"/db/transfer/transfer.schema.json#/properties/reverses_id"},transfer_reverses_identifier:{description:"Reverses identifier if transfer reverses another transfer",type:"string"},transfer_status_finalized_at:{description:"DateTime transfer reached final status",type:["string","null"],format:"date-time"}},$typescript:'{"additionalProperties": false}'},balance_history_fields:{type:"string",enum:["transfer_id","transfer_identifier","transfer_control_hash","transfer_from_wallet_id","transfer_from_wallet_foreign","transfer_to_wallet_id","transfer_to_wallet_foreign","transfer_amount","transfer_type","transfer_status","transfer_force","transfer_created_at","transfer_updated_at","transfer_metadata","transfer_transfer_group_id","transfer_transfer_group_identifier","transfer_reverses_id","transfer_reverses_identifier","transfer_status_finalized_at","balance_id","token_id","token_foreign","wallet_id","wallet_foreign","pending_amount","pending_amount_to","pending_amount_from","finished_amount","amount","latest_control_hash","updated_at","status"]}},JH=!1,Vf={$schema:BH,$id:LH,title:VH,description:HH,type:zH,properties:KH,definitions:QH,additionalProperties:JH};var XH="http://json-schema.org/draft-07/schema",YH="GetDatabaseExportProgressTxInput",ZH="GetDatabaseExportProgressTxInput",e2="Input for getDatabaseExportProgress",t2="object",r2={options:{$ref:"#/definitions/get_database_backup_progress_tx_options"}},n2={get_database_backup_progress_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/get_database_backup_progress_additional_options"}]},get_database_backup_progress_additional_options:{description:"Optional flags for input",type:"object",default:{},$typescript:'{"additionalProperties":false}'}},a2=!1,Hf={$schema:XH,$id:YH,title:ZH,description:e2,type:t2,properties:r2,definitions:n2,additionalProperties:a2};var s2="http://json-schema.org/draft-07/schema",i2="GetDatabaseExportProgressTxOutput",o2="GetDatabaseExportProgressTxOutput",p2="Output of getDatabaseExportProgress",f2="object",u2={size:{type:"number",description:"Size of a exported backup in MB"},started:{type:"boolean",description:"Boolean indicating if export has started"},finished:{type:"boolean",description:"Boolean indicating if export has finished"},error:{type:"string",description:"Error message in case one occurs"}},d2=["size","started","finished"],l2=!1,zf={$schema:s2,$id:i2,title:o2,description:p2,type:f2,properties:u2,required:d2,additionalProperties:l2};var c2="http://json-schema.org/draft-07/schema",m2="GetDatabaseImportProgressTxInput",h2="GetDatabaseImportProgressTxInput",g2="Input for GetDatabaseImportProgress",_2="object",T2={options:{$ref:"#/definitions/import_database_progress_tx_options"}},y2={import_database_progress_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"}]}},b2=!1,Kf={$schema:c2,$id:m2,title:h2,description:g2,type:_2,properties:T2,definitions:y2,additionalProperties:b2};var x2="http://json-schema.org/draft-07/schema",F2="GetDatabaseImportProgressTxOutput",w2="GetDatabaseImportProgressTxOutput",$2="Output of GetDatabaseImportProgress",O2="object",v2={progress:{type:"number",description:"Percentage of imported database"}},j2=!1,Qf={$schema:x2,$id:F2,title:w2,description:$2,type:O2,properties:v2,additionalProperties:j2};var I2="http://json-schema.org/draft-07/schema",k2="GetFlagsTxInput",S2="GetFlagsTxInput",C2="Input for getFlags",P2="object",G2={options:{$ref:"#/definitions/get_flags_tx_options"}},D2={get_flags_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options_without_tx"}]}},M2=!1,Jf={$schema:I2,$id:k2,title:S2,description:C2,type:P2,properties:G2,definitions:D2,additionalProperties:M2};var W2="http://json-schema.org/draft-07/schema",E2="GetFlagsTxOutput",R2="GetFlagsTxOutput",A2="Output of getFlags",U2="object",q2={flags:{$ref:"/db/consts.schema.json#/definitions/Flags"}},N2=!1,Xf={$schema:W2,$id:E2,title:R2,description:A2,type:U2,properties:q2,additionalProperties:N2};var B2="http://json-schema.org/draft-07/schema",L2="GetStatisticsTxInput",V2="GetStatisticsTxInput",H2="Input for getStatistics",z2="object",K2={model:{$ref:"#/definitions/statistics_model"},groups:{$ref:"#/definitions/statistics_groups"},aggregator:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_aggregator"},filter:{$ref:"#/definitions/statistics_filter"},options:{$ref:"#/definitions/get_statistics_tx_options"}},Q2={get_statistics_tx_options:{description:"Optional flags for input",type:"object",default:{},properties:{tracking_id:{description:"User provided id added to logs for debugging",type:"string"}},additionalProperties:!1},statistics_groups:{type:"array",maxItems:5,items:{$ref:"#/definitions/statistics_group"}},statistics_group:{anyOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_group"},{$ref:"#/definitions/statistics_group_field"}]},statistics_group_field:{type:"object",properties:{type:{type:"string",enum:["field"]},value:{$ref:"#/definitions/statistics_field"},alias:{type:"string"}},required:["type","value"],additionalProperties:!1},statistics_model:{description:"Model to return statistics about",type:"string",enum:["Transfer","TransferGroup","Wallet","Token"],default:"Transfer"},statistics_field:{description:"Field to group statistics about. Only used with group_by_field type",type:"string",enum:["type","status","transfer_status"],default:"type"},statistics_filter:{anyOf:[{$ref:"#/definitions/statistics_general_filter"},{$ref:"#/definitions/statistics_transfer_filter"}]},statistics_general_filter:{type:"object",properties:{start_time:{type:"string",format:"date-time"},end_time:{type:"string",format:"date-time"}},$typescript:'{"additionalProperties":false}'},statistics_transfer_filter:{type:"object",properties:{status:{$ref:"/db/transfer/transfer.schema.json#/properties/status"},start_time:{type:"string",format:"date-time"},end_time:{type:"string",format:"date-time"}},$typescript:'{"additionalProperties":false}'}},J2=!1,Yf={$schema:B2,$id:L2,title:V2,description:H2,type:z2,properties:K2,definitions:Q2,additionalProperties:J2};var X2="http://json-schema.org/draft-07/schema",Y2="GetStatisticsTxOutput",Z2="GetStatisticsTxOutput",e7="Output of getStatistics",t7="object",r7={rows:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_aggregate_results"}},n7={},a7=["rows"],s7=!1,Zf={$schema:X2,$id:Y2,title:Z2,description:e7,type:t7,properties:r7,definitions:n7,required:a7,additionalProperties:s7};var i7="http://json-schema.org/draft-07/schema",o7="GetTokenTxInput",p7="GetTokenTxInput",f7="Input for getToken",u7="object",d7={token:{$ref:"#/definitions/unique_token_filter"},options:{$ref:"#/definitions/get_token_tx_options"}},l7={get_token_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/get_token_additional_options"}]},get_token_additional_options:{description:"Optional flags for input",type:"object",properties:{ignore_cache:{type:"boolean",default:!1},create_if_not_exists:{type:"boolean",description:"If true then the token will be created if not found. Only valid with 'foreign'",default:!1},return_only_id:{type:"boolean",description:"If true then the returning object is only guaranteed to have id",default:!1}},default:{},$typescript:'{"additionalProperties": false}'},unique_token_filter:{description:"UNIQUE filtering options for token",anyOf:[{$ref:"#/definitions/unique_token_filter_id"},{$ref:"#/definitions/unique_token_filter_foreign"}]},unique_token_filter_id:{type:"object",description:"ID based filter for token",properties:{id:{description:"Id of wallet to return",$ref:"/db/wallet/wallet.schema.json#/properties/id"},foreign:{description:"Foreign of wallet to return",$ref:"/db/wallet/wallet.schema.json#/properties/name"}},required:["id"],additionalProperties:!1},unique_token_filter_foreign:{type:"object",description:"Foreign based filter for token",properties:{id:{description:"Id of wallet to return",$ref:"/db/wallet/wallet.schema.json#/properties/id"},foreign:{description:"Foreign of wallet to return",$ref:"/db/wallet/wallet.schema.json#/properties/name"}},required:["foreign"],additionalProperties:!1}},c7=["token"],m7=!1,eu={$schema:i7,$id:o7,title:p7,description:f7,type:u7,properties:d7,definitions:l7,required:c7,additionalProperties:m7};var h7="http://json-schema.org/draft-07/schema",g7="GetTokenTxOutput",_7="GetTokenTxOutput",T7="Output of getToken",y7="object",b7={token:{description:"requested token",$ref:"#/definitions/token"}},x7={token:{properties:{id:{$ref:"/db/token/token.schema.json#/properties/id"},foreign:{$ref:"/db/token/token.schema.json#/properties/foreign"},public:{$ref:"/db/token/token.schema.json#/properties/public"},belongs_to:{$ref:"/db/token/token.schema.json#/properties/belongs_to"},created_at:{$ref:"/db/token/token.schema.json#/properties/created_at"},updated_at:{$ref:"/db/token/token.schema.json#/properties/updated_at"},metadata:{$ref:"/db/token/token.schema.json#/properties/metadata"},divisor:{$ref:"/db/token/token.schema.json#/properties/divisor"},limit:{$ref:"/db/token/token.schema.json#/properties/limit"},type:{$ref:"/db/token/token.schema.json#/properties/type"},belongs_to_foreign:{description:"Foreign of the belongs_to wallet if exists",type:["string","null"]}},required:["id"],additionalProperties:!1}},F7=!1,tu={$schema:h7,$id:g7,title:_7,description:T7,type:y7,properties:b7,definitions:x7,additionalProperties:F7};var w7="http://json-schema.org/draft-07/schema",$7="GetTokenManyTxInput",O7="GetTokenManyTxInput",v7="Input for getTokenMany",j7="object",I7={tokens:{type:"array",items:{$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"}},options:{$ref:"#/definitions/get_token_many_tx_options"}},k7={get_token_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/get_token_many_additional_options"}]},get_token_many_additional_options:{description:"Optional flags for input",type:"object",properties:{ignore_cache:{type:"boolean",default:!1},create_if_not_exists:{type:"boolean",description:"If true then the token will be created if not found. Only valid with 'foreign'",default:!1},return_only_id:{type:"boolean",description:"If true then the returning object is only guaranteed to have id",default:!1}},default:{},$typescript:'{"additionalProperties": false}'}},S7=["tokens"],C7=!1,ru={$schema:w7,$id:$7,title:O7,description:v7,type:j7,properties:I7,definitions:k7,required:S7,additionalProperties:C7};var P7="http://json-schema.org/draft-07/schema",G7="GetTokenManyTxOutput",D7="GetTokenManyTxOutput",M7="Output of getTokenMany",W7="object",E7={tokens:{type:"array",items:{$ref:"#/definitions/TokenResult"}}},R7={TokenResult:{anyOf:[{$ref:"/db/token/token.schema.json"},{$ref:"/db/token/token.schema.optional.json"},{type:"null"}]}},A7=["tokens"],U7=!1,nu={$schema:P7,$id:G7,title:D7,description:M7,type:W7,properties:E7,definitions:R7,required:A7,additionalProperties:U7};var q7="http://json-schema.org/draft-07/schema",N7="GetTransferTxInput",B7="GetTransferTxInput",L7="Input for getTransfer",V7="object",H7={transfer:{$ref:"#/definitions/unique_transfer_filter"},options:{$ref:"#/definitions/get_transfer_tx_options"}},z7={get_transfer_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"}]},unique_transfer_filter:{description:"UNIQUE filtering options for transfer",anyOf:[{$ref:"#/definitions/unique_transfer_filter_id"},{$ref:"#/definitions/unique_transfer_filter_identifier"}]},unique_transfer_filter_id:{type:"object",description:"ID based filter of transfer",properties:{id:{description:"Id of transfer to return",$ref:"/db/transfer/transfer.schema.json#/properties/id"},identifier:{description:"Identifier of transfer to return",$ref:"/db/transfer/transfer.schema.json#/properties/identifier"}},required:["id"],additionalProperties:!1},unique_transfer_filter_identifier:{type:"object",description:"identifier based filter of transfer",properties:{id:{description:"Id of transfer to return",$ref:"/db/transfer/transfer.schema.json#/properties/id"},identifier:{description:"Identifier of transfer to return",$ref:"/db/transfer/transfer.schema.json#/properties/identifier"}},required:["identifier"],additionalProperties:!1}},K7=["transfer"],Q7=!1,au={$schema:q7,$id:N7,title:B7,description:L7,type:V7,properties:H7,definitions:z7,required:K7,additionalProperties:Q7};var J7="http://json-schema.org/draft-07/schema",X7="GetTransferTxOutput",Y7="GetTransferTxOutput",Z7="Output of getTransfer",ez="object",tz={transfer:{$ref:"#/definitions/transfer"}},rz={transfer:{type:"object",description:"requested transfer",properties:{id:{$ref:"/db/transfer/transfer.schema.json#/properties/id"},identifier:{$ref:"/db/transfer/transfer.schema.json#/properties/identifier"},control_hash:{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},from_wallet_id:{$ref:"/db/transfer/transfer.schema.json#/properties/from_wallet_id"},from_wallet_foreign:{$ref:"/db/wallet/wallet.schema.json#/properties/foreign"},to_wallet_id:{$ref:"/db/transfer/transfer.schema.json#/properties/to_wallet_id"},to_wallet_foreign:{$ref:"/db/wallet/wallet.schema.json#/properties/foreign"},token_id:{$ref:"/db/transfer/transfer.schema.json#/properties/token_id"},token_foreign:{$ref:"/db/token/token.schema.json#/properties/foreign"},amount:{$ref:"/db/transfer/transfer.schema.json#/properties/amount"},type:{$ref:"/db/transfer/transfer.schema.json#/properties/type"},status:{$ref:"/db/transfer/transfer.schema.json#/properties/status"},force:{$ref:"/db/transfer/transfer.schema.json#/properties/force"},auto_hash:{$ref:"/db/transfer/transfer.schema.json#/properties/auto_hash"},created_at:{$ref:"/db/transfer/transfer.schema.json#/properties/created_at"},updated_at:{$ref:"/db/transfer/transfer.schema.json#/properties/updated_at"},metadata:{$ref:"/db/transfer/transfer.schema.json#/properties/metadata"},transfer_group_id:{$ref:"/db/transfer/transfer.schema.json#/properties/transfer_group_id"},transfer_group_identifier:{description:"Transfer Group identifier if transfer belongs to a group",type:"string"},reverses_id:{$ref:"/db/transfer/transfer.schema.json#/properties/reverses_id"},reverses_identifier:{description:"Reverses identifier if transfer reverses another transfer",type:"string"},balance_id:{description:"Iterator marking the position of the balance in the continuum",type:["number","null"]},balance_pending:{description:"Wallet pending balance after transfer",type:["number","null"]},balance_pending_to:{description:"Wallet pending_to balance after transfer",type:["number","null"]},balance_pending_from:{description:"Wallet pending_from balance after transfer",type:["number","null"]},balance_finished:{description:"Wallet finished balance after transfer",type:["number","null"]},signed_amount:{description:"amount with a sign according to transfer direction",type:["number","null"]},status_finalized_at:{description:"DateTime transfer reached final status",type:["string","null"],format:"date-time"}},additionalProperties:!1,required:["id","identifier","from_wallet_id","from_wallet_foreign","to_wallet_id","to_wallet_foreign","token_id","token_foreign","amount","type","status","force","created_at"]},transfer_optional:{type:"object",description:"requested transfer",properties:{id:{$ref:"/db/transfer/transfer.schema.json#/properties/id"},identifier:{$ref:"/db/transfer/transfer.schema.json#/properties/identifier"},control_hash:{$ref:"/db/transfer/transfer.schema.json#/properties/control_hash"},from_wallet_id:{$ref:"/db/transfer/transfer.schema.json#/properties/from_wallet_id"},from_wallet_foreign:{$ref:"/db/wallet/wallet.schema.json#/properties/foreign"},to_wallet_id:{$ref:"/db/transfer/transfer.schema.json#/properties/to_wallet_id"},to_wallet_foreign:{$ref:"/db/wallet/wallet.schema.json#/properties/foreign"},token_id:{$ref:"/db/transfer/transfer.schema.json#/properties/token_id"},token_foreign:{$ref:"/db/token/token.schema.json#/properties/foreign"},amount:{$ref:"/db/transfer/transfer.schema.json#/properties/amount"},type:{$ref:"/db/transfer/transfer.schema.json#/properties/type"},status:{$ref:"/db/transfer/transfer.schema.json#/properties/status"},force:{$ref:"/db/transfer/transfer.schema.json#/properties/force"},auto_hash:{$ref:"/db/transfer/transfer.schema.json#/properties/auto_hash"},created_at:{$ref:"/db/transfer/transfer.schema.json#/properties/created_at"},updated_at:{$ref:"/db/transfer/transfer.schema.json#/properties/updated_at"},metadata:{$ref:"/db/transfer/transfer.schema.json#/properties/metadata"},transfer_group_id:{$ref:"/db/transfer/transfer.schema.json#/properties/transfer_group_id"},transfer_group_identifier:{description:"Transfer Group identifier if transfer belongs to a group",type:"string"},reverses_id:{$ref:"/db/transfer/transfer.schema.json#/properties/reverses_id"},balance_id:{description:"Iterator marking the position of the balance in the continuum",type:["number","null"]},balance_pending:{description:"Wallet pending balance after transfer",type:["number","null"]},balance_pending_to:{description:"Wallet pending_to balance after transfer",type:["number","null"]},balance_pending_from:{description:"Wallet pending_from balance after transfer",type:["number","null"]},balance_finished:{description:"Wallet finished balance after transfer",type:["number","null"]},signed_amount:{description:"amount with a sign according to transfer direction",type:["number","null"]},status_finalized_at:{description:"DateTime transfer reached final status",type:["string","null"],format:"date-time"}},additionalProperties:!1}},nz=!1,su={$schema:J7,$id:X7,title:Y7,description:Z7,type:ez,properties:tz,definitions:rz,additionalProperties:nz};var az="http://json-schema.org/draft-07/schema",sz="GetTransferGroupTxInput",iz="GetTransferGroupTxInput",oz="Input for getTransferGroup",pz="object",fz={transfer_group:{$ref:"#/definitions/unique_transfer_group_filter"},options:{$ref:"#/definitions/get_transfer_group_tx_options"}},uz={get_transfer_group_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/get_transfer_group_additional_options"}]},get_transfer_group_additional_options:{description:"Optional flags for input",type:"object",properties:{create_if_not_exists:{type:"boolean",description:"If true then the transfer_group will be created if not found. Only valid with 'identifier'",default:!1},return_only_id:{type:"boolean",description:"If true then the returning object is only guaranteed to have id",default:!1}},default:{},$typescript:'{"additionalProperties": false}'},unique_transfer_group_filter:{description:"UNIQUE filtering options for transfer",anyOf:[{$ref:"#/definitions/unique_transfer_group_filter_id"},{$ref:"#/definitions/unique_transfer_group_filter_identifier"}]},unique_transfer_group_filter_id:{type:"object",description:"ID based filter of transfer",properties:{id:{description:"Id of transfer_group to return",$ref:"/db/transfer-group/transfer-group.schema.json#/properties/id"},identifier:{description:"Identifier of transfer_group to return",$ref:"/db/transfer-group/transfer-group.schema.json#/properties/identifier"}},required:["id"],additionalProperties:!1},unique_transfer_group_filter_identifier:{type:"object",description:"identifier based filter of transfer",properties:{id:{description:"Id of transfer_group to return",$ref:"/db/transfer-group/transfer-group.schema.json#/properties/id"},identifier:{description:"Identifier of transfer_group to return",$ref:"/db/transfer-group/transfer-group.schema.json#/properties/identifier"}},required:["identifier"],additionalProperties:!1}},dz=["transfer_group"],lz=!1,iu={$schema:az,$id:sz,title:iz,description:oz,type:pz,properties:fz,definitions:uz,required:dz,additionalProperties:lz};var cz="http://json-schema.org/draft-07/schema",mz="GetTransferGroupTxOutput",hz="GetTransferGroupTxOutput",gz="Output of getTransferGroup",_z="object",Tz={transfer_group:{$ref:"#/definitions/transfer_group"}},yz={transfer_group:{description:"requested transfer_group",properties:{id:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/id"},identifier:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/identifier"},status:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/status"},transfer_status:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/transfer_status"},metadata:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/metadata"},created_at:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/created_at"},updated_at:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/updated_at"},reverses_id:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/reverses_id"},status_finalized_at:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/status_finalized_at"},transfer_status_finalized_at:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/transfer_status_finalized_at"},type:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/type"},validate_final_balance_only:{$ref:"/db/transfer-group/transfer-group.schema.json#/properties/validate_final_balance_only"},reverses_identifier:{description:"Identifier of the transfer group this reverses",type:["string","null"]}},additionalProperties:!1,required:["id"]}},bz=!1,ou={$schema:cz,$id:mz,title:hz,description:gz,type:_z,properties:Tz,definitions:yz,additionalProperties:bz};var xz="http://json-schema.org/draft-07/schema",Fz="GetWalletTxInput",wz="GetWalletTxInput",$z="Input for getWallet",Oz="object",vz={wallet:{$ref:"#/definitions/unique_wallet_filter"},options:{$ref:"#/definitions/get_wallet_tx_options"}},jz={get_wallet_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/get_wallet_additional_options"}]},get_wallet_additional_options:{description:"Optional flags for input",type:"object",properties:{ignore_cache:{type:"boolean",default:!1},create_if_not_exists:{type:"boolean",description:"If true then the wallet will be created if not found. Only valid with 'foreign'",default:!1},return_only_id:{type:"boolean",description:"If true then the returning object is only guaranteed to have id",default:!1}},default:{},$typescript:'{"additionalProperties": false}'},unique_wallet_filter:{type:"object",description:"UNIQUE filtering options for wallet",anyOf:[{$ref:"#/definitions/unique_wallet_filter_id"},{$ref:"#/definitions/unique_wallet_filter_foreign"}]},unique_wallet_filter_id:{type:"object",description:"ID based filter for wallet",properties:{id:{description:"Id of wallet to return",$ref:"/db/wallet/wallet.schema.json#/properties/id"},foreign:{description:"Foreign of wallet to return",$ref:"/db/wallet/wallet.schema.json#/properties/name"}},required:["id"],additionalProperties:!1},unique_wallet_filter_foreign:{type:"object",description:"Foreign based filter for wallet",properties:{id:{description:"Id of wallet to return",$ref:"/db/wallet/wallet.schema.json#/properties/id"},foreign:{description:"Foreign of wallet to return",$ref:"/db/wallet/wallet.schema.json#/properties/name"}},required:["foreign"],additionalProperties:!1}},Iz=["wallet"],kz=!1,pu={$schema:xz,$id:Fz,title:wz,description:$z,type:Oz,properties:vz,definitions:jz,required:Iz,additionalProperties:kz};var Sz="http://json-schema.org/draft-07/schema",Cz="GetWalletTxOutput",Pz="GetWalletTxOutput",Gz="Output of getWallet",Dz="object",Mz={wallet:{description:"requested wallet",anyOf:[{$ref:"/db/wallet/wallet.schema.json"},{$ref:"/db/wallet/wallet.schema.optional.json"}]}},Wz=!1,fu={$schema:Sz,$id:Cz,title:Pz,description:Gz,type:Dz,properties:Mz,additionalProperties:Wz};var Ez="http://json-schema.org/draft-07/schema",Rz="GetWalletManyTxInput",Az="GetWalletManyTxInput",Uz="Input for getWalletMany",qz="object",Nz={wallets:{type:"array",items:{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"}},options:{$ref:"#/definitions/get_wallet_many_tx_options"}},Bz={get_wallet_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/get_wallet_many_additional_options"}]},get_wallet_many_additional_options:{description:"Optional flags for input",type:"object",properties:{ignore_cache:{type:"boolean",default:!1},create_if_not_exists:{type:"boolean",description:"If true then the wallet will be created if not found. Only valid with 'foreign'",default:!1},return_only_id:{type:"boolean",description:"If true then the returning object is only guaranteed to have id",default:!1}},default:{},$typescript:'{"additionalProperties": false}'}},Lz=!1,uu={$schema:Ez,$id:Rz,title:Az,description:Uz,type:qz,properties:Nz,definitions:Bz,additionalProperties:Lz};var Vz="http://json-schema.org/draft-07/schema",Hz="GetWalletManyTxOutput",zz="GetWalletManyTxOutput",Kz="Output of getWalletMany",Qz="object",Jz={wallets:{type:"array",items:{$ref:"#/definitions/WalletResult"}}},Xz={WalletResult:{anyOf:[{$ref:"/db/wallet/wallet.schema.json"},{$ref:"/db/wallet/wallet.schema.optional.json"},{type:"null"}]}},Yz=["wallets"],Zz=!1,du={$schema:Vz,$id:Hz,title:zz,description:Kz,type:Qz,properties:Jz,definitions:Xz,required:Yz,additionalProperties:Zz};var eK="http://json-schema.org/draft-07/schema",tK="ImportActionsTxInput",rK="ImportActionsTxInput",nK="Input for importActions",aK="object",sK={actions:{type:"array",items:{$ref:"#/definitions/import_actions_tx_stream_chunk"}},options:{$ref:"#/definitions/import_actions_tx_options"}},iK=["actions"],oK={import_actions_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"}]},import_actions_tx_stream_chunk:{type:"object",anyOf:[{$ref:"#/definitions/import_action_wallet"},{$ref:"#/definitions/import_action_token"},{$ref:"#/definitions/import_action_transfer_group"},{$ref:"#/definitions/import_action_transfer"}]},import_action_wallet:{type:"object",properties:{target:{description:"Target of the action",type:"string",enum:["wallet"]},data:{$ref:"/db/wallet/wallet.schema.input.json"}},required:["target","data"],additionalProperties:!1},import_action_token:{type:"object",properties:{target:{description:"Target of the action",type:"string",enum:["token"]},data:{$ref:"/txs/create-token/create-token.schema.input.json#/definitions/create_token_input"}},required:["target","data"],additionalProperties:!1},import_action_transfer_group_extension:{type:"object",properties:{created_at:{type:"string",format:"date-time"},status_finalized_at:{type:"string",format:"date-time"},transfer_status_finalized_at:{type:"string",format:"date-time"}},$typescript:'{"additionalProperties": false}'},import_action_transfer_group_data:{allOf:[{$ref:"/txs/create-transfer-group/create-transfer-group.schema.input.json#/definitions/transfer_group_data"},{$ref:"#/definitions/import_action_transfer_group_extension"}]},import_action_transfer_group:{type:"object",properties:{target:{description:"Target of the action",type:"string",enum:["transfer_group"]},data:{allOf:[{$ref:"#/definitions/import_action_transfer_group_data"}]}},required:["target","data"],additionalProperties:!1},import_action_transfer_data:{anyOf:[{$ref:"#/definitions/import_action_transfer_data_regular"},{$ref:"#/definitions/import_action_transfer_data_deposit"},{$ref:"#/definitions/import_action_transfer_data_withdrawal"}]},import_action_transfer_data_regular:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},from_wallet:{description:"Wallet where funds are debited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_wallet:{description:"Wallet where funds are credited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{description:"Token that is moved",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},amount:{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},type:{description:"Type of transfer",enum:["transfer"]},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},status:{$ref:"/db/consts.schema.json#/definitions/TransferStatus"},transfer_group:{description:"TransferGroup the transfer belongs to",$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"},created_at:{type:"string",format:"date-time"},status_finalized_at:{type:"string",format:"date-time"}},required:["from_wallet","to_wallet","token","amount","type"],$typescript:'{"additionalProperties": false}'},import_action_transfer_data_deposit:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},from_wallet:{description:"Wallet where funds are debited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_wallet:{description:"Wallet where funds are credited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{description:"Token that is moved",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},amount:{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},type:{description:"Type of transfer",enum:["deposit"]},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},status:{$ref:"/db/consts.schema.json#/definitions/TransferStatus"},transfer_group:{description:"TransferGroup the transfer belongs to",$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"},created_at:{type:"string",format:"date-time"},status_finalized_at:{type:"string",format:"date-time"}},required:["to_wallet","token","amount"],$typescript:'{"additionalProperties": false}'},import_action_transfer_data_withdrawal:{type:"object",properties:{identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},from_wallet:{description:"Wallet where funds are debited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},to_wallet:{description:"Wallet where funds are credited",$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},token:{description:"Token that is moved",$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},amount:{$ref:"/db/transfer/transfer.schema.input.json#/properties/amount"},type:{description:"Type of transfer",enum:["withdrawal"]},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},status:{$ref:"/db/consts.schema.json#/definitions/TransferStatus"},transfer_group:{description:"TransferGroup the transfer belongs to",$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"},created_at:{type:"string",format:"date-time"},status_finalized_at:{type:"string",format:"date-time"}},required:["from_wallet","token","amount"],$typescript:'{"additionalProperties": false}'},import_action_transfer:{type:"object",properties:{target:{description:"Target of the action",type:"string",enum:["transfer"]},data:{allOf:[{$ref:"#/definitions/import_action_transfer_data"}]}},required:["target","data"],additionalProperties:!1}},pK="import_actions_tx_stream_chunk",fK=!1,Us={$schema:eK,$id:tK,title:rK,description:nK,type:aK,properties:sK,required:iK,definitions:oK,$allowStreamInput:pK,additionalProperties:fK};var uK="http://json-schema.org/draft-07/schema",dK="ImportActionsTxOutput",lK="ImportActionsTxOutput",cK="Output of importActions",mK="object",hK={progress:{type:"array"},erroneous:{type:"array"}},gK=!1,lu={$schema:uK,$id:dK,title:lK,description:cK,type:mK,properties:hK,additionalProperties:gK};var _K="http://json-schema.org/draft-07/schema",TK="ImportDatabaseTxInput",yK="ImportDatabaseTxInput",bK="Input for importDatabase",xK="object",FK={name:{type:"string"}},wK={},$K=!1,cu={$schema:_K,$id:TK,title:yK,description:bK,type:xK,properties:FK,definitions:wK,additionalProperties:$K};var OK="http://json-schema.org/draft-07/schema",vK="ImportDatabaseTxOutput",jK="ImportDatabaseTxOutput",IK="Output of importDatabase",kK="object",SK={message:{type:"string"}},CK=!1,mu={$schema:OK,$id:vK,title:jK,description:IK,type:kK,properties:SK,additionalProperties:CK};var PK="http://json-schema.org/draft-07/schema",GK="ListDatabaseExportsTxInput",DK="ListDatabaseExportsTxInput",MK="Input for listDatabaseExports",WK="object",EK={},RK={},AK=!1,hu={$schema:PK,$id:GK,title:DK,description:MK,type:WK,properties:EK,definitions:RK,additionalProperties:AK};var UK="http://json-schema.org/draft-07/schema",qK="ListDatabaseExportsTxOutput",NK="ListDatabaseExportsTxOutput",BK="Output of listDatabaseExports",LK="object",VK={exports:{type:"array",items:{type:"string"}}},HK=!1,gu={$schema:UK,$id:qK,title:NK,description:BK,type:LK,properties:VK,additionalProperties:HK};var zK="http://json-schema.org/draft-07/schema",KK="QueryTxInput",QK="QueryTxInput",JK="Input for query",XK="object",YK={query:{description:"SELECT query",type:"string"},params:{description:"Parameters for the query",type:"array"},options:{$ref:"#/definitions/query_tx_options"}},ZK={query_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options_without_tx"}]}},e3=["query","params"],t3=!1,_u={$schema:zK,$id:KK,title:QK,description:JK,type:XK,properties:YK,definitions:ZK,required:e3,additionalProperties:t3};var r3="http://json-schema.org/draft-07/schema",n3="QueryTxOutput",a3="QueryTxOutput",s3="Output of query",i3="object",o3={results:{description:"The query results",type:"array"}},p3=["results"],f3=!1,Tu={$schema:r3,$id:n3,title:a3,description:s3,type:i3,properties:o3,required:p3,additionalProperties:f3};var u3="http://json-schema.org/draft-07/schema",d3="QueryLogsTxInput",l3="QueryLogsTxInput",c3="Input for queryLogs",m3="object",h3={startTime:{description:"Log entries start time",type:"string"},endTime:{description:"Log entries end time",type:"string"},tracking_id:{type:"string"},level:{type:"string",enum:["debug","info","warning","error"]},options:{$ref:"#/definitions/query_logs_tx_options"}},g3={query_logs_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/query_logs_additional_options"}]},query_logs_additional_options:{description:"Optional flags for input",type:"object",default:{exact_level:!1},properties:{exact_level:{description:"Should query be limited to exactly defined level or greater than",type:"boolean"}},$typescript:'{"additionalProperties":false}'}},_3=!1,yu={$schema:u3,$id:d3,title:l3,description:c3,type:m3,properties:h3,definitions:g3,additionalProperties:_3};var T3="http://json-schema.org/draft-07/schema",y3="QueryLogsTxOutput",b3="QueryLogsTxOutput",x3="Output of queryLogs",F3="object",w3={logs:{type:"array",items:{$ref:"#/definitions/query_log_entry"}}},$3={query_log_entry:{type:"object",properties:{level:{description:"Log level",type:"string",enum:["debug","info","warning","error"]},timestamp:{description:"Timestamp when log was created",type:"string"},payload:{description:"Log payload",type:"object"}},additionalProperties:!1}},O3=["logs"],v3=!1,bu={$schema:T3,$id:y3,title:b3,description:x3,type:F3,properties:w3,definitions:$3,required:O3,additionalProperties:v3};var j3="http://json-schema.org/draft-07/schema",I3="ResetDatabaseTxInput",k3="ResetDatabaseTxInput",S3="Input for resetDatabase",C3="object",P3={confirmation:{description:"hash to confirm database delete",type:"string"},version:{description:"target semver for the database",type:"string"},options:{$ref:"#/definitions/reset_database_tx_options"}},G3={reset_database_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options_without_tx"}]}},D3=!1,xu={$schema:j3,$id:I3,title:k3,description:S3,type:C3,properties:P3,definitions:G3,additionalProperties:D3};var M3="http://json-schema.org/draft-07/schema",W3="ResetDatabaseTxOutput",E3="ResetDatabaseTxOutput",R3="Output of resetDatabase",A3="object",U3={message:{description:"Message about operation",type:"string"},confirmation:{description:"confirmation hash to resend",type:"string"}},q3=!1,Fu={$schema:M3,$id:W3,title:E3,description:R3,type:A3,properties:U3,additionalProperties:q3};var N3="http://json-schema.org/draft-07/schema",B3="ReverseTransferTxInput",L3="ReverseTransferTxInput",V3="Input for reverseTransfer",H3="object",z3={transfer:{$ref:"/txs/get-transfer/get-transfer.schema.input.json#/definitions/unique_transfer_filter"},reverse:{$ref:"#/definitions/transfer_reverse_modifications"},options:{$ref:"#/definitions/reverse_transfer_tx_options"}},K3={reverse_transfer_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/reverse_transfer_additional_options"}]},reverse_transfer_additional_options:{description:"Optional flags for input",type:"object",default:{},properties:{reverse_deposit:{$id:"reverse_deposit",description:"Whether to create withdrawal transaction for deposit (will default to pending)",type:"boolean",default:!1},reverse_withdrawal:{$id:"reverse_withdrawal",description:"Whether to create deposit transaction for withdrawal (will default to pending)",type:"boolean",default:!1},return_from_balance:{$id:"return_from_balance",description:"Whether the request should also return from wallet balance",type:"boolean",default:!1},return_to_balance:{$id:"return_to_balance",description:"Whether the request should also return to wallet balance",type:"boolean",default:!1},metadata_action:{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action_for_reverse"}},$typescript:'{"additionalProperties": false}'},transfer_reverse_modifications:{description:"In case the transfer will be made then apply these modifications",type:"object",properties:{status:{$ref:"/db/transfer/transfer.schema.input.json#/properties/status"},identifier:{$ref:"/db/transfer/transfer.schema.input.json#/properties/identifier"},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},extend_metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"}},default:{},additionalProperties:!1}},Q3=["transfer"],J3=!1,wu={$schema:N3,$id:B3,title:L3,description:V3,type:H3,properties:z3,definitions:K3,required:Q3,additionalProperties:J3};var X3="http://json-schema.org/draft-07/schema",Y3="ReverseTransferTxOutput",Z3="ReverseTransferTxOutput",e5="Output of reverseTransfer",t5=[{$ref:"/txs/update-transfer/update-transfer.schema.output.json"}],$u={$schema:X3,$id:Y3,title:Z3,description:e5,allOf:t5};var r5="http://json-schema.org/draft-07/schema",n5="ReverseTransferGroupTxInput",a5="ReverseTransferGroupTxInput",s5="Input for reverseTransferGroup",i5="object",o5={transfer_group:{$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"},reverse:{$ref:"#/definitions/reverse_transfer_group_modifications"},options:{$ref:"#/definitions/reverse_transfer_group_tx_options"}},p5={reverse_transfer_group_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/reverse_transfer_group_additional_options"}]},reverse_transfer_group_additional_options:{description:"Optional flags for input",type:"object",default:{},properties:{reverse_deposit:{$id:"reverse_deposit",description:"Whether to create withdrawal transaction for deposits (will default to pending)",type:"boolean",default:!1},reverse_withdrawal:{$id:"reverse_withdrawal",description:"Whether to create deposit transaction for withdrawals (will default to pending)",type:"boolean",default:!1},return_transfers:{description:"Should the update return all transfers belonging to group",type:"boolean"},validate_final_balance_only:{type:"boolean",description:"If true then transfers within a group will ignore balance restrictions. Only final transfers for wallets are checked.",default:!1},metadata_action:{$id:"metadata_action",$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action_for_reverse"},transfer_metadata_action:{$id:"transfer_metadata_action",$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action_for_reverse"}},$typescript:'{"additionalProperties": false}'},reverse_transfer_group_modifications:{description:"In case the transferGroup will be made then apply these modifications",type:"object",properties:{status:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/status"},transfer_status:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/transfer_status"},identifier:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/identifier"},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/metadata"},transfer_metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},extend_metadata:{description:"Key value object to be merged with existing metadata",$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/metadata"},transfer_extend_metadata:{description:"Key value object to be merged with each transfers existing metadata",$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"}},default:{},additionalProperties:!1}},f5=!1,Ou={$schema:r5,$id:n5,title:a5,description:s5,type:i5,properties:o5,definitions:p5,additionalProperties:f5};var u5="http://json-schema.org/draft-07/schema",d5="ReverseTransferGroupTxOutput",l5="ReverseTransferGroupTxOutput",c5="Output of reverseTransferGroup",m5="object",h5={transfer_group:{$ref:"/db/transfer-group/transfer-group.schema.json"},transfers:{description:"Created transfer objects",type:"array",items:{$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"}}},g5=!1,vu={$schema:u5,$id:d5,title:l5,description:c5,type:m5,properties:h5,additionalProperties:g5};var _5="http://json-schema.org/draft-07/schema",T5="ReverseTransferGroupManyTxInput",y5="ReverseTransferGroupManyTxInput",b5="Input for reverseTransferGroupMany",x5="object",F5={transfer_group:{$ref:"/txs/find-transfer-group-many/find-transfer-group-many.schema.input.json#/definitions/find_transfer_group_many_filter"},reverse:{$ref:"#/definitions/reverse_transfer_group_many_modifications"},options:{$ref:"#/definitions/reverse_transfer_group_many_tx_options"}},w5={reverse_transfer_group_many_modifications:{description:"In case the transferGroup will be made then apply these modifications",type:"object",properties:{status:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/status"},transfer_status:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/transfer_status"},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/metadata"},transfer_metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"},extend_metadata:{description:"Key value object to be merged with existing metadata",$ref:"/db/transfer-group/transfer-group.schema.input.json#/properties/metadata"},transfer_extend_metadata:{description:"Key value object to be merged with each transfers existing metadata",$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"}},default:{},additionalProperties:!1},reverse_transfer_group_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"/txs/reverse-transfer-group/reverse-transfer-group.schema.input.json#/definitions/reverse_transfer_group_additional_options"}]},reverse_transfer_group_many_additional_options:{description:"Optional flags for input",type:"object",default:{},$typescript:'{"additionalProperties":false}'}},$5=["transfer_group"],O5=!1,ju={$schema:_5,$id:T5,title:y5,description:b5,type:x5,properties:F5,definitions:w5,required:$5,additionalProperties:O5};var v5="http://json-schema.org/draft-07/schema",j5="ReverseTransferGroupManyTxOutput",I5="ReverseTransferGroupManyTxOutput",k5="Output of reverseTransferGroupMany",S5="object",C5={transfer_groups:{description:"Reversed transfer groups",type:"array",items:{$ref:"/db/transfer-group/transfer-group.schema.json"}},transfers:{description:"Created transfer objects",type:"array",items:{$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"}}},P5=!1,Iu={$schema:v5,$id:j5,title:I5,description:k5,type:S5,properties:C5,additionalProperties:P5};var G5="http://json-schema.org/draft-07/schema",D5="ReverseTransferManyTxInput",M5="ReverseTransferManyTxInput",W5="Input for reverseTransferMany",E5="object",R5={transfer:{$ref:"/txs/find-transfer-many/find-transfer-many.schema.input.json#/definitions/find_transfer_many_filter"},reverse:{$ref:"#/definitions/reverse_transfer_many_modifications"},options:{$ref:"#/definitions/reverse_transfer_many_tx_options"}},A5={reverse_transfer_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/reverse_transfer_many_additional_options"}]},reverse_transfer_many_additional_options:{description:"Optional flags for input",type:"object",default:{},properties:{reverse_deposit:{$id:"reverse_deposit",description:"Whether to create withdrawal transaction for deposit (will default to pending)",type:"boolean",default:!1},reverse_withdrawal:{$id:"reverse_withdrawal",description:"Whether to create deposit transaction for withdrawal (will default to pending)",type:"boolean",default:!1},metadata_action:{$id:"metadata_action",$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action_for_reverse"}},$typescript:'{"additionalProperties": false}'},reverse_transfer_many_modifications:{description:"In case the transfer will be made then apply these modifications",type:"object",properties:{status:{$ref:"/db/transfer/transfer.schema.input.json#/properties/status"},force:{$ref:"/db/transfer/transfer.schema.input.json#/properties/force"},metadata:{$ref:"/db/transfer/transfer.schema.input.json#/properties/metadata"}},default:{},additionalProperties:!1}},U5=["transfer"],q5=!1,ku={$schema:G5,$id:D5,title:M5,description:W5,type:E5,properties:R5,definitions:A5,required:U5,additionalProperties:q5};var N5="http://json-schema.org/draft-07/schema",B5="ReverseTransferManyTxOutput",L5="ReverseTransferManyTxOutput",V5="Output of reverseTransferMany",H5={transfers:{description:"Created transfer array",type:"array",items:{$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"}}},z5=!1,Su={$schema:N5,$id:B5,title:L5,description:V5,properties:H5,additionalProperties:z5};var K5="http://json-schema.org/draft-07/schema",Q5="SetFlagsTxInput",J5="SetFlagsTxInput",X5="Input for setFlags",Y5="object",Z5={flags:{$ref:"/db/consts.schema.json#/definitions/Flags"},options:{$ref:"#/definitions/set_flags_tx_options"}},eQ={set_flags_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options_without_tx"}]}},tQ=["flags"],rQ=!1,Cu={$schema:K5,$id:Q5,title:J5,description:X5,type:Y5,properties:Z5,definitions:eQ,required:tQ,additionalProperties:rQ};var nQ="http://json-schema.org/draft-07/schema",aQ="SetFlagsTxOutput",sQ="SetFlagsTxOutput",iQ="Output of setFlags",oQ="object",pQ={flags:{$ref:"/db/consts.schema.json#/definitions/Flags"},message:{description:"optional message",type:"string"}},fQ=["flags"],uQ=!1,Pu={$schema:nQ,$id:aQ,title:sQ,description:iQ,type:oQ,properties:pQ,required:fQ,additionalProperties:uQ};var dQ="http://json-schema.org/draft-07/schema",lQ="StartTransactionTxInput",cQ="StartTransactionTxInput",mQ="Input for startTransaction",hQ="object",gQ={options:{$ref:"#/definitions/start_transaction_tx_options"}},_Q={start_transaction_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options_without_tx"}]}},TQ=!1,Gu={$schema:dQ,$id:lQ,title:cQ,description:mQ,type:hQ,properties:gQ,definitions:_Q,additionalProperties:TQ};var yQ="http://json-schema.org/draft-07/schema",bQ="StartTransactionTxOutput",xQ="StartTransactionTxOutput",FQ="Output of startTransaction",wQ="object",$Q={transaction_id:{type:"string"}},OQ=!1,Du={$schema:yQ,$id:bQ,title:xQ,description:FQ,type:wQ,properties:$Q,additionalProperties:OQ};var vQ="http://json-schema.org/draft-07/schema",jQ="TxConsts",IQ="Generics used by functions",kQ={i_tx_general_options_without_tx:{description:"Generic flags for input",type:"object",default:{},properties:{tracking_id:{description:"User provided id added to logs for debugging",type:"string"}},$typescript:'{"additionalProperties":false}'},i_tx_general_options:{description:"Generic flags for input",type:"object",default:{},properties:{transaction_id:{description:"Id of the transaction context to run the query in",type:"string"},tracking_id:{description:"User provided id added to logs for debugging",type:"string"}},$typescript:'{"additionalProperties":false}'},i_tx_metadata_options:{description:"Metadata flags for input",type:"object",default:{},properties:{return_metadata_total:{description:"Return the total rows count in metadata",type:"boolean"}},$typescript:'{"additionalProperties":false}'},i_tx_limiting_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags for input limiting",type:"object",properties:{limit:{description:"Number of records to return",type:"integer"},offset:{description:"Number of records to omit from the beginning",type:"integer"}},default:{limit:20,offset:0}},i_tx_ordering_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags for input ordering",type:"object",properties:{order:{description:"Ordering options",type:"array",items:{$ref:"#/definitions/i_tx_ordering_input"}}}},i_tx_select_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags to limit search result",type:"object",properties:{select:{description:"Select options",type:"array",items:{type:"string"}}}},i_tx_deselect_options:{$typescript:'{"additionalProperties":false}',description:"Optional flag to remove field from select",type:"object",properties:{deselect:{description:"Deselect options",type:"array",items:{type:"string"}}}},i_tx_aggregating_options:{$typescript:'{"additionalProperties":false}',description:"Optional flags to aggregate data",type:"object",properties:{aggregator:{$ref:"#/definitions/i_tx_aggregator"},aggregators:{type:"array",items:{$ref:"#/definitions/i_tx_aggregator"}},groups:{$ref:"#/definitions/i_tx_groups"}}},i_tx_find_metadata:{description:"Metadata about the search",type:"object",properties:{total:{description:"Total number of records matching the query",type:"integer"},offset:{description:"Current query offset",type:"integer"},limit:{description:"Current query limit",type:"integer"},more_rows:{description:"Boolean showing if there would be more rows to return with a higher offset/limit",type:"boolean"},order:{description:"Ordering options",type:"array",items:{$ref:"#/definitions/i_tx_ordering_input"}}},required:["offset","limit","more_rows"],additionalProperties:!1},i_tx_aggregating_metadata:{description:"Metadata about the aggregation",type:"object",properties:{aggregators:{type:"array",items:{$ref:"#/definitions/i_tx_aggregator"}},groups:{$ref:"#/definitions/i_tx_groups"}},required:["aggregators"],additionalProperties:!1},i_tx_ordering_input:{description:"Input for orderBy",type:"object",properties:{field:{description:"Field to order by",type:"string"},direction:{description:"Direction to order",default:"asc",type:"string",enum:["asc","desc"]},nulls:{description:"Should nulls be first or last",type:"string",enum:["first","last"]}},required:["field"],additionalProperties:!1},i_tx_groups:{type:"array",maxItems:5,items:{$ref:"#/definitions/i_tx_group"}},i_tx_group:{anyOf:[{$ref:"#/definitions/i_tx_group_period"},{$ref:"#/definitions/i_tx_group_field"},{$ref:"#/definitions/i_tx_group_metadata_field"}]},i_tx_group_period:{type:"object",properties:{type:{type:"string",enum:["period"]},field:{$ref:"#/definitions/i_tx_period"},alias:{type:"string"}},required:["type","field"],additionalProperties:!1},i_tx_group_field:{type:"object",properties:{type:{type:"string",enum:["field"]},field:{type:"string"},alias:{type:"string"}},required:["type","field"],additionalProperties:!1},i_tx_group_metadata_field:{type:"object",properties:{type:{type:"string",enum:["metadata_field"]},field:{type:"string"},alias:{type:"string"}},required:["type","field"],additionalProperties:!1},i_tx_period:{anyOf:[{$ref:"#/definitions/i_tx_period_simple"},{$ref:"#/definitions/i_tx_period_timezone"}]},i_tx_period_simple:{description:"Time period rows should be grouped by",type:"string",enum:["year","month","week","day","hour","minute"],default:"day"},i_tx_period_timezone:{type:"object",properties:{period:{$ref:"#/definitions/i_tx_period_simple"},timezone:{description:"",type:"string"}},required:["period","timezone"],additionalProperties:!1},i_tx_time_filter:{type:"object",properties:{start_time:{type:"string",format:"date-time"},end_time:{type:"string",format:"date-time"}},$typescript:'{"additionalProperties":false}'},i_tx_aggregator:{description:"Aggregator description",anyOf:[{$ref:"#/definitions/i_tx_aggregator_simple"},{$ref:"#/definitions/i_tx_aggregator_complex"}]},i_tx_aggregator_simple:{description:"Function to use for grouping",type:"string",enum:["count","countDistinct","sum","average","min","max"],default:"count"},i_tx_aggregator_complex:{description:"Function and field to group",type:"object",properties:{function:{$ref:"#/definitions/i_tx_aggregator_simple"},field:{description:"Field to group by",type:"string"},alias:{description:"Alias to group under",type:"string"}},$typescript:'{"additionalProperties":false}'},i_tx_aggregate_results:{type:"array",items:{$ref:"#/definitions/i_tx_aggregate_result"}},i_tx_aggregate_result:{type:"object",additionalProperties:{type:["string","number"]}},i_tx_distributor_leftover_rule:{description:"Rule for distribution grouping",type:"string",enum:["keep","random","largest","target"]},i_tx_metadata_action:{description:"Whether to replace or extend current metadata with new value",type:"string",enum:["replace","extend"],default:"replace"},i_tx_metadata_action_for_reverse:{description:"Whether to replace or extend current metadata with new value",type:"string",enum:["replace","replace_create_only","replace_cancel_only","extend","extend_create_only","extend_cancel_only"],default:"replace"}},Wu={$schema:vQ,$id:jQ,description:IQ,definitions:kQ};var SQ="http://json-schema.org/draft-07/schema",CQ="UpdateTokenTxInput",PQ="UpdateTokenTxInput",GQ="Input for updateToken",DQ="object",MQ={token:{$ref:"/txs/get-token/get-token.schema.input.json#/definitions/unique_token_filter"},update:{$ref:"#/definitions/update_token_fields"},options:{$ref:"#/definitions/update_token_tx_options"}},WQ={update_token_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/update_token_additional_options"}]},update_token_additional_options:{description:"Optional flags for input",type:"object",default:{},$typescript:'{"additionalProperties":false}',properties:{return_when_not_updated:{$id:"return_when_not_updated",description:"Whether the request should return the token object even if it was not updated",type:"boolean",default:!1}}},update_token_fields:{type:"object",$typescript:'{"additionalProperties":false}',properties:{metadata:{$ref:"/db/token/token.schema.json#/properties/metadata"},public:{$ref:"/db/token/token.schema.json#/properties/public"},status:{$ref:"/db/token/token.schema.json#/properties/status"}}}},EQ=["token"],RQ=!1,Eu={$schema:SQ,$id:CQ,title:PQ,description:GQ,type:DQ,properties:MQ,definitions:WQ,required:EQ,additionalProperties:RQ};var AQ="http://json-schema.org/draft-07/schema",UQ="UpdateTokenTxOutput",qQ="UpdateTokenTxOutput",NQ="Output of updateToken",BQ="object",LQ={token:{description:"Token object",$ref:"/db/token/token.schema.json"},updated:{description:"Boolean showing if the token was updated",type:"boolean"}},VQ=!1,Ru={$schema:AQ,$id:UQ,title:qQ,description:NQ,type:BQ,properties:LQ,additionalProperties:VQ};var HQ="http://json-schema.org/draft-07/schema",zQ="UpdateTransferTxInput",KQ="UpdateTransferTxInput",QQ="Input for updateTransfer",JQ="object",XQ={transfer:{$ref:"/txs/get-transfer/get-transfer.schema.input.json#/definitions/unique_transfer_filter"},update:{$ref:"#/definitions/update_transfer_fields"},options:{$ref:"#/definitions/update_transfer_tx_options"}},YQ={update_transfer_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/update_transfer_additional_options"}]},update_transfer_additional_options:{description:"Optional flags for input",type:"object",default:{},properties:{return_from_balance:{$id:"return_from_balance",description:"Whether the request should also return from wallet balance",type:"boolean",default:!1},return_to_balance:{$id:"return_to_balance",description:"Whether the request should also return to wallet balance",type:"boolean",default:!1},return_when_not_updated:{$id:"return_when_not_updated",description:"Whether the request should return the transfer object even if it was not updated",type:"boolean",default:!1},metadata_action:{$id:"metadata_action",$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action"}},$typescript:'{"additionalProperties": false}'},update_transfer_fields:{type:"object",properties:{status:{description:"Status the transfer should be set as. Only pending transfers can be updated",default:"finished",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},metadata:{$ref:"/db/transfer/transfer.schema.json#/properties/metadata"},extend_metadata:{$ref:"/db/transfer/transfer.schema.json#/properties/metadata"},updated_at:{$ref:"/db/transfer/transfer.schema.json#/properties/updated_at"}},default:{status:"finished"},additionalProperties:!1}},ZQ=["transfer"],e8=!1,Au={$schema:HQ,$id:zQ,title:KQ,description:QQ,type:JQ,properties:XQ,definitions:YQ,required:ZQ,additionalProperties:e8};var t8="http://json-schema.org/draft-07/schema",r8="UpdateTransferTxOutput",n8="UpdateTransferTxOutput",a8="Output of updateTransfer",s8="object",i8={transfer:{description:"Updated transfer object",$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"},updated:{description:"Boolean showing if the transfer was updated",type:"boolean"},from_balance:{description:"Debited wallet balance",$ref:"/txs/get-balance/get-balance.schema.output.json#/definitions/balance"},to_balance:{description:"Credited wallet balance",$ref:"/txs/get-balance/get-balance.schema.output.json#/definitions/balance"}},o8=!1,Uu={$schema:t8,$id:r8,title:n8,description:a8,type:s8,properties:i8,additionalProperties:o8};var p8="http://json-schema.org/draft-07/schema",f8="UpdateTransferGroupTxInput",u8="UpdateTransferGroupTxInput",d8="Input for updateTransferGroup",l8="object",c8={transfer_group:{$ref:"/txs/get-transfer-group/get-transfer-group.schema.input.json#/definitions/unique_transfer_group_filter"},update:{$ref:"#/definitions/update_transfer_group_data"},options:{$ref:"#/definitions/update_transfer_group_tx_options"}},m8={update_transfer_group_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options_without_tx"},{$ref:"#/definitions/update_transfer_group_additional_options"}]},update_transfer_group_additional_options:{description:"Optional flags for input",type:"object",default:{},properties:{return_transfers:{description:"Should the update return all transfers belonging to group",type:"boolean"},return_when_not_updated:{$id:"return_to_balance",description:"Whether the request should return the transfer_group object even if it was not updated",type:"boolean",default:!1},metadata_action:{$id:"metadata_action",$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action"},transfer_metadata_action:{$id:"transfer_metadata_action",$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action"}},$typescript:'{"additionalProperties": false}'},update_transfer_group_data:{anyOf:[{$ref:"#/definitions/update_transfer_group_status"},{$ref:"#/definitions/update_transfer_group_transfer_status"}]},update_transfer_group_status:{type:"object",properties:{status:{description:"Lifecycle status of the TransferGroup",$ref:"/db/consts.schema.json#/definitions/TransferGroupStatus"},transfer_status:{description:"Status all the transfers should be set at.",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},metadata:{description:"Key value object to be replaced or extended with existing TransferGroup metadata",$ref:"/db/transfer/transfer.schema.json#/properties/metadata"},transfer_metadata:{description:"Key value object to be replaced or extended with existing Transfer metadata",$ref:"/db/transfer/transfer.schema.json#/properties/metadata"}},required:["status"],additionalProperties:!1},update_transfer_group_transfer_status:{type:"object",properties:{status:{description:"Lifecycle status of the TransferGroup",$ref:"/db/consts.schema.json#/definitions/TransferGroupStatus"},transfer_status:{description:"Status all the transfers should be set at. Changing transfer_status will also close the group",$ref:"/db/consts.schema.json#/definitions/TransferStatus"},metadata:{description:"Key value object to be replaced or extended with existing TransferGroup metadata",$ref:"/db/transfer/transfer.schema.json#/properties/metadata"},transfer_metadata:{description:"Key value object to be replaced or extended with existing Transfer metadata",$ref:"/db/transfer/transfer.schema.json#/properties/metadata"}},required:["transfer_status"],additionalProperties:!1}},h8=["transfer_group"],g8=!1,qu={$schema:p8,$id:f8,title:u8,description:d8,type:l8,properties:c8,definitions:m8,required:h8,additionalProperties:g8};var _8="http://json-schema.org/draft-07/schema",T8="UpdateTransferGroupTxOutput",y8="UpdateTransferGroupTxOutput",b8="Output of updateTransferGroup",x8="object",F8={transfer_group:{$ref:"/db/transfer-group/transfer-group.schema.json"},updated:{description:"Boolean showing if the transfer_group was updated",type:"boolean"},transfers:{description:"Updated transfers",type:"array",items:{$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"}}},w8=!1,Nu={$schema:_8,$id:T8,title:y8,description:b8,type:x8,properties:F8,additionalProperties:w8};var $8="http://json-schema.org/draft-07/schema",O8="UpdateTransferGroupManyTxInput",v8="UpdateTransferGroupManyTxInput",j8="Input for updateTransferGroupMany",I8="object",k8={transfer_group:{$ref:"/txs/find-transfer-group-many/find-transfer-group-many.schema.input.json#/definitions/find_transfer_group_many_filter"},update:{$ref:"/txs/update-transfer-group/update-transfer-group.schema.input.json#/definitions/update_transfer_group_data"},options:{$ref:"/txs/update-transfer-group/update-transfer-group.schema.input.json#/definitions/update_transfer_group_tx_options"}},S8={update_transfer_group_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/update_transfer_group_many_additional_options"}]},update_transfer_group_many_additional_options:{description:"Optional flags for input",type:"object",default:{},$typescript:'{"additionalProperties":false}'}},C8=["transfer_group"],P8=!1,Bu={$schema:$8,$id:O8,title:v8,description:j8,type:I8,properties:k8,definitions:S8,required:C8,additionalProperties:P8};var G8="http://json-schema.org/draft-07/schema",D8="UpdateTransferGroupManyTxOutput",M8="UpdateTransferGroupManyTxOutput",W8="Output of updateTransferGroupMany",E8="object",R8={transfer_groups:{description:"Updated transfer groups",type:"array",items:{$ref:"/db/transfer-group/transfer-group.schema.json"}},updated:{description:"Boolean showing if the transfer_group was updated",type:"boolean"},transfers:{description:"Updated transfers",type:"array",items:{$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"}}},A8=["transfer_groups"],U8=!1,Lu={$schema:G8,$id:D8,title:M8,description:W8,type:E8,properties:R8,required:A8,additionalProperties:U8};var q8="http://json-schema.org/draft-07/schema",N8="UpdateTransferManyTxInput",B8="UpdateTransferManyTxInput",L8="Input for updateTransferMany",V8="object",H8={transfer:{$ref:"/txs/find-transfer-many/find-transfer-many.schema.input.json#/definitions/find_transfer_many_filter"},update:{$ref:"/txs/update-transfer/update-transfer.schema.input.json#/definitions/update_transfer_fields"},options:{$ref:"#/definitions/update_transfer_many_tx_options"}},z8={update_transfer_many_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options_without_tx"},{$ref:"#/definitions/update_transfer_many_additional_options"}]},update_transfer_many_additional_options:{description:"Optional flags for input",type:"object",default:{},properties:{metadata_action:{$id:"metadata_action",$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_metadata_action"}},$typescript:'{"additionalProperties": false}'}},K8=["transfer","update"],Q8=!1,Vu={$schema:q8,$id:N8,title:B8,description:L8,type:V8,properties:H8,definitions:z8,required:K8,additionalProperties:Q8};var J8="http://json-schema.org/draft-07/schema",X8="UpdateTransferManyTxOutput",Y8="UpdateTransferManyTxOutput",Z8="Output of updateTransferMany",e6="object",t6={transfers:{description:"Updated transfers array",type:"array",items:{$ref:"/txs/get-transfer/get-transfer.schema.output.json#/definitions/transfer"}},updated:{description:"Boolean showing if the transfers were updated",type:"boolean"}},r6=!1,Hu={$schema:J8,$id:X8,title:Y8,description:Z8,type:e6,properties:t6,additionalProperties:r6};var n6="http://json-schema.org/draft-07/schema",a6="UpdateWalletTxInput",s6="UpdateWalletTxInput",i6="Input for updateWallet",o6="object",p6={wallet:{$ref:"/txs/get-wallet/get-wallet.schema.input.json#/definitions/unique_wallet_filter"},update:{$ref:"#/definitions/update_wallet_fields"},options:{$ref:"#/definitions/update_wallet_tx_options"}},f6={update_wallet_tx_options:{allOf:[{$ref:"/txs/tx-consts.schema.json#/definitions/i_tx_general_options"},{$ref:"#/definitions/update_wallet_additional_options"}]},update_wallet_additional_options:{description:"Optional flags for input",type:"object",default:{},properties:{return_when_not_updated:{description:"Whether the request should return the wallet object even if it was not updated",type:"boolean",default:!1}},$typescript:'{"additionalProperties":false}'},update_wallet_fields:{type:"object",properties:{metadata:{$ref:"/db/wallet/wallet.schema.json#/properties/metadata"},name:{$ref:"/db/wallet/wallet.schema.json#/properties/name"},status:{$ref:"/db/wallet/wallet.schema.json#/properties/status"}},$typescript:'{"additionalProperties":false}'}},u6=["wallet"],d6=!1,zu={$schema:n6,$id:a6,title:s6,description:i6,type:o6,properties:p6,definitions:f6,required:u6,additionalProperties:d6};var l6="http://json-schema.org/draft-07/schema",c6="UpdateWalletTxOutput",m6="UpdateWalletTxOutput",h6="Output of updateWallet",g6="object",_6={wallet:{description:"Wallet object",anyOf:[{$ref:"/db/wallet/wallet.schema.json"},{$ref:"/db/wallet/wallet.schema.optional.json"}]},updated:{description:"Boolean showing if the wallet was updated",type:"boolean"}},T6=!1,Ku={$schema:l6,$id:c6,title:m6,description:h6,type:g6,properties:_6,additionalProperties:T6};var m=new cx.default({removeAdditional:!0,useDefaults:!0,coerceTypes:!0,formats:{validkey:/^[A-Za-z_][A-Za-z0-9_-]+?$/},strict:!1});m.addFormat("date-time",{validate:RT});function kh(t,e){if(e!==void 0)return new Ne({message:e,data:t})}function mx(t){return function(e){if(t===void 0)return{isValid:!1,inputCopy:e,error:kh([new Error("Undefined validator")],"Undefined validator")};try{let r=Pd(e),n=t(r),a=n?void 0:t.errors,s=n?void 0:m.errorsText(a),i=kh(a,s);return{isValid:n,inputCopy:r,error:i}}catch(r){return{isValid:!1,inputCopy:e,error:kh([r],r.message)}}}}function g(t,e){let r=JSON.parse(JSON.stringify(t));return hx(r,e)}function hx(t,e){return typeof t!="object"||Object.keys(t).forEach(r=>{r==="$ref"&&t.$ref.startsWith("#")?t.$ref=e+t.$ref:t[r]=hx(t[r],e)}),t}function gx(t,e){let r=g(t,e),n=r.properties.options;return P({$id:r.$id.replace("Input","Options"),definitions:r.definitions},n)}function _x(t,e){let r=g(t,e),n=r.definitions[t.$allowStreamInput];return P({$id:r.$id.replace("Input","StreamChunk"),definitions:r.definitions},n)}var h={};m.addSchema(g(yh,"/api/jsonrpc/jsonrpc.request.schema.json"),"/api/jsonrpc/jsonrpc.request.schema.json");h.JSONRPCRequest=yh;m.addSchema(g(bh,"/api/jsonrpc/jsonrpc.response.schema.json"),"/api/jsonrpc/jsonrpc.response.schema.json");h.JSONRPCResponse=bh;m.addSchema(g(xh,"/client-options.schema.json"),"/client-options.schema.json");h.ClientOptions=xh;m.addSchema(g(cs,"/db/consts.schema.json"),"/db/consts.schema.json");h.Consts=cs;m.addSchema(g(vo,"/db/token/token.schema.input.json"),"/db/token/token.schema.input.json");h.TokenTableInput=vo;m.addSchema(g(jo,"/db/token/token.schema.json"),"/db/token/token.schema.json");h.TokenTable=jo;m.addSchema(g(Fh,"/db/token/token.schema.optional.json"),"/db/token/token.schema.optional.json");h.TokenTableOptional=Fh;m.addSchema(g(Io,"/db/transfer/transfer.schema.input.json"),"/db/transfer/transfer.schema.input.json");h.TransferTableInput=Io;m.addSchema(g(ko,"/db/transfer/transfer.schema.json"),"/db/transfer/transfer.schema.json");h.TransferTable=ko;m.addSchema(g(wh,"/db/transfer/transfer.schema.optional.json"),"/db/transfer/transfer.schema.optional.json");h.TransferTableOptional=wh;m.addSchema(g(So,"/db/transfer-group/transfer-group.schema.input.json"),"/db/transfer-group/transfer-group.schema.input.json");h.TransferGroupTableInput=So;m.addSchema(g(Co,"/db/transfer-group/transfer-group.schema.json"),"/db/transfer-group/transfer-group.schema.json");h.TransferGroupTable=Co;m.addSchema(g($h,"/db/transfer-group/transfer-group.schema.optional.json"),"/db/transfer-group/transfer-group.schema.optional.json");h.TransferGroupTableOptional=$h;m.addSchema(g(Po,"/db/transfer-log/transfer-log.schema.input.json"),"/db/transfer-log/transfer-log.schema.input.json");h.TransferLogTableInput=Po;m.addSchema(g(Go,"/db/transfer-log/transfer-log.schema.json"),"/db/transfer-log/transfer-log.schema.json");h.TransferLogTable=Go;m.addSchema(g(Oh,"/db/transfer-log/transfer-log.schema.optional.json"),"/db/transfer-log/transfer-log.schema.optional.json");h.TransferLogTableOptional=Oh;m.addSchema(g(Do,"/db/wallet/wallet.schema.input.json"),"/db/wallet/wallet.schema.input.json");h.WalletTableInput=Do;m.addSchema(g(Mo,"/db/wallet/wallet.schema.json"),"/db/wallet/wallet.schema.json");h.WalletTable=Mo;m.addSchema(g(vh,"/db/wallet/wallet.schema.optional.json"),"/db/wallet/wallet.schema.optional.json");h.WalletTableOptional=vh;m.addSchema(g(Wo,"/db/wallet-token-setting/wallet-token-setting.schema.input.json"),"/db/wallet-token-setting/wallet-token-setting.schema.input.json");h.WalletTokenSettingTableInput=Wo;m.addSchema(g(Eo,"/db/wallet-token-setting/wallet-token-setting.schema.json"),"/db/wallet-token-setting/wallet-token-setting.schema.json");h.WalletTokenSettingTable=Eo;m.addSchema(g(jh,"/db/wallet-token-setting/wallet-token-setting.schema.optional.json"),"/db/wallet-token-setting/wallet-token-setting.schema.optional.json");h.WalletTokenSettingTableOptional=jh;m.addSchema(g(Ro,"/db/wapi-setting/wapi-setting.schema.input.json"),"/db/wapi-setting/wapi-setting.schema.input.json");h.WapiSettingTableInput=Ro;m.addSchema(g(Ao,"/db/wapi-setting/wapi-setting.schema.json"),"/db/wapi-setting/wapi-setting.schema.json");h.WapiSettingTable=Ao;m.addSchema(g(Ih,"/db/wapi-setting/wapi-setting.schema.optional.json"),"/db/wapi-setting/wapi-setting.schema.optional.json");h.WapiSettingTableOptional=Ih;m.addSchema(g(Uo,"/fns/aggregate-transfers/aggregate-transfers.schema.input.json"),"/fns/aggregate-transfers/aggregate-transfers.schema.input.json");h.AggregateTransfersFnInput=Uo;m.addSchema(g(qo,"/fns/aggregate-transfers/aggregate-transfers.schema.output.json"),"/fns/aggregate-transfers/aggregate-transfers.schema.output.json");h.AggregateTransfersFnOutput=qo;m.addSchema(g(No,"/fns/create-access-token/create-access-token.schema.input.json"),"/fns/create-access-token/create-access-token.schema.input.json");h.CreateAccessTokenFnInput=No;m.addSchema(g(Bo,"/fns/create-access-token/create-access-token.schema.output.json"),"/fns/create-access-token/create-access-token.schema.output.json");h.CreateAccessTokenFnOutput=Bo;m.addSchema(g(Lo,"/fns/create-contract/create-contract.schema.input.json"),"/fns/create-contract/create-contract.schema.input.json");h.CreateContractFnInput=Lo;m.addSchema(g(Vo,"/fns/create-contract/create-contract.schema.output.json"),"/fns/create-contract/create-contract.schema.output.json");h.CreateContractFnOutput=Vo;m.addSchema(g(Ho,"/fns/create-deposit/create-deposit.schema.input.json"),"/fns/create-deposit/create-deposit.schema.input.json");h.CreateDepositFnInput=Ho;m.addSchema(g(zo,"/fns/create-deposit/create-deposit.schema.output.json"),"/fns/create-deposit/create-deposit.schema.output.json");h.CreateDepositFnOutput=zo;m.addSchema(g(Ko,"/fns/create-exchange/create-exchange.schema.input.json"),"/fns/create-exchange/create-exchange.schema.input.json");h.CreateExchangeFnInput=Ko;m.addSchema(g(Qo,"/fns/create-exchange/create-exchange.schema.output.json"),"/fns/create-exchange/create-exchange.schema.output.json");h.CreateExchangeFnOutput=Qo;m.addSchema(g(Jo,"/fns/create-token/create-token.schema.input.json"),"/fns/create-token/create-token.schema.input.json");h.CreateTokenFnInput=Jo;m.addSchema(g(Xo,"/fns/create-token/create-token.schema.output.json"),"/fns/create-token/create-token.schema.output.json");h.CreateTokenFnOutput=Xo;m.addSchema(g(Yo,"/fns/create-transfer/create-transfer.schema.input.json"),"/fns/create-transfer/create-transfer.schema.input.json");h.CreateTransferFnInput=Yo;m.addSchema(g(Zo,"/fns/create-transfer/create-transfer.schema.output.json"),"/fns/create-transfer/create-transfer.schema.output.json");h.CreateTransferFnOutput=Zo;m.addSchema(g(ep,"/fns/create-transfer-group/create-transfer-group.schema.input.json"),"/fns/create-transfer-group/create-transfer-group.schema.input.json");h.CreateTransferGroupFnInput=ep;m.addSchema(g(tp,"/fns/create-transfer-group/create-transfer-group.schema.output.json"),"/fns/create-transfer-group/create-transfer-group.schema.output.json");h.CreateTransferGroupFnOutput=tp;m.addSchema(g(rp,"/fns/create-transfers/create-transfers.schema.input.json"),"/fns/create-transfers/create-transfers.schema.input.json");h.CreateTransfersFnInput=rp;m.addSchema(g(np,"/fns/create-transfers/create-transfers.schema.output.json"),"/fns/create-transfers/create-transfers.schema.output.json");h.CreateTransfersFnOutput=np;m.addSchema(g(ap,"/fns/create-wallet/create-wallet.schema.input.json"),"/fns/create-wallet/create-wallet.schema.input.json");h.CreateWalletFnInput=ap;m.addSchema(g(sp,"/fns/create-wallet/create-wallet.schema.output.json"),"/fns/create-wallet/create-wallet.schema.output.json");h.CreateWalletFnOutput=sp;m.addSchema(g(ip,"/fns/create-withdrawal/create-withdrawal.schema.input.json"),"/fns/create-withdrawal/create-withdrawal.schema.input.json");h.CreateWithdrawalFnInput=ip;m.addSchema(g(op,"/fns/create-withdrawal/create-withdrawal.schema.output.json"),"/fns/create-withdrawal/create-withdrawal.schema.output.json");h.CreateWithdrawalFnOutput=op;m.addSchema(g(pp,"/fns/find-balances/find-balances.schema.input.json"),"/fns/find-balances/find-balances.schema.input.json");h.FindBalancesFnInput=pp;m.addSchema(g(fp,"/fns/find-balances/find-balances.schema.output.json"),"/fns/find-balances/find-balances.schema.output.json");h.FindBalancesFnOutput=fp;m.addSchema(g(up,"/fns/find-tokens/find-tokens.schema.input.json"),"/fns/find-tokens/find-tokens.schema.input.json");h.FindTokensFnInput=up;m.addSchema(g(dp,"/fns/find-tokens/find-tokens.schema.output.json"),"/fns/find-tokens/find-tokens.schema.output.json");h.FindTokensFnOutput=dp;m.addSchema(g(lp,"/fns/find-transfer-groups/find-transfer-groups.schema.input.json"),"/fns/find-transfer-groups/find-transfer-groups.schema.input.json");h.FindTransferGroupsFnInput=lp;m.addSchema(g(cp,"/fns/find-transfer-groups/find-transfer-groups.schema.output.json"),"/fns/find-transfer-groups/find-transfer-groups.schema.output.json");h.FindTransferGroupsFnOutput=cp;m.addSchema(g(mp,"/fns/find-transfers/find-transfers.schema.input.json"),"/fns/find-transfers/find-transfers.schema.input.json");h.FindTransfersFnInput=mp;m.addSchema(g(hp,"/fns/find-transfers/find-transfers.schema.output.json"),"/fns/find-transfers/find-transfers.schema.output.json");h.FindTransfersFnOutput=hp;m.addSchema(g(gp,"/fns/find-wallets/find-wallets.schema.input.json"),"/fns/find-wallets/find-wallets.schema.input.json");h.FindWalletsFnInput=gp;m.addSchema(g(_p,"/fns/find-wallets/find-wallets.schema.output.json"),"/fns/find-wallets/find-wallets.schema.output.json");h.FindWalletsFnOutput=_p;m.addSchema(g(yp,"/fns/fn-consts.schema.json"),"/fns/fn-consts.schema.json");h.FnConsts=yp;m.addSchema(g(bp,"/fns/get-balance/get-balance.schema.input.json"),"/fns/get-balance/get-balance.schema.input.json");h.GetBalanceFnInput=bp;m.addSchema(g(xp,"/fns/get-balance/get-balance.schema.output.json"),"/fns/get-balance/get-balance.schema.output.json");h.GetBalanceFnOutput=xp;m.addSchema(g(Fp,"/fns/get-balance-history/get-balance-history.schema.input.json"),"/fns/get-balance-history/get-balance-history.schema.input.json");h.GetBalanceHistoryFnInput=Fp;m.addSchema(g(wp,"/fns/get-balance-history/get-balance-history.schema.output.json"),"/fns/get-balance-history/get-balance-history.schema.output.json");h.GetBalanceHistoryFnOutput=wp;m.addSchema(g($p,"/fns/get-flags/get-flags.schema.input.json"),"/fns/get-flags/get-flags.schema.input.json");h.GetFlagsFnInput=$p;m.addSchema(g(Op,"/fns/get-flags/get-flags.schema.output.json"),"/fns/get-flags/get-flags.schema.output.json");h.GetFlagsFnOutput=Op;m.addSchema(g(vp,"/fns/get-statistics/get-statistics.schema.input.json"),"/fns/get-statistics/get-statistics.schema.input.json");h.GetStatisticsFnInput=vp;m.addSchema(g(jp,"/fns/get-statistics/get-statistics.schema.output.json"),"/fns/get-statistics/get-statistics.schema.output.json");h.GetStatisticsFnOutput=jp;m.addSchema(g(Ip,"/fns/get-token/get-token.schema.input.json"),"/fns/get-token/get-token.schema.input.json");h.GetTokenFnInput=Ip;m.addSchema(g(kp,"/fns/get-token/get-token.schema.output.json"),"/fns/get-token/get-token.schema.output.json");h.GetTokenFnOutput=kp;m.addSchema(g(Sp,"/fns/get-transfer/get-transfer.schema.input.json"),"/fns/get-transfer/get-transfer.schema.input.json");h.GetTransferFnInput=Sp;m.addSchema(g(Cp,"/fns/get-transfer/get-transfer.schema.output.json"),"/fns/get-transfer/get-transfer.schema.output.json");h.GetTransferFnOutput=Cp;m.addSchema(g(Pp,"/fns/get-transfer-group/get-transfer-group.schema.input.json"),"/fns/get-transfer-group/get-transfer-group.schema.input.json");h.GetTransferGroupFnInput=Pp;m.addSchema(g(Gp,"/fns/get-transfer-group/get-transfer-group.schema.output.json"),"/fns/get-transfer-group/get-transfer-group.schema.output.json");h.GetTransferGroupFnOutput=Gp;m.addSchema(g(Dp,"/fns/get-wallet/get-wallet.schema.input.json"),"/fns/get-wallet/get-wallet.schema.input.json");h.GetWalletFnInput=Dp;m.addSchema(g(Mp,"/fns/get-wallet/get-wallet.schema.output.json"),"/fns/get-wallet/get-wallet.schema.output.json");h.GetWalletFnOutput=Mp;m.addSchema(g(Ss,"/fns/import-data/import-data.schema.input.json"),"/fns/import-data/import-data.schema.input.json");h.ImportDataFnInput=Ss;var Tx=gx(Ss,"/fns/import-data/import-data.schema.input.json");m.addSchema(Tx,"/fns/import-data/import-data.schema.options.json");h.ImportDataFnOptions=Tx;var yx=_x(Ss,"/fns/import-data/import-data.schema.input.json");m.addSchema(yx,"/fns/import-data/import-data.schema.chunk.json");h.ImportDataFnStreamChunk=yx;m.addSchema(g(Wp,"/fns/import-data/import-data.schema.output.json"),"/fns/import-data/import-data.schema.output.json");h.ImportDataFnOutput=Wp;m.addSchema(g(Ep,"/fns/reverse-transfer/reverse-transfer.schema.input.json"),"/fns/reverse-transfer/reverse-transfer.schema.input.json");h.ReverseTransferFnInput=Ep;m.addSchema(g(Rp,"/fns/reverse-transfer/reverse-transfer.schema.output.json"),"/fns/reverse-transfer/reverse-transfer.schema.output.json");h.ReverseTransferFnOutput=Rp;m.addSchema(g(Ap,"/fns/reverse-transfer-group/reverse-transfer-group.schema.input.json"),"/fns/reverse-transfer-group/reverse-transfer-group.schema.input.json");h.ReverseTransferGroupFnInput=Ap;m.addSchema(g(Up,"/fns/reverse-transfer-group/reverse-transfer-group.schema.output.json"),"/fns/reverse-transfer-group/reverse-transfer-group.schema.output.json");h.ReverseTransferGroupFnOutput=Up;m.addSchema(g(qp,"/fns/reverse-transfers/reverse-transfers.schema.input.json"),"/fns/reverse-transfers/reverse-transfers.schema.input.json");h.ReverseTransfersFnInput=qp;m.addSchema(g(Np,"/fns/reverse-transfers/reverse-transfers.schema.output.json"),"/fns/reverse-transfers/reverse-transfers.schema.output.json");h.ReverseTransfersFnOutput=Np;m.addSchema(g(Bp,"/fns/set-flags/set-flags.schema.input.json"),"/fns/set-flags/set-flags.schema.input.json");h.SetFlagsFnInput=Bp;m.addSchema(g(Lp,"/fns/set-flags/set-flags.schema.output.json"),"/fns/set-flags/set-flags.schema.output.json");h.SetFlagsFnOutput=Lp;m.addSchema(g(Vp,"/fns/update-token/update-token.schema.input.json"),"/fns/update-token/update-token.schema.input.json");h.UpdateTokenFnInput=Vp;m.addSchema(g(Hp,"/fns/update-token/update-token.schema.output.json"),"/fns/update-token/update-token.schema.output.json");h.UpdateTokenFnOutput=Hp;m.addSchema(g(zp,"/fns/update-transfer/update-transfer.schema.input.json"),"/fns/update-transfer/update-transfer.schema.input.json");h.UpdateTransferFnInput=zp;m.addSchema(g(Kp,"/fns/update-transfer/update-transfer.schema.output.json"),"/fns/update-transfer/update-transfer.schema.output.json");h.UpdateTransferFnOutput=Kp;m.addSchema(g(Qp,"/fns/update-transfer-group/update-transfer-group.schema.input.json"),"/fns/update-transfer-group/update-transfer-group.schema.input.json");h.UpdateTransferGroupFnInput=Qp;m.addSchema(g(Jp,"/fns/update-transfer-group/update-transfer-group.schema.output.json"),"/fns/update-transfer-group/update-transfer-group.schema.output.json");h.UpdateTransferGroupFnOutput=Jp;m.addSchema(g(Xp,"/fns/update-transfer-groups/update-transfer-groups.schema.input.json"),"/fns/update-transfer-groups/update-transfer-groups.schema.input.json");h.UpdateTransferGroupsFnInput=Xp;m.addSchema(g(Yp,"/fns/update-transfer-groups/update-transfer-groups.schema.output.json"),"/fns/update-transfer-groups/update-transfer-groups.schema.output.json");h.UpdateTransferGroupsFnOutput=Yp;m.addSchema(g(Zp,"/fns/update-transfers/update-transfers.schema.input.json"),"/fns/update-transfers/update-transfers.schema.input.json");h.UpdateTransfersFnInput=Zp;m.addSchema(g(ef,"/fns/update-transfers/update-transfers.schema.output.json"),"/fns/update-transfers/update-transfers.schema.output.json");h.UpdateTransfersFnOutput=ef;m.addSchema(g(tf,"/fns/update-wallet/update-wallet.schema.input.json"),"/fns/update-wallet/update-wallet.schema.input.json");h.UpdateWalletFnInput=tf;m.addSchema(g(rf,"/fns/update-wallet/update-wallet.schema.output.json"),"/fns/update-wallet/update-wallet.schema.output.json");h.UpdateWalletFnOutput=rf;m.addSchema(g(nf,"/txs/aggregate-transfer-many/aggregate-transfer-many.schema.input.json"),"/txs/aggregate-transfer-many/aggregate-transfer-many.schema.input.json");h.AggregateTransferManyTxInput=nf;m.addSchema(g(af,"/txs/aggregate-transfer-many/aggregate-transfer-many.schema.output.json"),"/txs/aggregate-transfer-many/aggregate-transfer-many.schema.output.json");h.AggregateTransferManyTxOutput=af;m.addSchema(g(sf,"/txs/authentication-check/authentication-check.schema.input.json"),"/txs/authentication-check/authentication-check.schema.input.json");h.AuthenticationCheckTxInput=sf;m.addSchema(g(of,"/txs/authentication-check/authentication-check.schema.output.json"),"/txs/authentication-check/authentication-check.schema.output.json");h.AuthenticationCheckTxOutput=of;m.addSchema(g(pf,"/txs/create-access-token/create-access-token.schema.input.json"),"/txs/create-access-token/create-access-token.schema.input.json");h.CreateAccessTokenTxInput=pf;m.addSchema(g(ff,"/txs/create-access-token/create-access-token.schema.output.json"),"/txs/create-access-token/create-access-token.schema.output.json");h.CreateAccessTokenTxOutput=ff;m.addSchema(g(uf,"/txs/create-contract/create-contract.schema.input.json"),"/txs/create-contract/create-contract.schema.input.json");h.CreateContractTxInput=uf;m.addSchema(g(df,"/txs/create-contract/create-contract.schema.output.json"),"/txs/create-contract/create-contract.schema.output.json");h.CreateContractTxOutput=df;m.addSchema(g(lf,"/txs/create-deposit/create-deposit.schema.input.json"),"/txs/create-deposit/create-deposit.schema.input.json");h.CreateDepositTxInput=lf;m.addSchema(g(cf,"/txs/create-deposit/create-deposit.schema.output.json"),"/txs/create-deposit/create-deposit.schema.output.json");h.CreateDepositTxOutput=cf;m.addSchema(g(mf,"/txs/create-distribution/create-distribution.schema.input.json"),"/txs/create-distribution/create-distribution.schema.input.json");h.CreateDistributionTxInput=mf;m.addSchema(g(hf,"/txs/create-distribution/create-distribution.schema.output.json"),"/txs/create-distribution/create-distribution.schema.output.json");h.CreateDistributionTxOutput=hf;m.addSchema(g(gf,"/txs/create-token/create-token.schema.input.json"),"/txs/create-token/create-token.schema.input.json");h.CreateTokenTxInput=gf;m.addSchema(g(_f,"/txs/create-token/create-token.schema.output.json"),"/txs/create-token/create-token.schema.output.json");h.CreateTokenTxOutput=_f;m.addSchema(g(Tf,"/txs/create-transfer/create-transfer.schema.input.json"),"/txs/create-transfer/create-transfer.schema.input.json");h.CreateTransferTxInput=Tf;m.addSchema(g(yf,"/txs/create-transfer/create-transfer.schema.output.json"),"/txs/create-transfer/create-transfer.schema.output.json");h.CreateTransferTxOutput=yf;m.addSchema(g(bf,"/txs/create-transfer-group/create-transfer-group.schema.input.json"),"/txs/create-transfer-group/create-transfer-group.schema.input.json");h.CreateTransferGroupTxInput=bf;m.addSchema(g(xf,"/txs/create-transfer-group/create-transfer-group.schema.output.json"),"/txs/create-transfer-group/create-transfer-group.schema.output.json");h.CreateTransferGroupTxOutput=xf;m.addSchema(g(Ff,"/txs/create-transfer-many/create-transfer-many.schema.input.json"),"/txs/create-transfer-many/create-transfer-many.schema.input.json");h.CreateTransferManyTxInput=Ff;m.addSchema(g(wf,"/txs/create-transfer-many/create-transfer-many.schema.output.json"),"/txs/create-transfer-many/create-transfer-many.schema.output.json");h.CreateTransferManyTxOutput=wf;m.addSchema(g($f,"/txs/create-wallet/create-wallet.schema.input.json"),"/txs/create-wallet/create-wallet.schema.input.json");h.CreateWalletTxInput=$f;m.addSchema(g(Of,"/txs/create-wallet/create-wallet.schema.output.json"),"/txs/create-wallet/create-wallet.schema.output.json");h.CreateWalletTxOutput=Of;m.addSchema(g(vf,"/txs/create-withdrawal/create-withdrawal.schema.input.json"),"/txs/create-withdrawal/create-withdrawal.schema.input.json");h.CreateWithdrawalTxInput=vf;m.addSchema(g(jf,"/txs/create-withdrawal/create-withdrawal.schema.output.json"),"/txs/create-withdrawal/create-withdrawal.schema.output.json");h.CreateWithdrawalTxOutput=jf;m.addSchema(g(If,"/txs/export-database/export-database.schema.input.json"),"/txs/export-database/export-database.schema.input.json");h.ExportDatabaseTxInput=If;m.addSchema(g(kf,"/txs/export-database/export-database.schema.output.json"),"/txs/export-database/export-database.schema.output.json");h.ExportDatabaseTxOutput=kf;m.addSchema(g(Sf,"/txs/find-balance-many/find-balance-many.schema.input.json"),"/txs/find-balance-many/find-balance-many.schema.input.json");h.FindBalanceManyTxInput=Sf;m.addSchema(g(Cf,"/txs/find-balance-many/find-balance-many.schema.output.json"),"/txs/find-balance-many/find-balance-many.schema.output.json");h.FindBalanceManyTxOutput=Cf;m.addSchema(g(Pf,"/txs/find-token-many/find-token-many.schema.input.json"),"/txs/find-token-many/find-token-many.schema.input.json");h.FindTokenManyTxInput=Pf;m.addSchema(g(Gf,"/txs/find-token-many/find-token-many.schema.output.json"),"/txs/find-token-many/find-token-many.schema.output.json");h.FindTokenManyTxOutput=Gf;m.addSchema(g(Df,"/txs/find-transfer-group-many/find-transfer-group-many.schema.input.json"),"/txs/find-transfer-group-many/find-transfer-group-many.schema.input.json");h.FindTransferGroupManyTxInput=Df;m.addSchema(g(Mf,"/txs/find-transfer-group-many/find-transfer-group-many.schema.output.json"),"/txs/find-transfer-group-many/find-transfer-group-many.schema.output.json");h.FindTransferGroupManyTxOutput=Mf;m.addSchema(g(Wf,"/txs/find-transfer-many/find-transfer-many.schema.input.json"),"/txs/find-transfer-many/find-transfer-many.schema.input.json");h.FindTransferManyTxInput=Wf;m.addSchema(g(Ef,"/txs/find-transfer-many/find-transfer-many.schema.output.json"),"/txs/find-transfer-many/find-transfer-many.schema.output.json");h.FindTransferManyTxOutput=Ef;m.addSchema(g(Rf,"/txs/find-wallet-many/find-wallet-many.schema.input.json"),"/txs/find-wallet-many/find-wallet-many.schema.input.json");h.FindWalletManyTxInput=Rf;m.addSchema(g(Af,"/txs/find-wallet-many/find-wallet-many.schema.output.json"),"/txs/find-wallet-many/find-wallet-many.schema.output.json");h.FindWalletManyTxOutput=Af;m.addSchema(g(Uf,"/txs/finish-transaction/finish-transaction.schema.input.json"),"/txs/finish-transaction/finish-transaction.schema.input.json");h.FinishTransactionTxInput=Uf;m.addSchema(g(qf,"/txs/finish-transaction/finish-transaction.schema.output.json"),"/txs/finish-transaction/finish-transaction.schema.output.json");h.FinishTransactionTxOutput=qf;m.addSchema(g(Nf,"/txs/get-balance/get-balance.schema.input.json"),"/txs/get-balance/get-balance.schema.input.json");h.GetBalanceTxInput=Nf;m.addSchema(g(Bf,"/txs/get-balance/get-balance.schema.output.json"),"/txs/get-balance/get-balance.schema.output.json");h.GetBalanceTxOutput=Bf;m.addSchema(g(Lf,"/txs/get-balance-history/get-balance-history.schema.input.json"),"/txs/get-balance-history/get-balance-history.schema.input.json");h.GetBalanceHistoryTxInput=Lf;m.addSchema(g(Vf,"/txs/get-balance-history/get-balance-history.schema.output.json"),"/txs/get-balance-history/get-balance-history.schema.output.json");h.GetBalanceHistoryTxOutput=Vf;m.addSchema(g(Hf,"/txs/get-database-export-progress/get-database-export-progress.schema.input.json"),"/txs/get-database-export-progress/get-database-export-progress.schema.input.json");h.GetDatabaseExportProgressTxInput=Hf;m.addSchema(g(zf,"/txs/get-database-export-progress/get-database-export-progress.schema.output.json"),"/txs/get-database-export-progress/get-database-export-progress.schema.output.json");h.GetDatabaseExportProgressTxOutput=zf;m.addSchema(g(Kf,"/txs/get-database-import-progress/get-database-import-progress.schema.input.json"),"/txs/get-database-import-progress/get-database-import-progress.schema.input.json");h.GetDatabaseImportProgressTxInput=Kf;m.addSchema(g(Qf,"/txs/get-database-import-progress/get-database-import-progress.schema.output.json"),"/txs/get-database-import-progress/get-database-import-progress.schema.output.json");h.GetDatabaseImportProgressTxOutput=Qf;m.addSchema(g(Jf,"/txs/get-flags/get-flags.schema.input.json"),"/txs/get-flags/get-flags.schema.input.json");h.GetFlagsTxInput=Jf;m.addSchema(g(Xf,"/txs/get-flags/get-flags.schema.output.json"),"/txs/get-flags/get-flags.schema.output.json");h.GetFlagsTxOutput=Xf;m.addSchema(g(Yf,"/txs/get-statistics/get-statistics.schema.input.json"),"/txs/get-statistics/get-statistics.schema.input.json");h.GetStatisticsTxInput=Yf;m.addSchema(g(Zf,"/txs/get-statistics/get-statistics.schema.output.json"),"/txs/get-statistics/get-statistics.schema.output.json");h.GetStatisticsTxOutput=Zf;m.addSchema(g(eu,"/txs/get-token/get-token.schema.input.json"),"/txs/get-token/get-token.schema.input.json");h.GetTokenTxInput=eu;m.addSchema(g(tu,"/txs/get-token/get-token.schema.output.json"),"/txs/get-token/get-token.schema.output.json");h.GetTokenTxOutput=tu;m.addSchema(g(ru,"/txs/get-token-many/get-token-many.schema.input.json"),"/txs/get-token-many/get-token-many.schema.input.json");h.GetTokenManyTxInput=ru;m.addSchema(g(nu,"/txs/get-token-many/get-token-many.schema.output.json"),"/txs/get-token-many/get-token-many.schema.output.json");h.GetTokenManyTxOutput=nu;m.addSchema(g(au,"/txs/get-transfer/get-transfer.schema.input.json"),"/txs/get-transfer/get-transfer.schema.input.json");h.GetTransferTxInput=au;m.addSchema(g(su,"/txs/get-transfer/get-transfer.schema.output.json"),"/txs/get-transfer/get-transfer.schema.output.json");h.GetTransferTxOutput=su;m.addSchema(g(iu,"/txs/get-transfer-group/get-transfer-group.schema.input.json"),"/txs/get-transfer-group/get-transfer-group.schema.input.json");h.GetTransferGroupTxInput=iu;m.addSchema(g(ou,"/txs/get-transfer-group/get-transfer-group.schema.output.json"),"/txs/get-transfer-group/get-transfer-group.schema.output.json");h.GetTransferGroupTxOutput=ou;m.addSchema(g(pu,"/txs/get-wallet/get-wallet.schema.input.json"),"/txs/get-wallet/get-wallet.schema.input.json");h.GetWalletTxInput=pu;m.addSchema(g(fu,"/txs/get-wallet/get-wallet.schema.output.json"),"/txs/get-wallet/get-wallet.schema.output.json");h.GetWalletTxOutput=fu;m.addSchema(g(uu,"/txs/get-wallet-many/get-wallet-many.schema.input.json"),"/txs/get-wallet-many/get-wallet-many.schema.input.json");h.GetWalletManyTxInput=uu;m.addSchema(g(du,"/txs/get-wallet-many/get-wallet-many.schema.output.json"),"/txs/get-wallet-many/get-wallet-many.schema.output.json");h.GetWalletManyTxOutput=du;m.addSchema(g(Us,"/txs/import-actions/import-actions.schema.input.json"),"/txs/import-actions/import-actions.schema.input.json");h.ImportActionsTxInput=Us;var bx=gx(Us,"/txs/import-actions/import-actions.schema.input.json");m.addSchema(bx,"/txs/import-actions/import-actions.schema.options.json");h.ImportActionsTxOptions=bx;var xx=_x(Us,"/txs/import-actions/import-actions.schema.input.json");m.addSchema(xx,"/txs/import-actions/import-actions.schema.chunk.json");h.ImportActionsTxStreamChunk=xx;m.addSchema(g(lu,"/txs/import-actions/import-actions.schema.output.json"),"/txs/import-actions/import-actions.schema.output.json");h.ImportActionsTxOutput=lu;m.addSchema(g(cu,"/txs/import-database/import-database.schema.input.json"),"/txs/import-database/import-database.schema.input.json");h.ImportDatabaseTxInput=cu;m.addSchema(g(mu,"/txs/import-database/import-database.schema.output.json"),"/txs/import-database/import-database.schema.output.json");h.ImportDatabaseTxOutput=mu;m.addSchema(g(hu,"/txs/list-database-exports/list-database-exports.schema.input.json"),"/txs/list-database-exports/list-database-exports.schema.input.json");h.ListDatabaseExportsTxInput=hu;m.addSchema(g(gu,"/txs/list-database-exports/list-database-exports.schema.output.json"),"/txs/list-database-exports/list-database-exports.schema.output.json");h.ListDatabaseExportsTxOutput=gu;m.addSchema(g(_u,"/txs/query/query.schema.input.json"),"/txs/query/query.schema.input.json");h.QueryTxInput=_u;m.addSchema(g(Tu,"/txs/query/query.schema.output.json"),"/txs/query/query.schema.output.json");h.QueryTxOutput=Tu;m.addSchema(g(yu,"/txs/query-logs/query-logs.schema.input.json"),"/txs/query-logs/query-logs.schema.input.json");h.QueryLogsTxInput=yu;m.addSchema(g(bu,"/txs/query-logs/query-logs.schema.output.json"),"/txs/query-logs/query-logs.schema.output.json");h.QueryLogsTxOutput=bu;m.addSchema(g(xu,"/txs/reset-database/reset-database.schema.input.json"),"/txs/reset-database/reset-database.schema.input.json");h.ResetDatabaseTxInput=xu;m.addSchema(g(Fu,"/txs/reset-database/reset-database.schema.output.json"),"/txs/reset-database/reset-database.schema.output.json");h.ResetDatabaseTxOutput=Fu;m.addSchema(g(wu,"/txs/reverse-transfer/reverse-transfer.schema.input.json"),"/txs/reverse-transfer/reverse-transfer.schema.input.json");h.ReverseTransferTxInput=wu;m.addSchema(g($u,"/txs/reverse-transfer/reverse-transfer.schema.output.json"),"/txs/reverse-transfer/reverse-transfer.schema.output.json");h.ReverseTransferTxOutput=$u;m.addSchema(g(Ou,"/txs/reverse-transfer-group/reverse-transfer-group.schema.input.json"),"/txs/reverse-transfer-group/reverse-transfer-group.schema.input.json");h.ReverseTransferGroupTxInput=Ou;m.addSchema(g(vu,"/txs/reverse-transfer-group/reverse-transfer-group.schema.output.json"),"/txs/reverse-transfer-group/reverse-transfer-group.schema.output.json");h.ReverseTransferGroupTxOutput=vu;m.addSchema(g(ju,"/txs/reverse-transfer-group-many/reverse-transfer-group-many.schema.input.json"),"/txs/reverse-transfer-group-many/reverse-transfer-group-many.schema.input.json");h.ReverseTransferGroupManyTxInput=ju;m.addSchema(g(Iu,"/txs/reverse-transfer-group-many/reverse-transfer-group-many.schema.output.json"),"/txs/reverse-transfer-group-many/reverse-transfer-group-many.schema.output.json");h.ReverseTransferGroupManyTxOutput=Iu;m.addSchema(g(ku,"/txs/reverse-transfer-many/reverse-transfer-many.schema.input.json"),"/txs/reverse-transfer-many/reverse-transfer-many.schema.input.json");h.ReverseTransferManyTxInput=ku;m.addSchema(g(Su,"/txs/reverse-transfer-many/reverse-transfer-many.schema.output.json"),"/txs/reverse-transfer-many/reverse-transfer-many.schema.output.json");h.ReverseTransferManyTxOutput=Su;m.addSchema(g(Cu,"/txs/set-flags/set-flags.schema.input.json"),"/txs/set-flags/set-flags.schema.input.json");h.SetFlagsTxInput=Cu;m.addSchema(g(Pu,"/txs/set-flags/set-flags.schema.output.json"),"/txs/set-flags/set-flags.schema.output.json");h.SetFlagsTxOutput=Pu;m.addSchema(g(Gu,"/txs/start-transaction/start-transaction.schema.input.json"),"/txs/start-transaction/start-transaction.schema.input.json");h.StartTransactionTxInput=Gu;m.addSchema(g(Du,"/txs/start-transaction/start-transaction.schema.output.json"),"/txs/start-transaction/start-transaction.schema.output.json");h.StartTransactionTxOutput=Du;m.addSchema(g(Wu,"/txs/tx-consts.schema.json"),"/txs/tx-consts.schema.json");h.TxConsts=Wu;m.addSchema(g(Eu,"/txs/update-token/update-token.schema.input.json"),"/txs/update-token/update-token.schema.input.json");h.UpdateTokenTxInput=Eu;m.addSchema(g(Ru,"/txs/update-token/update-token.schema.output.json"),"/txs/update-token/update-token.schema.output.json");h.UpdateTokenTxOutput=Ru;m.addSchema(g(Au,"/txs/update-transfer/update-transfer.schema.input.json"),"/txs/update-transfer/update-transfer.schema.input.json");h.UpdateTransferTxInput=Au;m.addSchema(g(Uu,"/txs/update-transfer/update-transfer.schema.output.json"),"/txs/update-transfer/update-transfer.schema.output.json");h.UpdateTransferTxOutput=Uu;m.addSchema(g(qu,"/txs/update-transfer-group/update-transfer-group.schema.input.json"),"/txs/update-transfer-group/update-transfer-group.schema.input.json");h.UpdateTransferGroupTxInput=qu;m.addSchema(g(Nu,"/txs/update-transfer-group/update-transfer-group.schema.output.json"),"/txs/update-transfer-group/update-transfer-group.schema.output.json");h.UpdateTransferGroupTxOutput=Nu;m.addSchema(g(Bu,"/txs/update-transfer-group-many/update-transfer-group-many.schema.input.json"),"/txs/update-transfer-group-many/update-transfer-group-many.schema.input.json");h.UpdateTransferGroupManyTxInput=Bu;m.addSchema(g(Lu,"/txs/update-transfer-group-many/update-transfer-group-many.schema.output.json"),"/txs/update-transfer-group-many/update-transfer-group-many.schema.output.json");h.UpdateTransferGroupManyTxOutput=Lu;m.addSchema(g(Vu,"/txs/update-transfer-many/update-transfer-many.schema.input.json"),"/txs/update-transfer-many/update-transfer-many.schema.input.json");h.UpdateTransferManyTxInput=Vu;m.addSchema(g(Hu,"/txs/update-transfer-many/update-transfer-many.schema.output.json"),"/txs/update-transfer-many/update-transfer-many.schema.output.json");h.UpdateTransferManyTxOutput=Hu;m.addSchema(g(zu,"/txs/update-wallet/update-wallet.schema.input.json"),"/txs/update-wallet/update-wallet.schema.input.json");h.UpdateWalletTxInput=zu;m.addSchema(g(Ku,"/txs/update-wallet/update-wallet.schema.output.json"),"/txs/update-wallet/update-wallet.schema.output.json");h.UpdateWalletTxOutput=Ku;var x;(function(p){p.JSONRPCRequest="JSONRPCRequest",p.JSONRPCResponse="JSONRPCResponse",p.ClientOptions="ClientOptions",p.Consts="Consts",p.TokenTableInput="TokenTableInput",p.TokenTable="TokenTable",p.TokenTableOptional="TokenTableOptional",p.TransferTableInput="TransferTableInput",p.TransferTable="TransferTable",p.TransferTableOptional="TransferTableOptional",p.TransferGroupTableInput="TransferGroupTableInput",p.TransferGroupTable="TransferGroupTable",p.TransferGroupTableOptional="TransferGroupTableOptional",p.TransferLogTableInput="TransferLogTableInput",p.TransferLogTable="TransferLogTable",p.TransferLogTableOptional="TransferLogTableOptional",p.WalletTableInput="WalletTableInput",p.WalletTable="WalletTable",p.WalletTableOptional="WalletTableOptional",p.WalletTokenSettingTableInput="WalletTokenSettingTableInput",p.WalletTokenSettingTable="WalletTokenSettingTable",p.WalletTokenSettingTableOptional="WalletTokenSettingTableOptional",p.WapiSettingTableInput="WapiSettingTableInput",p.WapiSettingTable="WapiSettingTable",p.WapiSettingTableOptional="WapiSettingTableOptional",p.AggregateTransfersFnInput="AggregateTransfersFnInput",p.AggregateTransfersFnOutput="AggregateTransfersFnOutput",p.CreateAccessTokenFnInput="CreateAccessTokenFnInput",p.CreateAccessTokenFnOutput="CreateAccessTokenFnOutput",p.CreateContractFnInput="CreateContractFnInput",p.CreateContractFnOutput="CreateContractFnOutput",p.CreateDepositFnInput="CreateDepositFnInput",p.CreateDepositFnOutput="CreateDepositFnOutput",p.CreateExchangeFnInput="CreateExchangeFnInput",p.CreateExchangeFnOutput="CreateExchangeFnOutput",p.CreateTokenFnInput="CreateTokenFnInput",p.CreateTokenFnOutput="CreateTokenFnOutput",p.CreateTransferFnInput="CreateTransferFnInput",p.CreateTransferFnOutput="CreateTransferFnOutput",p.CreateTransferGroupFnInput="CreateTransferGroupFnInput",p.CreateTransferGroupFnOutput="CreateTransferGroupFnOutput",p.CreateTransfersFnInput="CreateTransfersFnInput",p.CreateTransfersFnOutput="CreateTransfersFnOutput",p.CreateWalletFnInput="CreateWalletFnInput",p.CreateWalletFnOutput="CreateWalletFnOutput",p.CreateWithdrawalFnInput="CreateWithdrawalFnInput",p.CreateWithdrawalFnOutput="CreateWithdrawalFnOutput",p.FindBalancesFnInput="FindBalancesFnInput",p.FindBalancesFnOutput="FindBalancesFnOutput",p.FindTokensFnInput="FindTokensFnInput",p.FindTokensFnOutput="FindTokensFnOutput",p.FindTransferGroupsFnInput="FindTransferGroupsFnInput",p.FindTransferGroupsFnOutput="FindTransferGroupsFnOutput",p.FindTransfersFnInput="FindTransfersFnInput",p.FindTransfersFnOutput="FindTransfersFnOutput",p.FindWalletsFnInput="FindWalletsFnInput",p.FindWalletsFnOutput="FindWalletsFnOutput",p.FnConsts="FnConsts",p.GetBalanceFnInput="GetBalanceFnInput",p.GetBalanceFnOutput="GetBalanceFnOutput",p.GetBalanceHistoryFnInput="GetBalanceHistoryFnInput",p.GetBalanceHistoryFnOutput="GetBalanceHistoryFnOutput",p.GetFlagsFnInput="GetFlagsFnInput",p.GetFlagsFnOutput="GetFlagsFnOutput",p.GetStatisticsFnInput="GetStatisticsFnInput",p.GetStatisticsFnOutput="GetStatisticsFnOutput",p.GetTokenFnInput="GetTokenFnInput",p.GetTokenFnOutput="GetTokenFnOutput",p.GetTransferFnInput="GetTransferFnInput",p.GetTransferFnOutput="GetTransferFnOutput",p.GetTransferGroupFnInput="GetTransferGroupFnInput",p.GetTransferGroupFnOutput="GetTransferGroupFnOutput",p.GetWalletFnInput="GetWalletFnInput",p.GetWalletFnOutput="GetWalletFnOutput",p.ImportDataFnInput="ImportDataFnInput",p.ImportDataFnOptions="ImportDataFnOptions",p.ImportDataFnStreamChunk="ImportDataFnStreamChunk",p.ImportDataFnOutput="ImportDataFnOutput",p.ReverseTransferFnInput="ReverseTransferFnInput",p.ReverseTransferFnOutput="ReverseTransferFnOutput",p.ReverseTransferGroupFnInput="ReverseTransferGroupFnInput",p.ReverseTransferGroupFnOutput="ReverseTransferGroupFnOutput",p.ReverseTransfersFnInput="ReverseTransfersFnInput",p.ReverseTransfersFnOutput="ReverseTransfersFnOutput",p.SetFlagsFnInput="SetFlagsFnInput",p.SetFlagsFnOutput="SetFlagsFnOutput",p.UpdateTokenFnInput="UpdateTokenFnInput",p.UpdateTokenFnOutput="UpdateTokenFnOutput",p.UpdateTransferFnInput="UpdateTransferFnInput",p.UpdateTransferFnOutput="UpdateTransferFnOutput",p.UpdateTransferGroupFnInput="UpdateTransferGroupFnInput",p.UpdateTransferGroupFnOutput="UpdateTransferGroupFnOutput",p.UpdateTransferGroupsFnInput="UpdateTransferGroupsFnInput",p.UpdateTransferGroupsFnOutput="UpdateTransferGroupsFnOutput",p.UpdateTransfersFnInput="UpdateTransfersFnInput",p.UpdateTransfersFnOutput="UpdateTransfersFnOutput",p.UpdateWalletFnInput="UpdateWalletFnInput",p.UpdateWalletFnOutput="UpdateWalletFnOutput",p.AggregateTransferManyTxInput="AggregateTransferManyTxInput",p.AggregateTransferManyTxOutput="AggregateTransferManyTxOutput",p.AuthenticationCheckTxInput="AuthenticationCheckTxInput",p.AuthenticationCheckTxOutput="AuthenticationCheckTxOutput",p.CreateAccessTokenTxInput="CreateAccessTokenTxInput",p.CreateAccessTokenTxOutput="CreateAccessTokenTxOutput",p.CreateContractTxInput="CreateContractTxInput",p.CreateContractTxOutput="CreateContractTxOutput",p.CreateDepositTxInput="CreateDepositTxInput",p.CreateDepositTxOutput="CreateDepositTxOutput",p.CreateDistributionTxInput="CreateDistributionTxInput",p.CreateDistributionTxOutput="CreateDistributionTxOutput",p.CreateTokenTxInput="CreateTokenTxInput",p.CreateTokenTxOutput="CreateTokenTxOutput",p.CreateTransferTxInput="CreateTransferTxInput",p.CreateTransferTxOutput="CreateTransferTxOutput",p.CreateTransferGroupTxInput="CreateTransferGroupTxInput",p.CreateTransferGroupTxOutput="CreateTransferGroupTxOutput",p.CreateTransferManyTxInput="CreateTransferManyTxInput",p.CreateTransferManyTxOutput="CreateTransferManyTxOutput",p.CreateWalletTxInput="CreateWalletTxInput",p.CreateWalletTxOutput="CreateWalletTxOutput",p.CreateWithdrawalTxInput="CreateWithdrawalTxInput",p.CreateWithdrawalTxOutput="CreateWithdrawalTxOutput",p.ExportDatabaseTxInput="ExportDatabaseTxInput",p.ExportDatabaseTxOutput="ExportDatabaseTxOutput",p.FindBalanceManyTxInput="FindBalanceManyTxInput",p.FindBalanceManyTxOutput="FindBalanceManyTxOutput",p.FindTokenManyTxInput="FindTokenManyTxInput",p.FindTokenManyTxOutput="FindTokenManyTxOutput",p.FindTransferGroupManyTxInput="FindTransferGroupManyTxInput",p.FindTransferGroupManyTxOutput="FindTransferGroupManyTxOutput",p.FindTransferManyTxInput="FindTransferManyTxInput",p.FindTransferManyTxOutput="FindTransferManyTxOutput",p.FindWalletManyTxInput="FindWalletManyTxInput",p.FindWalletManyTxOutput="FindWalletManyTxOutput",p.FinishTransactionTxInput="FinishTransactionTxInput",p.FinishTransactionTxOutput="FinishTransactionTxOutput",p.GetBalanceTxInput="GetBalanceTxInput",p.GetBalanceTxOutput="GetBalanceTxOutput",p.GetBalanceHistoryTxInput="GetBalanceHistoryTxInput",p.GetBalanceHistoryTxOutput="GetBalanceHistoryTxOutput",p.GetDatabaseExportProgressTxInput="GetDatabaseExportProgressTxInput",p.GetDatabaseExportProgressTxOutput="GetDatabaseExportProgressTxOutput",p.GetDatabaseImportProgressTxInput="GetDatabaseImportProgressTxInput",p.GetDatabaseImportProgressTxOutput="GetDatabaseImportProgressTxOutput",p.GetFlagsTxInput="GetFlagsTxInput",p.GetFlagsTxOutput="GetFlagsTxOutput",p.GetStatisticsTxInput="GetStatisticsTxInput",p.GetStatisticsTxOutput="GetStatisticsTxOutput",p.GetTokenTxInput="GetTokenTxInput",p.GetTokenTxOutput="GetTokenTxOutput",p.GetTokenManyTxInput="GetTokenManyTxInput",p.GetTokenManyTxOutput="GetTokenManyTxOutput",p.GetTransferTxInput="GetTransferTxInput",p.GetTransferTxOutput="GetTransferTxOutput",p.GetTransferGroupTxInput="GetTransferGroupTxInput",p.GetTransferGroupTxOutput="GetTransferGroupTxOutput",p.GetWalletTxInput="GetWalletTxInput",p.GetWalletTxOutput="GetWalletTxOutput",p.GetWalletManyTxInput="GetWalletManyTxInput",p.GetWalletManyTxOutput="GetWalletManyTxOutput",p.ImportActionsTxInput="ImportActionsTxInput",p.ImportActionsTxOptions="ImportActionsTxOptions",p.ImportActionsTxStreamChunk="ImportActionsTxStreamChunk",p.ImportActionsTxOutput="ImportActionsTxOutput",p.ImportDatabaseTxInput="ImportDatabaseTxInput",p.ImportDatabaseTxOutput="ImportDatabaseTxOutput",p.ListDatabaseExportsTxInput="ListDatabaseExportsTxInput",p.ListDatabaseExportsTxOutput="ListDatabaseExportsTxOutput",p.QueryTxInput="QueryTxInput",p.QueryTxOutput="QueryTxOutput",p.QueryLogsTxInput="QueryLogsTxInput",p.QueryLogsTxOutput="QueryLogsTxOutput",p.ResetDatabaseTxInput="ResetDatabaseTxInput",p.ResetDatabaseTxOutput="ResetDatabaseTxOutput",p.ReverseTransferTxInput="ReverseTransferTxInput",p.ReverseTransferTxOutput="ReverseTransferTxOutput",p.ReverseTransferGroupTxInput="ReverseTransferGroupTxInput",p.ReverseTransferGroupTxOutput="ReverseTransferGroupTxOutput",p.ReverseTransferGroupManyTxInput="ReverseTransferGroupManyTxInput",p.ReverseTransferGroupManyTxOutput="ReverseTransferGroupManyTxOutput",p.ReverseTransferManyTxInput="ReverseTransferManyTxInput",p.ReverseTransferManyTxOutput="ReverseTransferManyTxOutput",p.SetFlagsTxInput="SetFlagsTxInput",p.SetFlagsTxOutput="SetFlagsTxOutput",p.StartTransactionTxInput="StartTransactionTxInput",p.StartTransactionTxOutput="StartTransactionTxOutput",p.TxConsts="TxConsts",p.UpdateTokenTxInput="UpdateTokenTxInput",p.UpdateTokenTxOutput="UpdateTokenTxOutput",p.UpdateTransferTxInput="UpdateTransferTxInput",p.UpdateTransferTxOutput="UpdateTransferTxOutput",p.UpdateTransferGroupTxInput="UpdateTransferGroupTxInput",p.UpdateTransferGroupTxOutput="UpdateTransferGroupTxOutput",p.UpdateTransferGroupManyTxInput="UpdateTransferGroupManyTxInput",p.UpdateTransferGroupManyTxOutput="UpdateTransferGroupManyTxOutput",p.UpdateTransferManyTxInput="UpdateTransferManyTxInput",p.UpdateTransferManyTxOutput="UpdateTransferManyTxOutput",p.UpdateWalletTxInput="UpdateWalletTxInput",p.UpdateWalletTxOutput="UpdateWalletTxOutput"})(x||(x={}));var Qu={ajv:m,createValidator(t){let e=m.compile(t);return mx(e)},getValidator(t){let e=m.getSchema(t);return mx(e)},getSchema(t){return h[t]},Schemas:h,SchemaNames:x},ise=Qu.createValidator,F=Qu.getValidator;var Ju;(function(i){i.year="year",i.month="month",i.week="week",i.day="day",i.hour="hour",i.minute="minute"})(Ju||(Ju={}));var Sh;(function(i){i.count="count",i.countDistinct="countDistinct",i.sum="sum",i.average="average",i.min="min",i.max="max"})(Sh||(Sh={}));var Ch;(function(a){a.keep="keep",a.random="random",a.largest="largest",a.target="target"})(Ch||(Ch={}));var Ph;(function(r){r.replace="replace",r.extend="extend"})(Ph||(Ph={}));var Gh;(function(i){i.replace="replace",i.replace_create_only="replace_create_only",i.replace_cancel_only="replace_cancel_only",i.extend="extend",i.extend_create_only="extend_create_only",i.extend_cancel_only="extend_cancel_only"})(Gh||(Gh={}));var y6=F(x.AggregateTransferManyTxInput);var b6=F(x.AuthenticationCheckTxInput);var x6=F(x.CreateAccessTokenTxInput);var F6=F(x.CreateContractTxInput);var w6=F(x.CreateDepositTxInput);var $6=F(x.CreateDistributionTxInput);var O6=F(x.CreateTokenTxInput);var v6=F(x.CreateTransferTxInput);var j6=F(x.CreateTransferGroupTxInput);var I6=F(x.CreateTransferManyTxInput);var k6=F(x.CreateWalletTxInput);var S6=F(x.CreateWithdrawalTxInput);var C6=F(x.ExportDatabaseTxInput);var P6=F(x.FindBalanceManyTxInput);var G6=F(x.FindTokenManyTxInput);var D6=F(x.FindTransferGroupManyTxInput);var M6=F(x.FindTransferManyTxInput);var W6=F(x.FindWalletManyTxInput);var E6=F(x.FinishTransactionTxInput);var R6=F(x.GetBalanceTxInput);var A6=F(x.GetBalanceHistoryTxInput);var U6=F(x.GetDatabaseExportProgressTxInput);var q6=F(x.GetDatabaseImportProgressTxInput);var N6=F(x.GetFlagsTxInput);var B6=F(x.GetStatisticsTxInput);var L6=F(x.GetTokenTxInput);var V6=F(x.GetTokenManyTxInput);var H6=F(x.GetTransferTxInput);var z6=F(x.GetTransferGroupTxInput);var K6=F(x.GetWalletTxInput);var Q6=F(x.GetWalletManyTxInput);var J6=F(x.ImportActionsTxInput);var X6=F(x.ImportDatabaseTxInput);var Y6=F(x.ListDatabaseExportsTxInput);var Z6=F(x.QueryTxInput);var eJ=F(x.QueryLogsTxInput);var tJ=F(x.ResetDatabaseTxInput);var rJ=F(x.ReverseTransferTxInput);var nJ=F(x.ReverseTransferGroupTxInput);var aJ=F(x.ReverseTransferGroupManyTxInput);var sJ=F(x.ReverseTransferManyTxInput);var iJ=F(x.SetFlagsTxInput);var oJ=F(x.StartTransactionTxInput);var pJ=F(x.UpdateTokenTxInput);var fJ=F(x.UpdateTransferTxInput);var uJ=F(x.UpdateTransferGroupTxInput);var dJ=F(x.UpdateTransferGroupManyTxInput);var lJ=F(x.UpdateTransferManyTxInput);var cJ=F(x.UpdateWalletTxInput),Dh={aggregateTransferMany:y6,authenticationCheck:b6,createAccessToken:x6,createContract:F6,createDeposit:w6,createDistribution:$6,createToken:O6,createTransfer:v6,createTransferGroup:j6,createTransferMany:I6,createWallet:k6,createWithdrawal:S6,exportDatabase:C6,findBalanceMany:P6,findTokenMany:G6,findTransferGroupMany:D6,findTransferMany:M6,findWalletMany:W6,finishTransaction:E6,getBalance:R6,getBalanceHistory:A6,getDatabaseExportProgress:U6,getDatabaseImportProgress:q6,getFlags:N6,getStatistics:B6,getToken:L6,getTokenMany:V6,getTransfer:H6,getTransferGroup:z6,getWallet:K6,getWalletMany:Q6,importActions:J6,importDatabase:X6,listDatabaseExports:Y6,query:Z6,queryLogs:eJ,resetDatabase:tJ,reverseTransfer:rJ,reverseTransferGroup:nJ,reverseTransferGroupMany:aJ,reverseTransferMany:sJ,setFlags:iJ,startTransaction:oJ,updateToken:pJ,updateTransfer:fJ,updateTransferGroup:uJ,updateTransferGroupMany:dJ,updateTransferMany:lJ,updateWallet:cJ},R;(function(S){S.aggregateTransferMany="aggregateTransferMany",S.authenticationCheck="authenticationCheck",S.createAccessToken="createAccessToken",S.createContract="createContract",S.createDeposit="createDeposit",S.createDistribution="createDistribution",S.createToken="createToken",S.createTransfer="createTransfer",S.createTransferGroup="createTransferGroup",S.createTransferMany="createTransferMany",S.createWallet="createWallet",S.createWithdrawal="createWithdrawal",S.exportDatabase="exportDatabase",S.findBalanceMany="findBalanceMany",S.findTokenMany="findTokenMany",S.findTransferGroupMany="findTransferGroupMany",S.findTransferMany="findTransferMany",S.findWalletMany="findWalletMany",S.finishTransaction="finishTransaction",S.getBalance="getBalance",S.getBalanceHistory="getBalanceHistory",S.getDatabaseExportProgress="getDatabaseExportProgress",S.getDatabaseImportProgress="getDatabaseImportProgress",S.getFlags="getFlags",S.getStatistics="getStatistics",S.getToken="getToken",S.getTokenMany="getTokenMany",S.getTransfer="getTransfer",S.getTransferGroup="getTransferGroup",S.getWallet="getWallet",S.getWalletMany="getWalletMany",S.importActions="importActions",S.importDatabase="importDatabase",S.listDatabaseExports="listDatabaseExports",S.query="query",S.queryLogs="queryLogs",S.resetDatabase="resetDatabase",S.reverseTransfer="reverseTransfer",S.reverseTransferGroup="reverseTransferGroup",S.reverseTransferGroupMany="reverseTransferGroupMany",S.reverseTransferMany="reverseTransferMany",S.setFlags="setFlags",S.startTransaction="startTransaction",S.updateToken="updateToken",S.updateTransfer="updateTransfer",S.updateTransferGroup="updateTransferGroup",S.updateTransferGroupMany="updateTransferGroupMany",S.updateTransferMany="updateTransferMany",S.updateWallet="updateWallet"})(R||(R={}));var mJ=F(x.ImportActionsTxInput);function Fx(t){let{error:e}=mJ(t);return e===void 0}var Zoe=F(x.ImportActionsTxOutput);var epe=F(x.ImportActionsTxStreamChunk);var hJ=F(x.ImportActionsTxOptions);function wx(t){let{error:e}=hJ(t);return e===void 0}var Ci=class{constructor(e,r,n){this.isConnected=!1;this.hooks=new Proxy({},{set(e,r,n){if(typeof n!="function")throw new TypeError("Hooks can only be functions");return e[r]=n,!0}});this._requests=new Map;this._error=!1;this._sending=new Set;this.type=r,this._connection=e,this.connectionType=r,this.$connect=n}_setConnected(e){this.isConnected=e,this.isConnected&&this._error!==!1&&(this._error=!1),this.isConnected&&this.hooks.connected&&this.hooks.connected(this.socId),!this.isConnected&&this.hooks.disconnected&&this.hooks.disconnected()}_setErrored(e){this._error=e,this.isConnected&&this._setConnected(!1)}_send(e){throw new Error("This method must be implemented by child class")}_reconnect(){throw new Error("This method must be implemented by child class")}close(){return ye(this,null,function*(){throw new Error("This method must be implemented by child class")})}_connectionLost(){this._requests.forEach((e,r)=>{"stream"in e&&e.stream.destroy(new hd({message:"connection lost"})),this._requests.delete(r)}),this.socId=void 0}_handleMessage(e){var o,f,u;if(this.hooks.message&&this.hooks.message(e),"method"in e){let l=e;if(l.method===ve.ping){this._send({jsonrpc:ve.version,result:ve.pong,id:l.id});return}pe("Unexpected JSONRPCRequest",e);return}let r=e;if(this.hooks.message&&this.hooks.message(r),r.id===null){pe("Unexpected JSONRPCResponse",e);return}if(r.result===ve.acknowledgement){this._sending.delete(r.id);return}let n=this._requests.get(r.id);if(!n){pe("No Request found for incoming",e);return}if("handle"in n){n.handle(r),delete n.handle;return}r.error&&"error"in n&&n.error(r.error);let a=r;if(((o=a.result)==null?void 0:o.type)===ve.streamPause&&"pause"in n){n.pause();return}if(((f=a.result)==null?void 0:f.type)===ve.streamResume&&"resume"in n){n.resume();return}let{stream:s,start:i}=n;if(((u=a.result)==null?void 0:u.type)===ve.streamChunk){s.push(a.result);return}s.push(a),s.push(null),this._requests.delete(a.id),this.connectionType===dt.ws&&this._send({jsonrpc:ve.version,method:ve.acknowledgement,params:Date.now()-i,id:a.id})}_sendTransaction(e,r){let{isValid:n,inputCopy:a,error:s}=Dh[e](r);if(!n)throw s;let i={jsonrpc:ve.version,method:e,params:a,id:as()};return this.hooks.preflight&&this.hooks.preflight(i)===!1?new da:new da(o=>ye(this,null,function*(){this._error&&this._reconnect(),this.isConnected||(yield this.$connect),this._requests.set(i.id,{stream:o,start:Date.now()}),this._sending.add(i.id),this._send(i)}))}_streamTransaction(e,r,n,a){let s=Date.now(),i=as(),o,f=({method:w,params:y})=>{if(o)return;let j={jsonrpc:ve.version,method:w,params:P({streamId:i},y),id:as()};this._sending.add(j.id),this._send(j)},u=(w,y)=>{o||(f({method:"streamError",params:{error:y}}),o=y,w.push({error:y}))},l=new Vc,_=a?l.pipe(a):l,b={jsonrpc:ve.version,method:"streamStart",params:{method:e,options:n},id:i};return this.hooks.preflight&&this.hooks.preflight(b)===!1?new Md:new Md(w=>ye(this,null,function*(){this._error&&this._reconnect(),this.isConnected||(yield this.$connect);let y=setTimeout(()=>{w.push({error:new de({message:re.INPUT_STREAM_TIMEOUT})})},3e4);this._requests.set(b.id,{stream:w,start:s,error(j){o=j,pe("stream:error()>",j)},pause(){l.pause()},resume(){l.resume()},handle(j){if(j.error){w.push(j);return}_.on("data",I=>{if(!o){if(y&&(clearTimeout(y),y=null),!r(I)){u(w,new Ne({message:re.INPUT_INVALID,data:I}));return}f({method:"streamData",params:{data:I}})}}).on("error",I=>{o||(y&&(clearTimeout(y),y=null),f({method:"streamError",params:{error:I}}),w.push({error:new de({message:re.INPUT_STREAM_ERROR,data:I})}))}).on("end",()=>{y&&(clearTimeout(y),y=null),f({method:"streamEnd",params:{}})})}}),this._sending.add(b.id),this._send(b)}),l)}aggregateTransferMany(e){return this._sendTransaction(R.aggregateTransferMany,e)}authenticationCheck(e){return this._sendTransaction(R.authenticationCheck,e)}createAccessToken(e){return this._sendTransaction(R.createAccessToken,e)}createContract(e){return this._sendTransaction(R.createContract,e)}createDeposit(e){return this._sendTransaction(R.createDeposit,e)}createDistribution(e){return this._sendTransaction(R.createDistribution,e)}createToken(e){return this._sendTransaction(R.createToken,e)}createTransfer(e){return this._sendTransaction(R.createTransfer,e)}createTransferGroup(e){return this._sendTransaction(R.createTransferGroup,e)}createTransferMany(e){return this._sendTransaction(R.createTransferMany,e)}createWallet(e){return this._sendTransaction(R.createWallet,e)}createWithdrawal(e){return this._sendTransaction(R.createWithdrawal,e)}exportDatabase(e){return this._sendTransaction(R.exportDatabase,e)}findBalanceMany(e){return this._sendTransaction(R.findBalanceMany,e)}findTokenMany(e){return this._sendTransaction(R.findTokenMany,e)}findTransferGroupMany(e){return this._sendTransaction(R.findTransferGroupMany,e)}findTransferMany(e){return this._sendTransaction(R.findTransferMany,e)}findWalletMany(e){return this._sendTransaction(R.findWalletMany,e)}finishTransaction(e){return this._sendTransaction(R.finishTransaction,e)}getBalance(e){return this._sendTransaction(R.getBalance,e)}getBalanceHistory(e){return this._sendTransaction(R.getBalanceHistory,e)}getDatabaseExportProgress(e){return this._sendTransaction(R.getDatabaseExportProgress,e)}getDatabaseImportProgress(e){return this._sendTransaction(R.getDatabaseImportProgress,e)}getFlags(e){return this._sendTransaction(R.getFlags,e)}getStatistics(e){return this._sendTransaction(R.getStatistics,e)}getToken(e){return this._sendTransaction(R.getToken,e)}getTokenMany(e){return this._sendTransaction(R.getTokenMany,e)}getTransfer(e){return this._sendTransaction(R.getTransfer,e)}getTransferGroup(e){return this._sendTransaction(R.getTransferGroup,e)}getWallet(e){return this._sendTransaction(R.getWallet,e)}getWalletMany(e){return this._sendTransaction(R.getWalletMany,e)}importActions(e){return this._sendTransaction(R.importActions,e)}importActionsStream(e,r){if(e!==void 0&&!wx(e))throw new Ne({message:re.INPUT_INVALID,data:e});return this._streamTransaction(R.importActions,Fx,e,r)}importDatabase(e){return this._sendTransaction(R.importDatabase,e)}listDatabaseExports(e){return this._sendTransaction(R.listDatabaseExports,e)}query(e){return this._sendTransaction(R.query,e)}queryLogs(e){return this._sendTransaction(R.queryLogs,e)}resetDatabase(e){return this._sendTransaction(R.resetDatabase,e)}reverseTransfer(e){return this._sendTransaction(R.reverseTransfer,e)}reverseTransferGroup(e){return this._sendTransaction(R.reverseTransferGroup,e)}reverseTransferGroupMany(e){return this._sendTransaction(R.reverseTransferGroupMany,e)}reverseTransferMany(e){return this._sendTransaction(R.reverseTransferMany,e)}setFlags(e){return this._sendTransaction(R.setFlags,e)}startTransaction(e){return this._sendTransaction(R.startTransaction,e)}updateToken(e){return this._sendTransaction(R.updateToken,e)}updateTransfer(e){return this._sendTransaction(R.updateTransfer,e)}updateTransferGroup(e){return this._sendTransaction(R.updateTransferGroup,e)}updateTransferGroupMany(e){return this._sendTransaction(R.updateTransferGroupMany,e)}updateTransferMany(e){return this._sendTransaction(R.updateTransferMany,e)}updateWallet(e){return this._sendTransaction(R.updateWallet,e)}};var cl;(function(e){e.ready="ready"})(cl||(cl={}));var ml;(function(r){r[r.authError=4030]="authError",r[r.genericError=4500]="genericError"})(ml||(ml={}));var hl="0.6.6";function Mh(t){let e=$x(t);return new Ox(e,t)}function $x(t){let e=Object.assign({rejectUnauthorized:!0,clientVersion:hl},t),r=MT(e),n=new pT(...r),a,s,i=!1,o;n.onclose=f,n.onerror=u,n.onmessage=l;function f(w){if(pe(`createConnection>close(reason:${w.reason},code:${w.code},wasClean:${w.wasClean})`),w.code===ml.authError)return _(new _d({message:re.AUTHENTICATION_FAILED,code:me.AuthenticationError}));_(new Error("WS closed"))}function u(w){pe(`createConnection>error(message:${w.message},error:${w.error},type:${w.type})`),_(w.error)}function l(w){pe(`createConnection>message(type:${w.type},data:${w.data})`);let{data:y}=w,j;try{j=JSON.parse(y.toString())}catch(I){return pe("Invalid JSON response",I),_(new Error("Invalid JSON response"))}if(j.result!==cl.ready)return pe("Invalid first message"),_(new Error("Invalid first message - "+JSON.stringify(j)));_()}function _(w){i||(delete n.onmessage,delete n.onerror,delete n.onclose,w?(s(w),n.close()):a(o),i=!0)}let b=new Promise((w,y)=>{a=w,s=y});return{ws:n,$connect:b}}var Ox=class extends Ci{constructor(e,r){super(e.ws,dt.ws,e.$connect);this._tryToReconnect=!0;this._config=r,this.$connect.then(n=>(this.socId=n,this._ready())).catch(n=>{this.socId||this._setErrored(n)})}_setErrored(e){super._setErrored(e),e.hasOwnProperty("code")&&e.code===me.AuthenticationError&&(this._tryToReconnect=!1)}_ready(){this._setConnected(!0),this._connection.onmessage=e=>{let{data:r,type:n}=e;if(pe(`message(type:${n},data:${r})`),n==="message"){let a=JSON.parse(r.toString());this._handleMessage(a),this._heartbeat()}},this._connection.onerror=e=>{let{message:r,error:n,type:a}=e;pe(`error(message:${r},error:${n},type:${a})`)},this._connection.onclose=e=>{let{reason:r,code:n,wasClean:a}=e;pe(`close(reason:${r},code:${n},wasClean:${a})`),this._setConnected(!1),clearTimeout(this._pingTimeout),this._connectionLost(),this._reconnect()},this._heartbeat()}_reconnect(){if(pe("reconnect(),tryToReconnect:",this._tryToReconnect),!this._tryToReconnect)return;if(this.hooks.reconnect&&!this.hooks.reconnect()){pe("reconnect hook returned false");return}let e=process.env.WAPI_RECONNECT_ATTEMPTS&&parseInt(process.env.WAPI_RECONNECT_ATTEMPTS)||10,r=process.env.WAPI_MAX_RECONNECT_WAIT&&parseInt(process.env.WAPI_MAX_RECONNECT_WAIT)||1e4;this.$connect=(()=>ye(this,null,function*(){let n;for(let a=0;a<e+1;a++)try{pe("Trying to connect, attempt:",a);let{ws:s,$connect:i}=$x(this._config);n=yield i,this.socId=n,this._connection=s,this._ready();break}catch(s){if(s.code===me.AuthenticationError||a>e-1)throw s;yield CT(Math.min(Math.pow(1.5,a)*1e3,r))}return n}))()}_heartbeat(){pe("heartbeat"),clearTimeout(this._pingTimeout),this._pingTimeout=setTimeout(()=>{if(this._sending.size)return pe("pingTimeout reached, but sending.size:",this._sending.size),this._heartbeat();pe("timeout"),this._connection.close(),this._setConnected(!1),this._reconnect()},31e3)}_send(e){pe("send()",e),this._connection.send(JSON.stringify(e))}close(){return ye(this,null,function*(){return pe("close()"),this._tryToReconnect=!1,clearTimeout(this._pingTimeout),this._setConnected(!1),this._connection.close()})}};var Vh=ri(Rx());function Hh(t){let e=SJ(t);return new Ax(e,t)}function SJ(t){function e(a){return ye(this,null,function*(){pe(`http_createConnection>message(body:${a})`)})}function r(a,s){return ye(this,null,function*(){let i=JSON.parse(a),f=yield(yield(0,Vh.default)(`${t.host}/api`,{keepalive:!0,method:"POST",headers:{Authorization:`Bearer ${s}`},body:a})).json();this.onmessage(q(P({},f),{id:i.id}))})}let n=(0,Vh.default)(`${t.host}/api`,{method:"POST",headers:{Authorization:`Bearer ${t.jwt}`},body:JSON.stringify({jsonrpc:ve.version,method:"authenticationCheck",params:{},id:as()})}).then(a=>a.json()).then(a=>{if(a.error)throw new Error(a.error.message);return!0});return{send:r,onmessage:e,$connect:n}}var Ax=class extends Ci{constructor(e,r){super(e,dt.https,e.$connect);this.jwt=r.jwt,this.$connect.then(()=>{this._ready()}).catch(n=>{this._setErrored(n)})}_send(e){pe("send()",e),this._connection.send(JSON.stringify(e),this.jwt)}_ready(){this._setConnected(!0),this._connection.onmessage=e=>ye(this,null,function*(){pe(`http_message(data:${e})`),this._handleMessage(e)})}close(){return ye(this,null,function*(){pe("close()"),this._setConnected(!1)})}_reconnect(){return ye(this,null,function*(){pe("reconnect()")})}};var Tl=class{constructor(e){this.filter=[];this.modifierFn=e}add(e){return this.filter.push(e),this}addWhere(e,r,n,a){if(typeof r=="object"){let s={};for(let[i,o]of Object.entries(r))s[i]=this.modifierFn?this.modifierFn(i,o):o;return this.add({function:e,value:s})}if(typeof r=="function"){let s=new Tl(this.modifierFn);return r.call(s,s),this.add({function:e,inner:s.toJSON().filter})}if(a!==void 0)return this.add({function:e,field:r,operator:n,value:a});if(typeof n=="object")return this.add({function:e,value:{[r]:n}});if(n!==void 0){let s=this.modifierFn?this.modifierFn(r,n):n;return this.add({function:e,field:r,value:s})}throw TypeError("Invalid input")}where(e,r,n){return this.addWhere("where",e,r,n)}orWhere(e,r,n){return this.addWhere("orWhere",e,r,n)}whereIn(e,r){return this.add({function:"whereIn",field:e,value:r})}orWhereIn(e,r){return this.add({function:"orWhereIn",field:e,value:r})}whereNull(e){return this.add({function:"whereNull",field:e})}orWhereNull(e){return this.add({function:"orWhereNull",field:e})}whereNotNull(e){return this.add({function:"whereNotNull",field:e})}orWhereNotNull(e){return this.add({function:"orWhereNotNull",field:e})}whereMetadata(e,r,n){return n===void 0?this.add({function:"whereMetadata",field:e,operator:"=",value:r}):this.add({function:"whereMetadata",field:e,operator:r,value:n})}orWhereMetadata(e,r,n){return n===void 0?this.add({function:"orWhereMetadata",field:e,operator:"=",value:r}):this.add({function:"orWhereMetadata",field:e,operator:r,value:n})}whereMetadataIn(e,r){return this.add({function:"whereMetadataIn",field:e,value:r})}orWhereMetadataIn(e,r){return this.add({function:"orWhereMetadataIn",field:e,value:r})}whereMetadataNull(e){return this.add({function:"whereMetadataNull",field:e})}orWhereMetadataNull(e){return this.add({function:"orWhereMetadataNull",field:e})}whereMetadataNotNull(e){return this.add({function:"whereMetadataNotNull",field:e})}orWhereMetadataNotNull(e){return this.add({function:"orWhereMetadataNotNull",field:e})}toJSON(){return{filter:JSON.parse(JSON.stringify(this.filter))}}};function zh(t){return t.map(e=>{if(typeof e=="string"){if(e.includes(" "))throw new TypeError("invalid order option: "+e);return{field:e,direction:"asc"}}return{field:e.column,direction:e.order,nulls:e.nulls}})}var rd=class extends Tl{constructor({start:e,modifiers:r,optionsModifiers:n}){super(r);this.optionsObject={};this.execFn=e,this.optionsModifiers=n}start(){return this.execFn(this.toJSON())}toJSON(){return q(P({},super.toJSON()),{options:P({},this.optionsObject)})}options(e){if(this.optionsModifiers===void 0)return this.optionsObject=P(P({},this.optionsObject),e),this;this.optionsObject=P({},this.optionsObject);for(let[r,n]of Object.entries(e))this.optionsObject[r]=this.optionsModifiers(r,n);return this}then(e,r){return this.start().then(e,r)}catch(e){return this.start().catch(e)}stream(){return this.start().stream()}},Qe=class extends rd{constructor({start:e,modifiers:r,optionsModifiers:n}){super({start:a=>e(a),modifiers:r,optionsModifiers:n})}limit(e){return this.optionsObject.limit=e,this}offset(e){return this.optionsObject.offset=e,this}orderBy(e,r,n){if(!Array.isArray(e)&&typeof e!="string")throw new TypeError("invalid input");if(Array.isArray(e))return this.optionsObject.order=zh(e),this;if(!e.includes(" "))return this.optionsObject.order=zh([{column:e,order:r||"asc",nulls:n}]),this;let[a,s,i,o]=e.split(" ");if(s!=="asc"&&s!=="desc")throw new TypeError("invalid order");let f={column:a,order:s};if(i==="nulls"){if(!["first","last"].includes(o))throw new TypeError("invalid nulls order");f.nulls=o}return this.optionsObject.order=zh([e]),this}select(...e){return this.optionsObject.select=e,this}deselect(...e){return this.optionsObject.deselect=e,this}};function Di(t,e){if(!e)return{function:t,alias:t};if(!e.includes(" "))return{function:t,field:e,alias:t};if(!e.includes(" as "))throw new de({message:"Invalid Aggregator"});let[r,n]=e.split(" as ");return{function:t,field:r,alias:n||r}}var Kh=class extends rd{constructor({start:e,modifiers:r,optionsModifiers:n}){super({start:a=>e(a),modifiers:r,optionsModifiers:n});this.aggregatorObject={aggregators:[]};this.timezoneString=""}toJSON(){return q(P({},super.toJSON()),{aggregators:JSON.parse(JSON.stringify(this.aggregatorObject.aggregators)),groups:JSON.parse(JSON.stringify(this.aggregatorObject.groups||[]))})}timezone(e){return this.timezoneString=e,this.aggregatorObject.groups&&Array.isArray(this.aggregatorObject.groups)&&this.aggregatorObject.groups.forEach(r=>{r.type==="period"&&(r.field={period:r.field,timezone:e})}),this}groupBy(e,...r){let n={};if(typeof e!="string")throw new TypeError("expected string as input, got"+typeof e);let[a,s]=e.split(" as ");if(Ju.hasOwnProperty(a))n.type="period",n.alias=s||a,this.timezoneString?n.field={period:a,timezone:this.timezoneString}:n.field=a;else if(a.startsWith("metadata.")){let[,i]=a.split(".");n.type="metadata_field",n.field=i,n.alias=s||i}else n.type="field",n.field=a,n.alias=s||a;return this.aggregatorObject.groups?this.aggregatorObject.groups.push(n):this.aggregatorObject.groups=[n],r.length&&r.forEach(i=>this.groupBy(i)),this}count(e){return this.aggregatorObject.aggregators.push(Di("count",e)),this}distinct(e){return this.aggregatorObject.aggregators.push(Di("countDistinct",e)),this}avg(e){return this.aggregatorObject.aggregators.push(Di("average",e)),this}min(e){return this.aggregatorObject.aggregators.push(Di("min",e)),this}max(e){return this.aggregatorObject.aggregators.push(Di("max",e)),this}sum(e){return this.aggregatorObject.aggregators.push(Di("sum",e)),this}},nd=class extends rd{constructor({start:e,modifiers:r,optionsModifiers:n}){super({start:e,modifiers:r,optionsModifiers:n});this.updateObject={}}toJSON(){return q(P({},super.toJSON()),{update:JSON.parse(JSON.stringify(this.updateObject))})}update(e){return this.updateObject=Object.assign(this.updateObject,e),this}},Qh=class extends rd{constructor({start:e,modifiers:r,optionsModifiers:n}){super({start:e,modifiers:r,optionsModifiers:n});this.reverseModifications={}}toJSON(){return q(P({},super.toJSON()),{reverse:JSON.parse(JSON.stringify(this.reverseModifications))})}reverse(e){return this.reverseModifications=Object.assign(this.reverseModifications,e),this}};"use strict";var CJ=F(x.AggregateTransfersFnInput);function yl(t,e,r){let{client:n}=t;if(e===void 0)return new Kh({start(y){return n.api.aggregateTransferMany({transfer:y.filter,options:y.options,groups:y.groups,aggregators:y.aggregators})},modifiers(y,j){return["token","wallet","from_wallet","to_wallet"].includes(y)?G(j):y==="transfer_group"?J(j):j}});let{inputCopy:a,error:s}=M({input:e,options:r,validate:CJ});if(s)throw s;let{token:i,wallet:o,from_wallet:f,to_wallet:u,transfer_group:l,status:_,metadata:b}=a,w={token:G(i),wallet:G(o),from_wallet:G(f),to_wallet:G(u),transfer_group:J(l),status:_,metadata:b};return n.api.aggregateTransferMany({transfer:w,groups:a.groups,aggregators:a.aggregators})}"use strict";var PJ=F(x.CreateAccessTokenFnInput);function bl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:PJ});if(s)throw s;return n.api.createAccessToken({token:a.token,options:t})}"use strict";var GJ=F(x.CreateContractFnInput);function xl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:GJ});if(s)throw s;let i={token:{foreign:a.foreign+"",metadata:a.metadata,owner:G(a.owner),deposits:[{token:G(a.value_token),amount:a.value_amount}]}};return a.buyer&&(a.buyer.latest_control_hash&&console.warn("deprecated: latest_control_hash is deprecated and will be ignored"),i.exchange={from_wallet:G(a.buyer.wallet),amount:a.buyer.amount||a.value_amount,from_token:G(a.buyer.token||a.value_token),metadata:a.buyer.metadata}),n.api.createContract(i)}"use strict";var DJ=F(x.CreateDepositFnInput);function Fl(t,e,r){let{client:n}=t,a=yt(e,"token",n.getConfig("token")),{inputCopy:s,error:i}=M({input:a,options:r,validate:DJ});if(i)throw i;let o=s.token||n.getConfig("token");if(o===void 0)throw new de({message:re.INPUT_NEEDS_TOKEN,data:e});let f=s.options;delete s.options;let u=q(P({},s),{identifier:s.identifier,transfer_group:J(s.transfer_group),token:G(o),to_wallet:G(s.wallet),type:"deposit"});return u.identifier||(u.identifier=Re(u)),n.api.createTransfer({transfer:u,options:Gd(f,{return_balance:"return_to_balance",create_wallet_if_not_exists:"create_to_wallet_if_not_exists"})})}"use strict";var MJ=F(x.CreateExchangeFnInput);function wl(t,e,r){var o,f,u,l,_;let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:MJ});if(s)throw s;let i=a.options;return delete a.options,(o=a.identifier)!=null||(a.identifier=Re(a)),n.api.createTransferGroup({transfer_group:{identifier:a.identifier,status:ad.closed,transfer_status:(f=a.status)!=null?f:"pending",metadata:a.metadata,children:[{identifier:(u=a.from_identifier)!=null?u:Re(),from_wallet:G(a.from_wallet),to_wallet:G(a.to_wallet),token:G(a.from_token),type:a.from_wallet?za.transfer:za.deposit,amount:a.from_amount,metadata:a.metadata,force:a.force},{identifier:(l=a.to_identifier)!=null?l:Re(),from_wallet:G(a.to_wallet),to_wallet:G(a.from_wallet),token:G(a.to_token),type:a.to_wallet?za.transfer:za.deposit,amount:(_=a.to_amount)!=null?_:a.from_amount,metadata:a.metadata,force:a.force}]},options:i})}"use strict";var WJ=F(x.CreateTokenFnInput);function $l(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:WJ});if(s)throw s;let i=a.options;return delete a.options,n.api.createToken({token:q(P({},a),{belongs_to:G(a.belongs_to)}),options:i})}"use strict";var EJ=F(x.CreateTransferFnInput);function Ol(t,e,r){let{client:n}=t,a=yt(e,"token",n.getConfig("token")),{inputCopy:s,error:i}=M({input:a,options:r,validate:EJ});if(i)throw i;let o=Ka(s,n.getConfig("token"));return o.identifier||(o.identifier=Re(o)),n.api.createTransfer({transfer:o,options:s.options})}function Ka(t,e){t.type=t.type||"transfer";let r={identifier:t.identifier,token:G(t.token||e),amount:t.amount,metadata:t.metadata,status:t.status,type:t.type,transfer_group:J(t.transfer_group),created_at:t.created_at};if(t.type==="transfer")return t.latest_control_hash&&console.warn("deprecated: latest_control_hash is deprecated"),q(P({},r),{from_wallet:G(t.from_wallet),to_wallet:G(t.to_wallet)});if(t.type==="withdrawal")return t.latest_control_hash&&console.warn("deprecated: latest_control_hash is deprecated"),q(P({},r),{from_wallet:G(t.wallet)});if(t.type==="deposit")return q(P({},r),{to_wallet:G(t.wallet)})}"use strict";var RJ=F(x.CreateTransferGroupFnInput);function vl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:RJ});if(s)throw s;let i=JSON.parse(JSON.stringify(a));return delete i.options,i.children&&(i.children=i.children.map(o=>Ka(o,n.getConfig("token")))),i.identifier||(i.identifier=Re(i)),n.api.createTransferGroup({transfer_group:i,options:a.options})}"use strict";var AJ=F(x.CreateTransfersFnInput);function jl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:AJ});if(s)throw s;let i=a.transfers.map(o=>Ka(o,n.getConfig("token")));for(let o of i)o.identifier||(o.identifier=Re(o));return n.api.createTransferMany({transfers:i,options:a.options})}"use strict";var UJ=F(x.CreateWalletFnInput);function Il(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:UJ});if(s)throw s;let i=a.options;return delete a.options,n.api.createWallet({wallet:P({},a),options:i})}"use strict";var qJ=F(x.CreateWithdrawalFnInput);function kl(t,e,r){let{client:n}=t,a=yt(e,"token",n.getConfig("token")),{inputCopy:s,error:i}=M({input:a,options:r,validate:qJ});if(i)throw i;let o=s.options;delete s.options,s.latest_control_hash&&(console.warn("deprecated: latest_control_hash is deprecated"),delete s.latest_control_hash);let f=s.token||n.getConfig("token");if(f===void 0)throw new de({message:re.INPUT_NEEDS_TOKEN,data:e});let u=q(P({},s),{identifier:s.identifier,transfer_group:J(s.transfer_group),token:G(f),from_wallet:G(s.wallet),type:"withdrawal"});return u.identifier||(u.identifier=Re(u)),n.api.createTransfer({transfer:u,options:Gd(o,{return_balance:"return_from_balance"})})}"use strict";var NJ=F(x.FindBalancesFnInput);function Sl(t,e,r){var u,l;let{client:n}=t;if(e===void 0)return new Qe({start(_){return n.api.findBalanceMany({balance:_.filter,options:_.options})},modifiers(_,b){return["wallet","token"].includes(_)?G(b):b}});let{inputCopy:a,error:s}=M({input:e,options:r,validate:NJ});if(s)throw s;let i={};a.wallet&&(i.wallet=G(a.wallet)),a.token&&(i.token=G(a.token));let o=(u=a.options)==null?void 0:u.order_by;(l=a.options)==null||delete l.order_by;let f=P({},a.options);return!f.order&&o&&(f.order=bt(o)),n.api.findBalanceMany({balance:i,options:f})}"use strict";var BJ=F(x.FindTokensFnInput);function Cl(t,e,r){var u,l;let{client:n}=t;if(e===void 0)return new Qe({start(_){return n.api.findTokenMany({token:_.filter,options:_.options})},modifiers(_,b){return["belongs_to"].includes(_)?G(b):b}});let{inputCopy:a,error:s}=M({input:e,options:r,validate:BJ});if(s)throw s;let i={foreign:a.foreign?a.foreign+"":void 0,type:a.type,metadata:a.metadata};a.belongs_to&&(i.belongs_to=G(a.belongs_to));let o=(u=a.options)==null?void 0:u.order_by;(l=a.options)==null||delete l.order_by;let f=P({},a.options);return!f.order&&o&&(f.order=bt(o)),n.api.findTokenMany({token:i,options:f})}"use strict";var LJ=F(x.FindTransferGroupsFnInput);function Pl(t,e,r){var y,j;let{client:n}=t;if(e===void 0)return new Qe({start(I){return n.api.findTransferGroupMany({transfer_group:I.filter,options:I.options})},modifiers(I,k){return["transfer_group","reverses"].includes(I)?J(k):k}});let{inputCopy:a,error:s}=M({input:e,options:r,validate:LJ});if(s)throw s;let{identifier:i,transfer_status:o,status:f,metadata:u,type:l}=a,_={identifier:i,transfer_status:o,status:f,metadata:u,type:l};a.reverses&&(_.reverses=J(a.reverses));let b=(y=a.options)==null?void 0:y.order_by;(j=a.options)==null||delete j.order_by;let w=P({},a.options);return!w.order&&b&&(w.order=bt(b)),n.api.findTransferGroupMany({transfer_group:_,options:w})}"use strict";var VJ=F(x.FindTransfersFnInput);function Gl(t,e,r){var j;let{client:n}=t;if(e===void 0)return new Qe({start(I){return n.api.findTransferMany({transfer:I.filter,options:I.options})},modifiers(I,k){return["token","wallet","from_wallet","to_wallet"].includes(I)?G(k):I==="transfer_group"?J(k):k}});let{inputCopy:a,error:s}=M({input:e,options:r,validate:VJ});if(s)throw s;let{token:i,wallet:o,from_wallet:f,to_wallet:u}=a,l={token:G(i),wallet:G(o),from_wallet:G(f),to_wallet:G(u)};a.transfer_group&&(l.transfer_group=J(a.transfer_group)),a.status&&(l.status=a.status),a.metadata&&(l.metadata=a.metadata),(j=a.options)!=null||(a.options={});let _=a.options.order_by;if(delete a.options.order_by,a.options.return_running_balance){if(a.options.return_running_balance_for_wallet)throw new de({message:re.CONFLICTING_OPTIONS,data:{options:a.options}});if(!l.wallet)throw new de({message:re.RUNNING_BALANCE_WITHOUT_WALLET,data:{input:a}});a.options.return_running_balance_for_wallet=a.wallet}let b=a.options.return_running_balance_for_wallet;if(delete a.options.return_running_balance_for_wallet,a.options.return_signed_amount){if(a.options.return_signed_amount_for_wallet)throw new de({message:re.CONFLICTING_OPTIONS,data:{options:a.options}});if(!l.wallet)throw new de({message:re.SIGNED_AMOUNT_WITHOUT_WALLET,data:{input:a}});a.options.return_signed_amount_for_wallet=a.wallet}let w=a.options.return_signed_amount_for_wallet;delete a.options.return_signed_amount_for_wallet;let y=P({},a.options);return!y.order&&_&&(y.order=bt(_)),b&&(y.return_running_balance_for_wallet=G(b)),w&&(y.return_signed_amount_for_wallet=G(w)),n.api.findTransferMany({transfer:l,options:y})}"use strict";var HJ=F(x.FindWalletsFnInput);function Dl(t,e,r){var l;let{client:n}=t;if(e===void 0)return new Qe({start(_){return n.api.findWalletMany({wallet:_.filter,options:_.options})},optionsModifiers(_,b){return _==="include_balance_for_token"&&typeof b!="object"?G(b):b}});let{inputCopy:a,error:s}=M({input:e,options:r,validate:HJ});if(s)throw s;let i=(l=a.options)!=null?l:{};delete a.options;let o=P({},a),f=i.order_by;delete i.order_by;let u=P({},i);return!u.order&&f&&(u.order=bt(f)),n.api.findWalletMany({wallet:o,options:u})}"use strict";var zJ=F(x.GetBalanceFnInput);function Ml(t,e,r){let{client:n}=t,a=yt(e,"token",n.getConfig("token")),{inputCopy:s,error:i}=M({input:a,options:r,validate:zJ});if(i)throw i;if(s.datetime&&WT(s.datetime))throw new de({message:re.BAL_FUTURE_DATETIME,data:s});let o=s.token||n.getConfig("token");if(o===void 0)throw new de({message:re.INPUT_NEEDS_TOKEN,data:e});return n.api.getBalance({balance:{wallet:G(s.wallet),token:G(o),datetime:s.datetime},options:s.options})}"use strict";var KJ=F(x.GetBalanceHistoryFnInput);function Wl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:KJ});if(s)throw s;let i=a.token||n.getConfig("token");if(i===void 0)throw new de({message:re.INPUT_NEEDS_TOKEN,data:e});return n.api.getBalanceHistory({balance:{wallet:G(a.wallet),token:G(i)},options:a.options})}"use strict";var QJ=F(x.GetFlagsFnInput);function El(t,e,r){let{client:n}=t,{error:a,inputCopy:s}=M({input:e||{},options:r,validate:QJ});if(a)throw a;return n.api.getFlags({options:s.options})}"use strict";var JJ=F(x.GetStatisticsFnInput);function Rl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e||{},options:r,validate:JJ});if(s)throw s;return n.api.getStatistics({model:a.model||"Transfer",aggregator:a.aggregator||"count",groups:a.groups,filter:a.filter,options:a.options})}"use strict";var XJ=F(x.GetTokenFnInput);function Al(t,e={},r){let{client:n}=t,a=yt(e,"foreign",n.getConfig("token")),{inputCopy:s,error:i}=M({input:a,options:r,validate:XJ});if(i)throw i;let o=s.foreign||n.getConfig("token");if(o===void 0)throw new de({message:re.INPUT_NEEDS_TOKEN,data:e});return n.api.getToken({token:G(o),options:s.options})}"use strict";var YJ=F(x.GetTransferFnInput);function Ul(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:YJ});if(s)throw s;return n.api.getTransfer({transfer:J(a.transfer),options:a.options})}"use strict";var ZJ=F(x.GetTransferGroupFnInput);function ql(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:ZJ});if(s)throw s;return n.api.getTransferGroup({transfer_group:J(a.transfer_group),options:a.options})}"use strict";var e4=F(x.GetWalletFnInput);function Nl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:e4});if(s)throw s;return n.api.getWallet({wallet:G(a.wallet),options:a.options})}var t4=F(x.ImportDataFnInput);function Bl(t){let{error:e}=t4(t);return e===void 0}var Mle=F(x.ImportDataFnOutput);var r4=F(x.ImportDataFnStreamChunk);function Ux(t){let{error:e}=r4(t);return e===void 0}var n4=F(x.ImportDataFnOptions);function Mi(t){let{error:e}=n4(t);return e===void 0}"use strict";var a4=F(x.ImportDataFnInput);function Ll(t,e,r){let{client:n}=t;if(e===void 0&&r===void 0)return n.api.importActionsStream(void 0,qx());if(r===void 0&&Mi(e))return n.api.importActionsStream(e,qx());let{inputCopy:a,error:s}=M({input:e,options:r,validate:a4});if(s)throw s;return n.api.importActions(a)}var s4=F(x.ImportDataFnStreamChunk);function qx(){let t=[];return new Hc({dataTransform(e){return ye(this,null,function*(){if(e===void 0)return{actions:t};if(!Ux(e)){let{error:r}=s4(e);throw new Ne({message:re.INPUT_INVALID,data:{data:e,error:r}})}if(t.push(i4(e)),t.length>=50){let r=t;return t=[],{actions:r}}})}})}function i4(t){switch(t.target){case"wallet":return t;case"token":return{target:"token",data:q(P({},t.data),{belongs_to:G(t.data.belongs_to)})};case"transfer":return{target:"transfer",data:q(P({},Ka(q(P({},t.data),{status:"pending"}))),{status:t.data.status,status_finalized_at:t.data.status_finalized_at})};case"transfer_group":return{target:"transfer_group",data:q(P({},t.data),{children:t.data.children.map(e=>Ka(e))})}}}"use strict";var o4=F(x.ReverseTransferFnInput);function Vl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:o4});if(s)throw s;return a.extend_metadata&&console.warn("deprecated: extend_metadata is deprecated. Use metadata_action instead"),n.api.reverseTransfer({transfer:J(a.transfer),reverse:{force:a.force,metadata:a.metadata,extend_metadata:a.extend_metadata,identifier:a.identifier,status:a.status},options:a.options})}"use strict";var p4=F(x.ReverseTransferGroupFnInput);function Hl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:p4});if(s)throw s;return a.extend_metadata&&console.warn("deprecated: extend_metadata is deprecated. Use metadata_action instead"),n.api.reverseTransferGroup({transfer_group:J(a.transfer_group),reverse:{status:a.status,force:a.force,transfer_status:a.transfer_status,identifier:a.identifier,metadata:a.metadata,transfer_metadata:a.transfer_metadata,extend_metadata:a.extend_metadata,transfer_extend_metadata:a.transfer_extend_metadata},options:a.options})}"use strict";var f4=F(x.ReverseTransfersFnInput);function zl(t,e,r){let{client:n}=t;if(e===void 0)return new Qh({start(_){return n.api.reverseTransferMany({transfer:_.filter,reverse:_.reverse,options:_.options})},modifiers(_,b){return["token","wallet","from_wallet","to_wallet"].includes(_)?G(b):_==="transfer_group"?J(b):b}});let{inputCopy:a,error:s}=M({input:e,options:r,validate:f4});if(s)throw s;let{token:i,wallet:o,from_wallet:f,to_wallet:u}=a,l={token:G(i),wallet:G(o),from_wallet:G(f),to_wallet:G(u)};return a.transfer_group&&(l.transfer_group=J(a.transfer_group)),a.status&&(l.status=a.status),a.metadata&&(l.metadata=a.metadata),n.api.reverseTransferMany({transfer:l,reverse:a.reverse,options:a.options})}var Jh;(function(r){r.whereMetadata="whereMetadata",r.orWhereMetadata="orWhereMetadata"})(Jh||(Jh={}));var Xh;(function(r){r.where="where",r.orWhere="orWhere"})(Xh||(Xh={}));var Yh;(function(r){r.whereIn="whereIn",r.orWhereIn="orWhereIn"})(Yh||(Yh={}));var Zh;(function(r){r.whereMetadataIn="whereMetadataIn",r.orWhereMetadataIn="orWhereMetadataIn"})(Zh||(Zh={}));var eg;(function(a){a.whereMetadataNull="whereMetadataNull",a.orWhereMetadataNull="orWhereMetadataNull",a.whereMetadataNotNull="whereMetadataNotNull",a.orWhereMetadataNotNull="orWhereMetadataNotNull"})(eg||(eg={}));var tg;(function(a){a.whereNull="whereNull",a.orWhereNull="orWhereNull",a.whereNotNull="whereNotNull",a.orWhereNotNull="orWhereNotNull"})(tg||(tg={}));var rg;(function(t){t["="]="=",t[">="]=">=",t["<="]="<=",t["<"]="<",t[">"]=">"})(rg||(rg={}));var ng;(function(r){r.like="like",r.ilike="ilike"})(ng||(ng={}));var ag;(function(r){r["="]="=",r[">="]=">=",r["<="]="<=",r["<"]="<",r[">"]=">",r.like="like",r.ilike="ilike"})(ag||(ag={}));var sg;(function(a){a.value="value",a.share="share",a.group="group",a.contract="contract"})(sg||(sg={}));var ig;(function(r){r.active="active",r["dw-only"]="dw-only",r.disabled="disabled"})(ig||(ig={}));var ad;(function(r){r.open="open",r.closed="closed"})(ad||(ad={}));var og;(function(n){n.pending="pending",n.finished="finished",n.cancelled="cancelled"})(og||(og={}));var pg;(function(r){r.pending="pending",r.finished="finished"})(pg||(pg={}));var fg;(function(n){n.regular="regular",n.exchange="exchange",n.distribution="distribution"})(fg||(fg={}));var za;(function(n){n.transfer="transfer",n.deposit="deposit",n.withdrawal="withdrawal"})(za||(za={}));var ug;(function(n){n.token="token",n.house="house",n.regular="regular"})(ug||(ug={}));var dg;(function(r){r.active="active",r.disabled="disabled"})(dg||(dg={}));var lg;(function(r){r.flag="flag",r.setting="setting"})(lg||(lg={}));var cg;(function(o){o.Token="Token",o.TransferGroup="TransferGroup",o.TransferLog="TransferLog",o.Transfer="Transfer",o.WalletTokenSetting="WalletTokenSetting",o.Wallet="Wallet",o.WapiSetting="WapiSetting"})(cg||(cg={}));"use strict";var u4=F(x.SetFlagsFnInput);function Kl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:u4});if(s)throw s;let i=Object.keys(cs.definitions.Flags.properties),o={};if(i.forEach(f=>{f in a&&(o[f]=a[f])}),Object.keys(o).length<1)throw new de({message:`One of [${i.join()}] is required`,data:e});return n.api.setFlags({flags:o,options:a.options})}"use strict";var d4=F(x.UpdateTokenFnInput);function Ql(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:d4});if(s)throw s;return n.api.updateToken({token:G(a.token),update:{public:a.public,metadata:a.metadata,status:a.status},options:a.options})}"use strict";var l4=F(x.UpdateTransferFnInput);function Jl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:l4});if(s)throw s;return n.api.updateTransfer({transfer:J(a.transfer),update:{status:a.status,metadata:a.metadata},options:a.options})}"use strict";var c4=F(x.UpdateTransferGroupFnInput);function Xl(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:c4});if(s)throw s;return n.api.updateTransferGroup({transfer_group:J(a.transfer_group),update:{transfer_status:a.transfer_status,status:a.status},options:a.options})}"use strict";var m4=F(x.UpdateTransferGroupsFnInput);function Yl(t,e,r){let{client:n}=t;if(e===void 0)return new nd({start(b){return n.api.updateTransferGroupMany({transfer_group:b.filter,update:b.update,options:b.options})},modifiers(b,w){return["transfer_group","reverses"].includes(b)?J(w):w}});let{inputCopy:a,error:s}=M({input:e,options:r,validate:m4});if(s)throw s;let{transfer_status:i,status:o,metadata:f,type:u,update:l}=a,_={transfer_status:i,status:o,metadata:f,type:u};return a.reverses&&(_.reverses=J(a.reverses)),n.api.updateTransferGroupMany({transfer_group:_,update:l,options:a.options})}"use strict";var h4=F(x.UpdateTransfersFnInput);function Zl(t,e,r){let{client:n}=t;if(e===void 0)return new nd({start(_){return n.api.updateTransferMany({transfer:_.filter,update:_.update,options:_.options})},modifiers(_,b){return["token","wallet","from_wallet","to_wallet"].includes(_)?G(b):_==="transfer_group"?J(b):b}});let{inputCopy:a,error:s}=M({input:e,options:r,validate:h4});if(s)throw s;let{token:i,wallet:o,from_wallet:f,to_wallet:u}=a,l={token:G(i),wallet:G(o),from_wallet:G(f),to_wallet:G(u)};return a.transfer_group&&(l.transfer_group=J(a.transfer_group)),a.status&&(l.status=a.status),a.metadata&&(l.metadata=a.metadata),n.api.updateTransferMany({transfer:l,update:a.update,options:a.options})}"use strict";var g4=F(x.UpdateWalletFnInput);function ec(t,e,r){let{client:n}=t,{inputCopy:a,error:s}=M({input:e,options:r,validate:g4});if(s)throw s;return n.api.updateWallet({wallet:G(a.wallet),update:{metadata:a.metadata,status:a.status,name:a.name},options:a.options})}var _4={aggregateTransfers:F(x.AggregateTransfersFnInput),createAccessToken:F(x.CreateAccessTokenFnInput),createContract:F(x.CreateContractFnInput),createDeposit:F(x.CreateDepositFnInput),createExchange:F(x.CreateExchangeFnInput),createToken:F(x.CreateTokenFnInput),createTransfer:F(x.CreateTransferFnInput),createTransferGroup:F(x.CreateTransferGroupFnInput),createTransfers:F(x.CreateTransfersFnInput),createWallet:F(x.CreateWalletFnInput),createWithdrawal:F(x.CreateWithdrawalFnInput),findBalances:F(x.FindBalancesFnInput),findTokens:F(x.FindTokensFnInput),findTransferGroups:F(x.FindTransferGroupsFnInput),findTransfers:F(x.FindTransfersFnInput),findWallets:F(x.FindWalletsFnInput),getBalance:F(x.GetBalanceFnInput),getBalanceHistory:F(x.GetBalanceHistoryFnInput),getFlags:F(x.GetFlagsFnInput),getStatistics:F(x.GetStatisticsFnInput),getToken:F(x.GetTokenFnInput),getTransfer:F(x.GetTransferFnInput),getTransferGroup:F(x.GetTransferGroupFnInput),getWallet:F(x.GetWalletFnInput),importData:F(x.ImportDataFnInput),reverseTransfer:F(x.ReverseTransferFnInput),reverseTransferGroup:F(x.ReverseTransferGroupFnInput),reverseTransfers:F(x.ReverseTransfersFnInput),setFlags:F(x.SetFlagsFnInput),updateToken:F(x.UpdateTokenFnInput),updateTransfer:F(x.UpdateTransferFnInput),updateTransferGroup:F(x.UpdateTransferGroupFnInput),updateTransferGroups:F(x.UpdateTransferGroupsFnInput),updateTransfers:F(x.UpdateTransfersFnInput),updateWallet:F(x.UpdateWalletFnInput)},U={aggregateTransfers:yl,createAccessToken:bl,createContract:xl,createDeposit:Fl,createExchange:wl,createToken:$l,createTransfer:Ol,createTransferGroup:vl,createTransfers:jl,createWallet:Il,createWithdrawal:kl,findBalances:Sl,findTokens:Cl,findTransferGroups:Pl,findTransfers:Gl,findWallets:Dl,getBalance:Ml,getBalanceHistory:Wl,getFlags:El,getStatistics:Rl,getToken:Al,getTransfer:Ul,getTransferGroup:ql,getWallet:Nl,importData:Ll,reverseTransfer:Vl,reverseTransferGroup:Hl,reverseTransfers:zl,setFlags:Kl,updateToken:Ql,updateTransfer:Jl,updateTransferGroup:Xl,updateTransferGroups:Yl,updateTransfers:Zl,updateWallet:ec},mg;(function(D){D.aggregateTransfers="aggregateTransfers",D.createAccessToken="createAccessToken",D.createContract="createContract",D.createDeposit="createDeposit",D.createExchange="createExchange",D.createToken="createToken",D.createTransfer="createTransfer",D.createTransferGroup="createTransferGroup",D.createTransfers="createTransfers",D.createWallet="createWallet",D.createWithdrawal="createWithdrawal",D.findBalances="findBalances",D.findTokens="findTokens",D.findTransferGroups="findTransferGroups",D.findTransfers="findTransfers",D.findWallets="findWallets",D.getBalance="getBalance",D.getBalanceHistory="getBalanceHistory",D.getFlags="getFlags",D.getStatistics="getStatistics",D.getToken="getToken",D.getTransfer="getTransfer",D.getTransferGroup="getTransferGroup",D.getWallet="getWallet",D.importData="importData",D.reverseTransfer="reverseTransfer",D.reverseTransferGroup="reverseTransferGroup",D.reverseTransfers="reverseTransfers",D.setFlags="setFlags",D.updateToken="updateToken",D.updateTransfer="updateTransfer",D.updateTransferGroup="updateTransferGroup",D.updateTransferGroups="updateTransferGroups",D.updateTransfers="updateTransfers",D.updateWallet="updateWallet"})(mg||(mg={}));var hg;(function(r){r.findTransfers="findTransfers",r.findWallets="findWallets"})(hg||(hg={}));var sd=class{constructor(e,r){this.config={};if(this.api=e,this.$connect=e.$connect,r&&(r.token&&(this.config=q(P({},this.config),{token:r.token})),r.hooks))for(let[n,a]of Object.entries(r.hooks))this.setHook(n,a)}close(){return ye(this,null,function*(){return this.api.close()})}version(){return hl}setHook(e,r){if(typeof r!="function")throw new TypeError("Hooks can only be functions");return this.api.hooks[e]=r,this}configure(e){return this.config=P(P({},this.config),e),this}getConfig(e){return this.config[e]}aggregateTransfers(e,r){return e===void 0?U.aggregateTransfers({client:this}):U.aggregateTransfers({client:this},e,r)}createAccessToken(e,r){return U.createAccessToken({client:this},e,r)}createContract(e,r){return U.createContract({client:this},e,r)}createDeposit(e,r){return U.createDeposit({client:this},e,r)}createExchange(e,r){return U.createExchange({client:this},e,r)}createToken(e,r){return U.createToken({client:this},e,r)}createTransfer(e,r){return U.createTransfer({client:this},e,r)}createTransferGroup(e,r){return U.createTransferGroup({client:this},e,r)}createTransfers(e,r){return U.createTransfers({client:this},e,r)}createWallet(e,r){return U.createWallet({client:this},e,r)}createWithdrawal(e,r){return U.createWithdrawal({client:this},e,r)}findBalances(e,r){return e===void 0?U.findBalances({client:this}):U.findBalances({client:this},e,r)}findTokens(e,r){return e===void 0?U.findTokens({client:this}):U.findTokens({client:this},e,r)}findTransferGroups(e,r){return e===void 0?U.findTransferGroups({client:this}):U.findTransferGroups({client:this},e,r)}findTransfers(e,r){return e===void 0?U.findTransfers({client:this}):U.findTransfers({client:this},e,r)}findWallets(e,r){return e===void 0?U.findWallets({client:this}):U.findWallets({client:this},e,r)}getBalance(e,r){return U.getBalance({client:this},e,r)}getBalanceHistory(e,r){return U.getBalanceHistory({client:this},e,r)}getFlags(e,r){return U.getFlags({client:this},e,r)}getStatistics(e,r){return U.getStatistics({client:this},e,r)}getToken(e,r){return U.getToken({client:this},e,r)}getTransfer(e,r){return U.getTransfer({client:this},e,r)}getTransferGroup(e,r){return U.getTransferGroup({client:this},e,r)}getWallet(e,r){return U.getWallet({client:this},e,r)}importData(e,r){if(e===void 0&&r===void 0)return U.importData({client:this});if(r===void 0&&Mi(e))return U.importData({client:this},e);if(Bl(e))return U.importData({client:this},e,r);throw new Ne({message:re.INPUT_INVALID,data:{input:e,options:r}})}reverseTransfer(e,r){return U.reverseTransfer({client:this},e,r)}reverseTransferGroup(e,r){return U.reverseTransferGroup({client:this},e,r)}reverseTransfers(e,r){return e===void 0?U.reverseTransfers({client:this}):U.reverseTransfers({client:this},e,r)}setFlags(e,r){return U.setFlags({client:this},e,r)}updateToken(e,r){return U.updateToken({client:this},e,r)}updateTransfer(e,r){return U.updateTransfer({client:this},e,r)}updateTransferGroup(e,r){return U.updateTransferGroup({client:this},e,r)}updateTransferGroups(e,r){return e===void 0?U.updateTransferGroups({client:this}):U.updateTransferGroups({client:this},e,r)}updateTransfers(e,r){return e===void 0?U.updateTransfers({client:this}):U.updateTransfers({client:this},e,r)}updateWallet(e,r){return U.updateWallet({client:this},e,r)}};function Nx(t,e){let r=Mh(t);return new sd(r,e)}function Bx(t,e){let r=Hh(t);return new sd(r,e)}var T4=Qu.getValidator(x.ClientOptions),dt;(function(r){r.ws="ws",r.https="https"})(dt||(dt={}));function y4(t){let e=t.config,{inputCopy:r,error:n}=T4(t);if(n)throw n;if(r.client===dt.ws)return Nx(r.connection,e);if(r.client===dt.https)return Bx(r.connection,e);throw new TypeError("Invalid client type")}var b4={getIdentifier:PT};0&&(module.exports={APIFunctions,APIValidators,AggregateTransferManyTxInputSchema,AggregateTransferManyTxOutputSchema,AggregateTransfersFnInputSchema,AggregateTransfersFnOutputSchema,AuthenticationCheckTxInputSchema,AuthenticationCheckTxOutputSchema,Client,ClientFunctions,ClientFunctionsEnum,ClientQueryBuilderFunctionsEnum,ClientValidators,ConstsSchema,CreateAccessTokenFnInputSchema,CreateAccessTokenFnOutputSchema,CreateAccessTokenTxInputSchema,CreateAccessTokenTxOutputSchema,CreateContractFnInputSchema,CreateContractFnOutputSchema,CreateContractTxInputSchema,CreateContractTxOutputSchema,CreateDepositFnInputSchema,CreateDepositFnOutputSchema,CreateDepositTxInputSchema,CreateDepositTxOutputSchema,CreateDistributionTxInputSchema,CreateDistributionTxOutputSchema,CreateExchangeFnInputSchema,CreateExchangeFnOutputSchema,CreateTokenFnInputSchema,CreateTokenFnOutputSchema,CreateTokenTxInputSchema,CreateTokenTxOutputSchema,CreateTransferFnInputSchema,CreateTransferFnOutputSchema,CreateTransferGroupFnInputSchema,CreateTransferGroupFnOutputSchema,CreateTransferGroupTxInputSchema,CreateTransferGroupTxOutputSchema,CreateTransferManyTxInputSchema,CreateTransferManyTxOutputSchema,CreateTransferTxInputSchema,CreateTransferTxOutputSchema,CreateTransfersFnInputSchema,CreateTransfersFnOutputSchema,CreateWalletFnInputSchema,CreateWalletFnOutputSchema,CreateWalletTxInputSchema,CreateWalletTxOutputSchema,CreateWithdrawalFnInputSchema,CreateWithdrawalFnOutputSchema,CreateWithdrawalTxInputSchema,CreateWithdrawalTxOutputSchema,DbFilterFunctionBasicEnum,DbFilterFunctionInEnum,DbFilterFunctionMetadataBasicEnum,DbFilterFunctionMetadataInEnum,DbFilterFunctionMetadataNullEnum,DbFilterFunctionNullEnum,DbFilterOperatorEnum,DbFilterOperatorExtendedEnum,DbFilterOperatorStringEnum,DbModelNameEnum,ErrorMessage,Errors,ExportDatabaseTxInputSchema,ExportDatabaseTxOutputSchema,FindBalanceManyTxInputSchema,FindBalanceManyTxOutputSchema,FindBalancesFnInputSchema,FindBalancesFnOutputSchema,FindTokenManyTxInputSchema,FindTokenManyTxOutputSchema,FindTokensFnInputSchema,FindTokensFnOutputSchema,FindTransferGroupManyTxInputSchema,FindTransferGroupManyTxOutputSchema,FindTransferGroupsFnInputSchema,FindTransferGroupsFnOutputSchema,FindTransferManyTxInputSchema,FindTransferManyTxOutputSchema,FindTransfersFnInputSchema,FindTransfersFnOutputSchema,FindWalletManyTxInputSchema,FindWalletManyTxOutputSchema,FindWalletsFnInputSchema,FindWalletsFnOutputSchema,FinishTransactionTxInputSchema,FinishTransactionTxOutputSchema,FnConstsSchema,GetBalanceFnInputSchema,GetBalanceFnOutputSchema,GetBalanceHistoryFnInputSchema,GetBalanceHistoryFnOutputSchema,GetBalanceHistoryTxInputSchema,GetBalanceHistoryTxOutputSchema,GetBalanceTxInputSchema,GetBalanceTxOutputSchema,GetDatabaseExportProgressTxInputSchema,GetDatabaseExportProgressTxOutputSchema,GetDatabaseImportProgressTxInputSchema,GetDatabaseImportProgressTxOutputSchema,GetFlagsFnInputSchema,GetFlagsFnOutputSchema,GetFlagsTxInputSchema,GetFlagsTxOutputSchema,GetStatisticsFnInputSchema,GetStatisticsFnOutputSchema,GetStatisticsTxInputSchema,GetStatisticsTxOutputSchema,GetTokenFnInputSchema,GetTokenFnOutputSchema,GetTokenManyTxInputSchema,GetTokenManyTxOutputSchema,GetTokenTxInputSchema,GetTokenTxOutputSchema,GetTransferFnInputSchema,GetTransferFnOutputSchema,GetTransferGroupFnInputSchema,GetTransferGroupFnOutputSchema,GetTransferGroupTxInputSchema,GetTransferGroupTxOutputSchema,GetTransferTxInputSchema,GetTransferTxOutputSchema,GetWalletFnInputSchema,GetWalletFnOutputSchema,GetWalletManyTxInputSchema,GetWalletManyTxOutputSchema,GetWalletTxInputSchema,GetWalletTxOutputSchema,ITxAggregatorSimpleEnum,ITxDistributorLeftoverRuleEnum,ITxMetadataActionEnum,ITxMetadataActionForReverseEnum,ITxPeriodSimpleEnum,ImportActionsTxInputSchema,ImportActionsTxOutputSchema,ImportDataFnInputSchema,ImportDataFnOutputSchema,ImportDatabaseTxInputSchema,ImportDatabaseTxOutputSchema,ListDatabaseExportsTxInputSchema,ListDatabaseExportsTxOutputSchema,QueryBuilder,QueryLogsTxInputSchema,QueryLogsTxOutputSchema,QueryTxInputSchema,QueryTxOutputSchema,ResetDatabaseTxInputSchema,ResetDatabaseTxOutputSchema,ReverseTransferFnInputSchema,ReverseTransferFnOutputSchema,ReverseTransferGroupFnInputSchema,ReverseTransferGroupFnOutputSchema,ReverseTransferGroupManyTxInputSchema,ReverseTransferGroupManyTxOutputSchema,ReverseTransferGroupTxInputSchema,ReverseTransferGroupTxOutputSchema,ReverseTransferManyTxInputSchema,ReverseTransferManyTxOutputSchema,ReverseTransferTxInputSchema,ReverseTransferTxOutputSchema,ReverseTransfersFnInputSchema,ReverseTransfersFnOutputSchema,SetFlagsFnInputSchema,SetFlagsFnOutputSchema,SetFlagsTxInputSchema,SetFlagsTxOutputSchema,StartTransactionTxInputSchema,StartTransactionTxOutputSchema,StreamPromise,TokenStatusEnum,TokenTableInputSchema,TokenTableSchema,TokenTypeEnum,TransferGroupStatusEnum,TransferGroupTableInputSchema,TransferGroupTableSchema,TransferGroupTypeEnum,TransferLogTableInputSchema,TransferLogTableSchema,TransferStatusEnum,TransferStatusInputEnum,TransferTableInputSchema,TransferTableSchema,TransferTypeEnum,TxConstsSchema,UpdateTokenFnInputSchema,UpdateTokenFnOutputSchema,UpdateTokenTxInputSchema,UpdateTokenTxOutputSchema,UpdateTransferFnInputSchema,UpdateTransferFnOutputSchema,UpdateTransferGroupFnInputSchema,UpdateTransferGroupFnOutputSchema,UpdateTransferGroupManyTxInputSchema,UpdateTransferGroupManyTxOutputSchema,UpdateTransferGroupTxInputSchema,UpdateTransferGroupTxOutputSchema,UpdateTransferGroupsFnInputSchema,UpdateTransferGroupsFnOutputSchema,UpdateTransferManyTxInputSchema,UpdateTransferManyTxOutputSchema,UpdateTransferTxInputSchema,UpdateTransferTxOutputSchema,UpdateTransfersFnInputSchema,UpdateTransfersFnOutputSchema,UpdateWalletFnInputSchema,UpdateWalletFnOutputSchema,UpdateWalletTxInputSchema,UpdateWalletTxOutputSchema,Validator,WalletStatusEnum,WalletTableInputSchema,WalletTableSchema,WalletTokenSettingTableInputSchema,WalletTokenSettingTableSchema,WalletTypeEnum,WapiClientType,WapiSettingTableInputSchema,WapiSettingTableSchema,WapiSettingTypeEnum,aggregateTransfers,create,createAccessToken,createContract,createDeposit,createExchange,createToken,createTransfer,createTransferGroup,createTransfers,createWallet,createWithdrawal,findBalances,findTokens,findTransferGroups,findTransfers,findWallets,getBalance,getBalanceHistory,getFlags,getStatistics,getToken,getTransfer,getTransferGroup,getWallet,importData,isImportDataFnInput,isImportDataFnOptions,reverseTransfer,reverseTransferGroup,reverseTransfers,setFlags,updateToken,updateTransfer,updateTransferGroup,updateTransferGroups,updateTransfers,updateWallet,utils});
|
|
17
17
|
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
|