@miradorlabs/parallax-web 1.0.8 → 2.0.0

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/index.umd.js CHANGED
@@ -1,11 +1,72 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'rxjs'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ParallaxWeb = {}, global.rxjs));
5
- })(this, (function (exports, rxjs) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ParallaxWeb = {}));
5
+ })(this, (function (exports) { 'use strict';
6
6
 
7
7
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
8
8
 
9
+ var grpcWeb = {};
10
+
11
+ /*
12
+
13
+ Copyright The Closure Library Authors.
14
+ SPDX-License-Identifier: Apache-2.0
15
+ */
16
+
17
+ var hasRequiredGrpcWeb;
18
+
19
+ function requireGrpcWeb () {
20
+ if (hasRequiredGrpcWeb) return grpcWeb;
21
+ hasRequiredGrpcWeb = 1;
22
+ var n,p=p||{},q=grpcWeb||self;function r(a,b){a=a.split(".");b=b||q;for(var c=0;c<a.length;c++)if(b=b[a[c]],b==null)return null;return b}function t(a){var b=typeof a;return b=="object"&&a!=null||b=="function"}function ca(a,b,c){return a.call.apply(a.bind,arguments)}
23
+ function da(a,b,c){if(!a)throw Error();if(arguments.length>2){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}function w(a,b,c){w=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?ca:da;return w.apply(null,arguments)}
24
+ function x(a,b){function c(){}c.prototype=b.prototype;a.N=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.aa=function(d,e,g){for(var f=Array(arguments.length-2),h=2;h<arguments.length;h++)f[h-2]=arguments[h];return b.prototype[e].apply(d,f)};}class ea{constructor(a){this.g=a||{};}get(a){return this.g[a]}}class fa{constructor(a,b,c){var d=new ea;this.j=a;this.h=b;this.g=c;this.i=d;}getRequestMessage(){return this.j}getMethodDescriptor(){return this.h}getMetadata(){return this.g}getCallOptions(){return this.i}}class ha{constructor(a,b,c={},d=null){this.i=a;this.g=c;this.h=b;this.j=d;}getResponseMessage(){return this.i}getMetadata(){return this.g}getMethodDescriptor(){return this.h}getStatus(){return this.j}}function ia(a,b,c={}){return new fa(b,a,c)}function ja(a,b,c={},d=null){return new ha(b,a,c,d)}const ka=class{constructor(a,b,c,d,e,g){this.name=a;this.g=e;this.h=g;}getName(){return this.name}};ka.prototype.getName=ka.prototype.getName;class la{constructor(a){this.g=a;}on(a,b){return a=="data"||a=="error"?this:this.g.on(a,b)}removeListener(a,b){return this.g.removeListener(a,b)}cancel(){this.g.cancel();}}function ma(a){switch(a){case 0:return "No Error";case 1:return "Access denied to content document";case 2:return "File not found";case 3:return "Firefox silently errored";case 4:return "Application custom error";case 5:return "An exception occurred";case 6:return "Http response at 400 or 500 level";case 7:return "Request was aborted";case 8:return "Request timed out";case 9:return "The resource is not available offline";default:return "Unrecognized error code"}}function y(a,b){if(Error.captureStackTrace)Error.captureStackTrace(this,y);else {const c=Error().stack;c&&(this.stack=c);}a&&(this.message=String(a));b!==void 0&&(this.cause=b);}x(y,Error);y.prototype.name="CustomError";function na(a,b){a=a.split("%s");let c="";const d=a.length-1;for(let e=0;e<d;e++)c+=a[e]+(e<b.length?b[e]:"%s");y.call(this,c+a[d]);}x(na,y);na.prototype.name="AssertionError";function oa(a,b){throw new na("Failure"+(": "+a),Array.prototype.slice.call(arguments,1));}function pa(a,b){function c(l){l==qa?f.o=l:l==B?f.o=l:ra(f,h,k,"invalid frame byte");f.h=sa;f.g=0;f.l=0;}function d(l){f.l++;f.g=(f.g<<8)+l;f.l==4&&(f.h=ta,f.m=0,typeof Uint8Array!=="undefined"?f.i=new Uint8Array(f.g):f.i=Array(f.g),f.g==0&&g());}function e(l){f.i[f.m++]=l;f.m==f.g&&g();}function g(){var l={};l[f.o]=f.i;f.j.push(l);f.h=ua;}var f=a,h,k=0;for(b instanceof Uint8Array||b instanceof Array?h=b:h=new Uint8Array(b);k<h.length;){switch(f.h){case va:ra(f,h,k,"stream already broken");break;case ua:c(h[k]);
25
+ break;case sa:d(h[k]);break;case ta:e(h[k]);break;default:throw Error("unexpected parser state: "+f.h);}f.v++;k++;}a=f.j;f.j=[];return a.length>0?a:null}class wa{constructor(){this.u=null;this.j=[];this.v=0;this.h=ua;this.l=this.g=this.o=0;this.i=null;this.m=0;}}var ua=0,sa=1,ta=2,va=3,qa=0,B=128;function ra(a,b,c,d){a.h=va;a.u="The stream is broken @"+a.v+"/"+c+". Error: "+d+". With input:\n"+b;throw Error(a.u);}function xa(a){switch(a){case 200:return 0;case 400:return 3;case 401:return 16;case 403:return 7;case 404:return 5;case 409:return 10;case 412:return 9;case 429:return 8;case 499:return 1;case 500:return 2;case 501:return 12;case 503:return 14;case 504:return 4;default:return 2}}
26
+ function ya(a){switch(a){case 0:return "OK";case 1:return "CANCELLED";case 2:return "UNKNOWN";case 3:return "INVALID_ARGUMENT";case 4:return "DEADLINE_EXCEEDED";case 5:return "NOT_FOUND";case 6:return "ALREADY_EXISTS";case 7:return "PERMISSION_DENIED";case 16:return "UNAUTHENTICATED";case 8:return "RESOURCE_EXHAUSTED";case 9:return "FAILED_PRECONDITION";case 10:return "ABORTED";case 11:return "OUT_OF_RANGE";case 12:return "UNIMPLEMENTED";case 13:return "INTERNAL";case 14:return "UNAVAILABLE";case 15:return "DATA_LOSS";
27
+ default:return ""}}class C extends Error{constructor(a,b,c={}){super(b);this.code=a;this.metadata=c;}toString(){let a=`RpcError(${ya(this.code)||String(this.code)})`;this.message&&(a+=": "+this.message);return a}}C.prototype.name="RpcError";const za=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(typeof a==="string")return typeof b!=="string"||b.length!=1?-1:a.indexOf(b,0);for(let c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return -1};function Aa(){var a=q.navigator;return a&&(a=a.userAgent)?a:""}function D(a){return Aa().indexOf(a)!=-1}function Ba(a){Ba[" "](a);return a}Ba[" "]=function(){};var Ca=D("Trident")||D("MSIE"),Da=D("Gecko")&&!(Aa().toLowerCase().indexOf("webkit")!=-1&&!D("Edge"))&&!(D("Trident")||D("MSIE"))&&!D("Edge");var Fa=class{constructor(a){if(Ea!==Ea)throw Error("SafeUrl is not meant to be built directly");this.g=a;}toString(){return this.g.toString()}},Ea={};new Fa("about:invalid#zClosurez");new Fa("about:blank");const Ga={};class Ha{constructor(){if(Ga!==Ga)throw Error("SafeStyle is not meant to be built directly");}toString(){return "".toString()}}new Ha;function Ia(a,b){for(const c in a)b.call(void 0,a[c],c,a);}function Ja(a,b){const c={};for(const d in a)c[d]=b.call(void 0,a[d],d,a);return c}const Ka="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function La(a,b){let c,d;for(let e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(let g=0;g<Ka.length;g++)c=Ka[g],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c]);}}const Ma={};class Na{constructor(){if(Ma!==Ma)throw Error("SafeStyleSheet is not meant to be built directly");}toString(){return "".toString()}}new Na;const Oa={};class Pa{constructor(){var a=q.trustedTypes&&q.trustedTypes.emptyHTML||"";if(Oa!==Oa)throw Error("SafeHtml is not meant to be built directly");this.g=a;}toString(){return this.g.toString()}}new Pa;function Qa(a){var b=1;a=a.split(":");const c=[];for(;b>0&&a.length;)c.push(a.shift()),b--;a.length&&c.push(a.join(":"));return c}function E(){this.v=this.v;this.o=this.o;}var Ra=0;E.prototype.v=false;E.prototype.dispose=function(){if(!this.v&&(this.v=true,this.C(),0!=Ra));};E.prototype.C=function(){if(this.o)for(;this.o.length;)this.o.shift()();};var Ta=Object.freeze||function(a){return a};function F(a,b){this.type=a;this.g=this.target=b;this.defaultPrevented=false;}F.prototype.h=function(){this.defaultPrevented=true;};var Ua=function(){if(!q.addEventListener||!Object.defineProperty)return false;var a=false,b=Object.defineProperty({},"passive",{get:function(){a=true;}});try{const c=()=>{};q.addEventListener("test",c,b);q.removeEventListener("test",c,b);}catch(c){}return a}();function G(a,b){F.call(this,a?a.type:"");this.relatedTarget=this.g=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.key="";this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=false;this.state=null;this.pointerId=0;this.pointerType="";this.i=null;a&&this.init(a,b);}x(G,F);var Va=Ta({2:"touch",3:"pen",4:"mouse"});
28
+ G.prototype.init=function(a,b){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.g=b;if(b=a.relatedTarget){if(Da){a:{try{Ba(b.nodeName);var e=!0;break a}catch(g){}e=false;}e||(b=null);}}else c=="mouseover"?b=a.fromElement:c=="mouseout"&&(b=a.toElement);this.relatedTarget=b;d?(this.clientX=d.clientX!==void 0?d.clientX:d.pageX,this.clientY=d.clientY!==void 0?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||
29
+ 0):(this.clientX=a.clientX!==void 0?a.clientX:a.pageX,this.clientY=a.clientY!==void 0?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0);this.button=a.button;this.key=a.key||"";this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.pointerId=a.pointerId||0;this.pointerType=typeof a.pointerType==="string"?a.pointerType:Va[a.pointerType]||"";this.state=a.state;this.i=a;a.defaultPrevented&&G.N.h.call(this);};
30
+ G.prototype.h=function(){G.N.h.call(this);var a=this.i;a.preventDefault?a.preventDefault():a.returnValue=false;};var H="closure_listenable_"+(Math.random()*1E6|0);var Wa=0;function Xa(a,b,c,d,e){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.M=e;this.key=++Wa;this.D=this.L=false;}function I(a){a.D=true;a.listener=null;a.proxy=null;a.src=null;a.M=null;}function J(a){this.src=a;this.g={};this.h=0;}J.prototype.add=function(a,b,c,d,e){var g=a.toString();a=this.g[g];a||(a=this.g[g]=[],this.h++);var f=Ya(a,b,d,e);f>-1?(b=a[f],c||(b.L=false)):(b=new Xa(b,this.src,g,!!d,e),b.L=c,a.push(b));return b};function Za(a,b){var c=b.type;if(c in a.g){var d=a.g[c],e=za(d,b),g;(g=e>=0)&&Array.prototype.splice.call(d,e,1);g&&(I(b),a.g[c].length==0&&(delete a.g[c],a.h--));}}
31
+ function Ya(a,b,c,d){for(var e=0;e<a.length;++e){var g=a[e];if(!g.D&&g.listener==b&&g.capture==!!c&&g.M==d)return e}return -1}var $a="closure_lm_"+(Math.random()*1E6|0),ab={};function cb(a,b,c,d,e){if(Array.isArray(b))for(var g=0;g<b.length;g++)cb(a,b[g],c,d,e);else c=eb(c),a&&a[H]?a.j.add(String(b),c,false,t(d)?!!d.capture:false,e):fb(a,b,c,false,d,e);}
32
+ function fb(a,b,c,d,e,g){if(!b)throw Error("Invalid event type");var f=t(e)?!!e.capture:!!e,h=gb(a);h||(a[$a]=h=new J(a));c=h.add(b,c,d,f,g);if(!c.proxy){d=hb();c.proxy=d;d.src=a;d.listener=c;if(a.addEventListener)Ua||(e=f),e===void 0&&(e=false),a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(mb(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error("addEventListener and attachEvent are unavailable.");}}
33
+ function hb(){function a(c){return b.call(a.src,a.listener,c)}const b=nb;return a} function ob(a,b,c,d,e){if(Array.isArray(b))for(var g=0;g<b.length;g++)ob(a,b[g],c,d,e);else (d=t(d)?!!d.capture:!!d,c=eb(c),a&&a[H])?(a=a.j,b=String(b).toString(),b in a.g&&(g=a.g[b],c=Ya(g,c,d,e),c>-1&&(I(g[c]),Array.prototype.splice.call(g,c,1),g.length==0&&(delete a.g[b],a.h--)))):a&&(a=gb(a))&&(b=a.g[b.toString()],a=-1,b&&(a=Ya(b,c,d,e)),(c=a>-1?b[a]:null)&&pb(c));}
34
+ function pb(a){if(typeof a!=="number"&&a&&!a.D){var b=a.src;if(b&&b[H])Za(b.j,a);else {var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(mb(c),d):b.addListener&&b.removeListener&&b.removeListener(d);(c=gb(b))?(Za(c,a),c.h==0&&(c.src=null,b[$a]=null)):I(a);}}}function mb(a){return a in ab?ab[a]:ab[a]="on"+a}function nb(a,b){if(a.D)a=true;else {b=new G(b,this);var c=a.listener,d=a.M||a.src;a.L&&pb(a);a=c.call(d,b);}return a}
35
+ function gb(a){a=a[$a];return a instanceof J?a:null}var qb="__closure_events_fn_"+(Math.random()*1E9>>>0);function eb(a){if(typeof a==="function")return a;a[qb]||(a[qb]=function(b){return a.handleEvent(b)});return a[qb]}function K(){E.call(this);this.j=new J(this);this.W=this;this.S=null;}x(K,E);K.prototype[H]=true;K.prototype.removeEventListener=function(a,b,c,d){ob(this,a,b,c,d);};
36
+ function L(a,b){var c,d=a.S;if(d)for(c=[];d;d=d.S)c.push(d);a=a.W;d=b.type||b;if(typeof b==="string")b=new F(b,a);else if(b instanceof F)b.target=b.target||a;else {var e=b;b=new F(d,a);La(b,e);}e=true;if(c)for(var g=c.length-1;g>=0;g--){var f=b.g=c[g];e=M(f,d,true,b)&&e;}f=b.g=a;e=M(f,d,true,b)&&e;e=M(f,d,false,b)&&e;if(c)for(g=0;g<c.length;g++)f=b.g=c[g],e=M(f,d,false,b)&&e;}
37
+ K.prototype.C=function(){K.N.C.call(this);if(this.j){var a=this.j,c;for(c in a.g){for(var d=a.g[c],e=0;e<d.length;e++)I(d[e]);delete a.g[c];a.h--;}}this.S=null;};function M(a,b,c,d){b=a.j.g[String(b)];if(!b)return true;b=b.concat();for(var e=true,g=0;g<b.length;++g){var f=b[g];if(f&&!f.D&&f.capture==c){var h=f.listener,k=f.M||f.src;f.L&&Za(a.j,f);e=h.call(k,d)!==false&&e;}}return e&&!d.defaultPrevented}var rb=q;function sb(a,b,c){if(typeof a==="function")c&&(a=w(a,c));else if(a&&typeof a.handleEvent=="function")a=w(a.handleEvent,a);else throw Error("Invalid listener argument");return Number(b)>2147483647?-1:rb.setTimeout(a,b||0)}var N=class{constructor(a,b){this.name=a;this.value=b;}toString(){return this.name}},O=new N("OFF",Infinity),tb=new N("SEVERE",1E3),ub=new N("CONFIG",700),vb=new N("FINE",500),yb=class{constructor(a,b,c){this.reset(a||O,b,c,void 0,void 0);}reset(){}};function zb(a){if(a.g)return a.g;if(a.h)return zb(a.h);oa("Root logger has no level set.");return O}function Ab(a,b){for(;a;)a.j.forEach(c=>{c(b);}),a=a.h;}
38
+ var Bb=class{constructor(a,b=null){this.g=null;this.j=[];this.h=b||null;this.i=[];this.l={getName:()=>a};}};function P(a,b){var c=a.entries[b];if(c)return c;c=P(a,b.slice(0,Math.max(b.lastIndexOf("."),0)));const d=new Bb(b,c);a.entries[b]=d;c.i.push(d);return d}var Cb=class{constructor(){this.entries={};const a=new Bb("");a.g=ub;this.entries[""]=a;}},Db;function Eb(){Db||=new Cb;return Db}
39
+ function Fb(a,b,c){var d;if(d=a)if(d=a&&b){d=b.value;var e=a?zb(P(Eb(),a.getName())):O;d=d>=e.value;}d&&(b=b||O,d=P(Eb(),a.getName()),typeof c==="function"&&(c=c()),a=a.getName(),a=new yb(b,c,a),Ab(d,a));}function Gb(a,b){a&&Fb(a,tb,b);}function Q(a,b){a&&Fb(a,vb,b);}function Hb(){}Hb.prototype.g=null;function Ib(a){var b;(b=a.g)||(b={},Jb(a)&&(b[0]=true,b[1]=true),b=a.g=b);return b}var Kb;function Lb(){}x(Lb,Hb);function Mb(a){return (a=Jb(a))?new ActiveXObject(a):new XMLHttpRequest}function Jb(a){if(!a.h&&typeof XMLHttpRequest=="undefined"&&typeof ActiveXObject!="undefined"){const b=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];for(let c=0;c<b.length;c++){const d=b[c];try{return new ActiveXObject(d),a.h=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.h}Kb=new Lb;var Nb=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function R(a){K.call(this);this.headers=new Map;this.K=a||null;this.i=false;this.J=this.g=null;this.T=this.G="";this.m=0;this.A="";this.l=this.R=this.F=this.P=false;this.u=0;this.H=null;this.B=Ob;this.I=this.O=false;}x(R,K);var Ob="";R.prototype.h=P(Eb(),"goog.net.XhrIo").l;var Pb=/^https?$/i,Qb=["POST","PUT"];
40
+ function Rb(a,b,c){if(a.g)throw Error("[goog.net.XhrIo] Object is active with another request="+a.G+"; newUri="+b);a.G=b;a.A="";a.m=0;a.T="POST";a.P=false;a.i=true;a.g=a.K?Mb(a.K):Mb(Kb);a.J=a.K?Ib(a.K):Ib(Kb);a.g.onreadystatechange=w(a.U,a);try{Q(a.h,S(a,"Opening Xhr")),a.R=!0,a.g.open("POST",String(b),!0),a.R=!1;}catch(g){Q(a.h,S(a,"Error opening Xhr: "+g.message));Sb(a,g);return}b=c||"";c=new Map(a.headers);const d=Array.from(c.keys()).find(g=>"content-type"==g.toLowerCase()),e=q.FormData&&b instanceof
41
+ q.FormData;!(za(Qb,"POST")>=0)||d||e||c.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const [g,f]of c)a.g.setRequestHeader(g,f);a.B&&(a.g.responseType=a.B);"withCredentials"in a.g&&a.g.withCredentials!==a.O&&(a.g.withCredentials=a.O);try{Tb(a),a.u>0&&(a.I=Ub(a.g),Q(a.h,S(a,"Will abort after "+a.u+"ms if incomplete, xhr2 "+a.I)),a.I?(a.g.timeout=a.u,a.g.ontimeout=w(a.V,a)):a.H=sb(a.V,a.u,a)),Q(a.h,S(a,"Sending request")),a.F=!0,a.g.send(b),a.F=!1;}catch(g){Q(a.h,S(a,"Send error: "+
42
+ g.message)),Sb(a,g);}}function Ub(a){return Ca&&typeof a.timeout==="number"&&a.ontimeout!==void 0}n=R.prototype;n.V=function(){typeof p!="undefined"&&this.g&&(this.A="Timed out after "+this.u+"ms, aborting",this.m=8,Q(this.h,S(this,this.A)),L(this,"timeout"),this.abort(8));};function Sb(a,b){a.i=false;a.g&&(a.l=true,a.g.abort(),a.l=false);a.A=b;a.m=5;Vb(a);T(a);}function Vb(a){a.P||(a.P=true,L(a,"complete"),L(a,"error"));}
43
+ n.abort=function(a){this.g&&this.i&&(Q(this.h,S(this,"Aborting")),this.i=false,this.l=true,this.g.abort(),this.l=false,this.m=a||7,L(this,"complete"),L(this,"abort"),T(this));};n.C=function(){this.g&&(this.i&&(this.i=false,this.l=true,this.g.abort(),this.l=false),T(this,true));R.N.C.call(this);};n.U=function(){this.v||(this.R||this.F||this.l?Wb(this):this.X());};n.X=function(){Wb(this);};
44
+ function Wb(a){if(a.i&&typeof p!="undefined")if(a.J[1]&&U(a)==4&&a.getStatus()==2)Q(a.h,S(a,"Local request error detected and ignored"));else if(a.F&&U(a)==4)sb(a.U,0,a);else if(L(a,"readystatechange"),U(a)==4){Q(a.h,S(a,"Request complete"));a.i=false;try{const f=a.getStatus();a:switch(f){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var b=!0;break a;default:b=!1;}var c;if(!(c=b)){var d;if(d=f===0){var e=String(a.G).match(Nb)[1]||null;!e&&q.self&&q.self.location&&(e=q.self.location.protocol.slice(0,
45
+ -1));d=!Pb.test(e?e.toLowerCase():"");}c=d;}if(c)L(a,"complete"),L(a,"success");else {a.m=6;try{var g=U(a)>2?a.g.statusText:"";}catch(h){Q(a.h,"Can not get status: "+h.message),g="";}a.A=g+" ["+a.getStatus()+"]";Vb(a);}}finally{T(a);}}}function T(a,b){if(a.g){Tb(a);const c=a.g,d=a.J[0]?()=>{}:null;a.g=null;a.J=null;b||L(a,"ready");try{c.onreadystatechange=d;}catch(e){Gb(a.h,"Problem encountered resetting onreadystatechange: "+e.message);}}}
46
+ function Tb(a){a.g&&a.I&&(a.g.ontimeout=null);a.H&&(rb.clearTimeout(a.H),a.H=null);}n.isActive=function(){return !!this.g};function U(a){return a.g?a.g.readyState:0}n.getStatus=function(){try{return U(this)>2?this.g.status:-1}catch(a){return -1}};
47
+ function Xb(a){try{if(!a.g)return null;if("response"in a.g)return a.g.response;switch(a.B){case Ob:case "text":return a.g.responseText;case "arraybuffer":if("mozResponseArrayBuffer"in a.g)return a.g.mozResponseArrayBuffer}Gb(a.h,"Response type "+a.B+" is not supported on this browser");return null}catch(b){return Q(a.h,"Can not get response: "+b.message),null}}
48
+ function Yb(a){const b={};a=(a.g&&U(a)>=2?a.g.getAllResponseHeaders()||"":"").split("\r\n");for(let d=0;d<a.length;d++){if(/^[\s\xa0]*$/.test(a[d]))continue;var c=Qa(a[d]);const e=c[0];c=c[1];if(typeof c!=="string")continue;c=c.trim();const g=b[e]||[];b[e]=g;g.push(c);}return Ja(b,function(d){return d.join(", ")})}function S(a,b){return b+" ["+a.T+" "+a.G+" "+a.getStatus()+"]"}var Zb={},V=null;function $b(a){var b=a.length,c=b*3/4;c%3?c=Math.floor(c):"=.".indexOf(a[b-1])!=-1&&(c="=.".indexOf(a[b-2])!=-1?c-2:c-1);var d=new Uint8Array(c),e=0;ac(a,function(g){d[e++]=g;});return e!==c?d.subarray(0,e):d}
49
+ function ac(a,b){function c(k){for(;d<a.length;){var l=a.charAt(d++),m=V[l];if(m!=null)return m;if(!/^[\s\xa0]*$/.test(l))throw Error("Unknown base64 encoding at char: "+l);}return k}bc();for(var d=0;;){var e=c(-1),g=c(0),f=c(64),h=c(64);if(h===64&&e===-1)break;b(e<<2|g>>4);f!=64&&(b(g<<4&240|f>>2),h!=64&&b(f<<6&192|h));}}
50
+ function bc(){if(!V){V={};for(var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),b=["+/=","+/","-_=","-_.","-_"],c=0;c<5;c++){var d=a.concat(b[c].split(""));Zb[c]=d;for(var e=0;e<d.length;e++){var g=d[e];V[g]===void 0&&(V[g]=e);}}}}const cc=["content-type","grpc-status","grpc-message"];function W(a,b){if(b.code!=0){var c=new C(b.code,decodeURIComponent(b.message||""),b.metadata);for(let d=0;d<a.j.length;d++)a.j[d](c);}b={code:b.code,details:decodeURIComponent(b.message||""),metadata:b.metadata};for(c=0;c<a.m.length;c++)a.m[c](b);}function dc(a,b){for(let c=0;c<a.l.length;c++)a.l[c](b);}function ec(a){for(let b=0;b<a.i.length;b++)a.i[b]();}function X(a,b){b=a.indexOf(b);b>-1&&a.splice(b,1);}
51
+ class Y{constructor(a){this.g=a.$;this.v=null;this.h=[];this.m=[];this.l=[];this.j=[];this.i=[];this.u=false;this.o=0;this.A=new wa;const b=this;cb(this.g,"readystatechange",function(){var c=b.g;if(c=c.g?c.g.getResponseHeader("Content-Type"):null){c=c.toLowerCase();if(c.lastIndexOf("application/grpc-web-text",0)==0){c=b.g;try{var d=c.g?c.g.responseText:"";}catch(h){Q(c.h,"Can not get responseText: "+h.message),d="";}c=d||"";d=c.length-c.length%4;c=c.substr(b.o,d-b.o);if(c.length==0)return;b.o=d;c=$b(c);}else if(c.lastIndexOf("application/grpc",
52
+ 0)==0)c=new Uint8Array(Xb(b.g));else {W(b,new C(2,"Unknown Content-type received."));return}d=null;try{d=pa(b.A,c);}catch(h){W(b,new C(2,"Error in parsing response body"));}if(d)for(c=0;c<d.length;c++){if(qa in d[c]){var e=d[c][qa];if(e){var g=false;let h;try{h=b.v(e),g=!0;}catch(k){W(b,new C(13,`Error when deserializing response data; error: ${k}`+`, response: ${h}`));}if(g){e=b;g=h;for(var f=0;f<e.h.length;f++)e.h[f](g);}}}if(B in d[c]&&d[c][B].length>0){e="";for(g=0;g<d[c][B].length;g++)e+=String.fromCharCode(d[c][B][g]);
53
+ e=e.trim().split("\r\n");g={};for(f=0;f<e.length;f++){const h=e[f].indexOf(":");g[e[f].substring(0,h).trim()]=e[f].substring(h+1).trim();}e=g;g=0;f="";"grpc-status"in e&&(g=Number(e["grpc-status"]),delete e["grpc-status"]);"grpc-message"in e&&(f=e["grpc-message"],delete e["grpc-message"]);W(b,new C(g,f,e));}}}});cb(this.g,"complete",function(){var c=b.g.m,d=2,e="";const g={};d=Yb(b.g);const f={};for(var h in d)d.hasOwnProperty(h)&&(f[h.toLowerCase()]=d[h]);Object.keys(f).forEach(k=>{cc.includes(k)||
54
+ (g[k]=f[k]);});dc(b,g);h=-1;if(c!=0){switch(c){case 7:d=10;break;case 8:d=4;break;case 6:h=b.g.getStatus();d=xa(h);break;default:d=14;}d==10&&b.u||(e=ma(c),h!=-1&&(e+=", http status code: "+h),W(b,new C(d,e)));}else c=false,"grpc-status"in f&&(d=Number(f["grpc-status"]),"grpc-message"in f&&(e=f["grpc-message"]),d!=0&&(W(b,new C(d,e||"",f)),c=true)),c||ec(b);});}on(a,b){a=="data"?this.h.push(b):a=="status"?this.m.push(b):a=="metadata"?this.l.push(b):a=="end"?this.i.push(b):a=="error"&&this.j.push(b);return this}removeListener(a,
55
+ b){a=="data"?X(this.h,b):a=="status"?X(this.m,b):a=="metadata"?X(this.l,b):a=="end"?X(this.i,b):a=="error"&&X(this.j,b);return this}cancel(){this.u=true;this.g.abort();}}Y.prototype.cancel=Y.prototype.cancel;Y.prototype.removeListener=Y.prototype.removeListener;Y.prototype.on=Y.prototype.on;function fc(a){let b="";Ia(a,function(c,d){b+=d;b+=":";b+=c;b+="\r\n";});return b}function hc(a,b){return b.reduce((c,d)=>e=>d.intercept(e,c),a)}
56
+ function ic(a,b,c){let d=false,e=null,g=false;a.on("data",function(f){d=true;e=f;});a.on("error",function(f){f.code==0||g||(g=true,b(f,null));});a.on("status",function(f){f.code==0||g?c&&b(null,null,f):(g=true,b({code:f.code,message:f.details,metadata:f.metadata},null));});if(c)a.on("metadata",function(f){b(null,null,null,f);});a.on("end",function(){g||(d?c?b(null,e,null,null,true):b(null,e):b({code:2,message:"Incomplete response"}));c&&b(null,null);});}
57
+ function jc(a,b,c){var d=b.getMethodDescriptor(),e=c+d.getName();c=a.i?a.i:new R;c.O=a.j;const g=new Y({$:c});g.v=d.h;var f=b.getMetadata();for(var h in f)c.headers.set(h,f[h]);a.g=="text"?(c.headers.set("Content-Type","application/grpc-web-text"),c.headers.set("Accept","application/grpc-web-text")):c.headers.set("Content-Type","application/grpc-web+proto");c.headers.set("X-User-Agent","grpc-web-javascript/0.1");c.headers.set("X-Grpc-Web","1");c.headers.has("deadline")&&(h=Number(c.headers.get("deadline")),
58
+ h=Math.ceil(h-(new Date).getTime()),c.headers.delete("deadline"),h===Infinity&&(h=0),h>0&&(c.headers.set("grpc-timeout",h+"m"),c.u=Math.max(0,Math.max(1E3,Math.ceil(h*1.1)))));if(a.l){h=c.headers;f={};for(k of h.keys())f[k]=h.get(k);var k=f;c.headers.clear();b:{for(l in k){var l=false;break b}l=true;}if(!l)if(k=fc(k),typeof e==="string"){if(l=encodeURIComponent("$httpHeaders"),k=k!=null?"="+encodeURIComponent(String(k)):"",l+=k)k=e.indexOf("#"),k<0&&(k=e.length),h=e.indexOf("?"),h<0||h>k?(h=k,f=""):f=e.substring(h+
59
+ 1,k),e=[e.slice(0,h),f,e.slice(k)],k=e[1],e[1]=l?k?k+"&"+l:l:k,e=e[0]+(e[1]?"?"+e[1]:"")+e[2];}else e.g("$httpHeaders",k);}b=(0, d.g)(b.getRequestMessage());d=b.length;l=[0,0,0,0];k=new Uint8Array(5+d);for(h=3;h>=0;h--)l[h]=d%256,d>>>=8;k.set(new Uint8Array(l),1);k.set(b,5);b=k;if(a.g=="text"){a=b;var m;m===void 0&&(m=0);bc();m=Zb[m];b=Array(Math.floor(a.length/3));d=m[64]||"";for(l=k=0;k<a.length-2;k+=3){var z=a[k],A=a[k+1];f=a[k+2];h=m[z>>2];z=m[(z&3)<<4|A>>4];A=m[(A&15)<<2|f>>6];f=m[f&63];b[l++]=
60
+ h+z+A+f;}h=0;f=d;switch(a.length-k){case 2:h=a[k+1],f=m[(h&15)<<2]||d;case 1:a=a[k],b[l]=m[a>>2]+m[(a&3)<<4|h>>4]+f+d;}b=b.join("");}else a.g=="binary"&&(c.B="arraybuffer");Rb(c,e,b);return g}
61
+ function kc(a,b,c,d,e,g={}){const f=b.substr(0,b.length-e.name.length),h=g&&g.signal;return hc(k=>new Promise((l,m)=>{if(h&&h.aborted){const v=new C(1,"Aborted");v.cause=h.reason;m(v);}else {var z=jc(a,k,f),A,ib,jb;ic(z,(v,lc,kb,lb,mc)=>{v?m(v):mc?jb=lc:kb?ib=kb:lb?A=lb:l(ja(k.getMethodDescriptor(),jb,A,ib));},true);h&&h.addEventListener("abort",()=>{z.cancel();const v=new C(1,"Aborted");v.cause=h.reason;m(v);});}}),a.m).call(a,ia(e,c,d)).then(k=>k.getResponseMessage())}
62
+ class Z{constructor(a={},b){this.g=a.format||r("format",a)||"text";this.l=a.ca||r("suppressCorsPreflight",a)||false;this.j=a.withCredentials||r("withCredentials",a)||false;this.h=a.ba||r("streamInterceptors",a)||[];this.m=a.da||r("unaryInterceptors",a)||[];this.i=b||null;}Y(a,b,c,d,e){const g=a.substr(0,a.length-d.name.length);a=hc(f=>jc(this,f,g),this.h).call(this,ia(d,b,c));ic(a,e,false);return new la(a)}unaryCall(a,b,c,d,e={}){return kc(this,a,b,c,d,e)}Z(a,b,c,d){const e=a.substr(0,a.length-d.name.length);
63
+ return hc(g=>jc(this,g,e),this.h).call(this,ia(d,b,c))}}Z.prototype.serverStreaming=Z.prototype.Z;Z.prototype.unaryCall=Z.prototype.unaryCall;Z.prototype.rpcCall=Z.prototype.Y;grpcWeb.CallOptions=ea;grpcWeb.MethodDescriptor=ka;grpcWeb.GrpcWebClientBase=Z;grpcWeb.RpcError=C;grpcWeb.StatusCode={OK:0,CANCELLED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,UNAUTHENTICATED:16,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15};grpcWeb.MethodType={UNARY:"unary",SERVER_STREAMING:"server_streaming",BIDI_STREAMING:"bidi_streaming"};
64
+ rb=typeof globalThis!=="undefined"&&globalThis||self;
65
+ return grpcWeb;
66
+ }
67
+
68
+ var grpcWebExports = requireGrpcWeb();
69
+
9
70
  var parallax_gateway_pb = {};
10
71
 
11
72
  var googleProtobuf = {};
@@ -706,10 +767,11 @@
706
767
  goog.object.extend(proto, google_protobuf_timestamp_pb);
707
768
  var proto_common_v1_status_pb = requireStatus_pb();
708
769
  goog.object.extend(proto, proto_common_v1_status_pb);
770
+ goog.exportSymbol('proto.gateway.parallax.v1.Chain', null, global);
709
771
  goog.exportSymbol('proto.gateway.parallax.v1.CreateTraceRequest', null, global);
710
- goog.exportSymbol('proto.gateway.parallax.v1.CreateTraceRequest.Event', null, global);
711
- goog.exportSymbol('proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint', null, global);
712
772
  goog.exportSymbol('proto.gateway.parallax.v1.CreateTraceResponse', null, global);
773
+ goog.exportSymbol('proto.gateway.parallax.v1.Event', null, global);
774
+ goog.exportSymbol('proto.gateway.parallax.v1.TxHashHint', null, global);
713
775
  /**
714
776
  * Generated by JsPbCodeGenerator.
715
777
  * @param {Array=} opt_data Optional initial data array, typically from a
@@ -741,16 +803,16 @@
741
803
  * @extends {jspb.Message}
742
804
  * @constructor
743
805
  */
744
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint = function(opt_data) {
806
+ proto.gateway.parallax.v1.CreateTraceResponse = function(opt_data) {
745
807
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
746
808
  };
747
- goog.inherits(proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint, jspb.Message);
809
+ goog.inherits(proto.gateway.parallax.v1.CreateTraceResponse, jspb.Message);
748
810
  if (goog.DEBUG && !COMPILED) {
749
811
  /**
750
812
  * @public
751
813
  * @override
752
814
  */
753
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.displayName = 'proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint';
815
+ proto.gateway.parallax.v1.CreateTraceResponse.displayName = 'proto.gateway.parallax.v1.CreateTraceResponse';
754
816
  }
755
817
  /**
756
818
  * Generated by JsPbCodeGenerator.
@@ -762,16 +824,16 @@
762
824
  * @extends {jspb.Message}
763
825
  * @constructor
764
826
  */
765
- proto.gateway.parallax.v1.CreateTraceRequest.Event = function(opt_data) {
827
+ proto.gateway.parallax.v1.TxHashHint = function(opt_data) {
766
828
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
767
829
  };
768
- goog.inherits(proto.gateway.parallax.v1.CreateTraceRequest.Event, jspb.Message);
830
+ goog.inherits(proto.gateway.parallax.v1.TxHashHint, jspb.Message);
769
831
  if (goog.DEBUG && !COMPILED) {
770
832
  /**
771
833
  * @public
772
834
  * @override
773
835
  */
774
- proto.gateway.parallax.v1.CreateTraceRequest.Event.displayName = 'proto.gateway.parallax.v1.CreateTraceRequest.Event';
836
+ proto.gateway.parallax.v1.TxHashHint.displayName = 'proto.gateway.parallax.v1.TxHashHint';
775
837
  }
776
838
  /**
777
839
  * Generated by JsPbCodeGenerator.
@@ -783,16 +845,16 @@
783
845
  * @extends {jspb.Message}
784
846
  * @constructor
785
847
  */
786
- proto.gateway.parallax.v1.CreateTraceResponse = function(opt_data) {
848
+ proto.gateway.parallax.v1.Event = function(opt_data) {
787
849
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
788
850
  };
789
- goog.inherits(proto.gateway.parallax.v1.CreateTraceResponse, jspb.Message);
851
+ goog.inherits(proto.gateway.parallax.v1.Event, jspb.Message);
790
852
  if (goog.DEBUG && !COMPILED) {
791
853
  /**
792
854
  * @public
793
855
  * @override
794
856
  */
795
- proto.gateway.parallax.v1.CreateTraceResponse.displayName = 'proto.gateway.parallax.v1.CreateTraceResponse';
857
+ proto.gateway.parallax.v1.Event.displayName = 'proto.gateway.parallax.v1.Event';
796
858
  }
797
859
 
798
860
  /**
@@ -837,8 +899,8 @@
837
899
  attributesMap: (f = msg.getAttributesMap()) ? f.toObject(includeInstance, undefined) : [],
838
900
  tagsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f,
839
901
  eventsList: jspb.Message.toObjectList(msg.getEventsList(),
840
- proto.gateway.parallax.v1.CreateTraceRequest.Event.toObject, includeInstance),
841
- txHashHint: (f = msg.getTxHashHint()) && proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.toObject(includeInstance, f)
902
+ proto.gateway.parallax.v1.Event.toObject, includeInstance),
903
+ txHashHint: (f = msg.getTxHashHint()) && proto.gateway.parallax.v1.TxHashHint.toObject(includeInstance, f)
842
904
  };
843
905
 
844
906
  if (includeInstance) {
@@ -890,13 +952,13 @@
890
952
  msg.addTags(value);
891
953
  break;
892
954
  case 4:
893
- var value = new proto.gateway.parallax.v1.CreateTraceRequest.Event;
894
- reader.readMessage(value,proto.gateway.parallax.v1.CreateTraceRequest.Event.deserializeBinaryFromReader);
955
+ var value = new proto.gateway.parallax.v1.Event;
956
+ reader.readMessage(value,proto.gateway.parallax.v1.Event.deserializeBinaryFromReader);
895
957
  msg.addEvents(value);
896
958
  break;
897
959
  case 5:
898
- var value = new proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint;
899
- reader.readMessage(value,proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.deserializeBinaryFromReader);
960
+ var value = new proto.gateway.parallax.v1.TxHashHint;
961
+ reader.readMessage(value,proto.gateway.parallax.v1.TxHashHint.deserializeBinaryFromReader);
900
962
  msg.setTxHashHint(value);
901
963
  break;
902
964
  default:
@@ -951,7 +1013,7 @@
951
1013
  writer.writeRepeatedMessage(
952
1014
  4,
953
1015
  f,
954
- proto.gateway.parallax.v1.CreateTraceRequest.Event.serializeBinaryToWriter
1016
+ proto.gateway.parallax.v1.Event.serializeBinaryToWriter
955
1017
  );
956
1018
  }
957
1019
  f = message.getTxHashHint();
@@ -959,12 +1021,165 @@
959
1021
  writer.writeMessage(
960
1022
  5,
961
1023
  f,
962
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.serializeBinaryToWriter
1024
+ proto.gateway.parallax.v1.TxHashHint.serializeBinaryToWriter
963
1025
  );
964
1026
  }
965
1027
  };
966
1028
 
967
1029
 
1030
+ /**
1031
+ * optional string name = 1;
1032
+ * @return {string}
1033
+ */
1034
+ proto.gateway.parallax.v1.CreateTraceRequest.prototype.getName = function() {
1035
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
1036
+ };
1037
+
1038
+
1039
+ /**
1040
+ * @param {string} value
1041
+ * @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
1042
+ */
1043
+ proto.gateway.parallax.v1.CreateTraceRequest.prototype.setName = function(value) {
1044
+ return jspb.Message.setProto3StringField(this, 1, value);
1045
+ };
1046
+
1047
+
1048
+ /**
1049
+ * map<string, string> attributes = 2;
1050
+ * @param {boolean=} opt_noLazyCreate Do not create the map if
1051
+ * empty, instead returning `undefined`
1052
+ * @return {!jspb.Map<string,string>}
1053
+ */
1054
+ proto.gateway.parallax.v1.CreateTraceRequest.prototype.getAttributesMap = function(opt_noLazyCreate) {
1055
+ return /** @type {!jspb.Map<string,string>} */ (
1056
+ jspb.Message.getMapField(this, 2, opt_noLazyCreate,
1057
+ null));
1058
+ };
1059
+
1060
+
1061
+ /**
1062
+ * Clears values from the map. The map will be non-null.
1063
+ * @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
1064
+ */
1065
+ proto.gateway.parallax.v1.CreateTraceRequest.prototype.clearAttributesMap = function() {
1066
+ this.getAttributesMap().clear();
1067
+ return this;
1068
+ };
1069
+
1070
+
1071
+ /**
1072
+ * repeated string tags = 3;
1073
+ * @return {!Array<string>}
1074
+ */
1075
+ proto.gateway.parallax.v1.CreateTraceRequest.prototype.getTagsList = function() {
1076
+ return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 3));
1077
+ };
1078
+
1079
+
1080
+ /**
1081
+ * @param {!Array<string>} value
1082
+ * @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
1083
+ */
1084
+ proto.gateway.parallax.v1.CreateTraceRequest.prototype.setTagsList = function(value) {
1085
+ return jspb.Message.setField(this, 3, value || []);
1086
+ };
1087
+
1088
+
1089
+ /**
1090
+ * @param {string} value
1091
+ * @param {number=} opt_index
1092
+ * @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
1093
+ */
1094
+ proto.gateway.parallax.v1.CreateTraceRequest.prototype.addTags = function(value, opt_index) {
1095
+ return jspb.Message.addToRepeatedField(this, 3, value, opt_index);
1096
+ };
1097
+
1098
+
1099
+ /**
1100
+ * Clears the list making it empty but non-null.
1101
+ * @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
1102
+ */
1103
+ proto.gateway.parallax.v1.CreateTraceRequest.prototype.clearTagsList = function() {
1104
+ return this.setTagsList([]);
1105
+ };
1106
+
1107
+
1108
+ /**
1109
+ * repeated Event events = 4;
1110
+ * @return {!Array<!proto.gateway.parallax.v1.Event>}
1111
+ */
1112
+ proto.gateway.parallax.v1.CreateTraceRequest.prototype.getEventsList = function() {
1113
+ return /** @type{!Array<!proto.gateway.parallax.v1.Event>} */ (
1114
+ jspb.Message.getRepeatedWrapperField(this, proto.gateway.parallax.v1.Event, 4));
1115
+ };
1116
+
1117
+
1118
+ /**
1119
+ * @param {!Array<!proto.gateway.parallax.v1.Event>} value
1120
+ * @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
1121
+ */
1122
+ proto.gateway.parallax.v1.CreateTraceRequest.prototype.setEventsList = function(value) {
1123
+ return jspb.Message.setRepeatedWrapperField(this, 4, value);
1124
+ };
1125
+
1126
+
1127
+ /**
1128
+ * @param {!proto.gateway.parallax.v1.Event=} opt_value
1129
+ * @param {number=} opt_index
1130
+ * @return {!proto.gateway.parallax.v1.Event}
1131
+ */
1132
+ proto.gateway.parallax.v1.CreateTraceRequest.prototype.addEvents = function(opt_value, opt_index) {
1133
+ return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.gateway.parallax.v1.Event, opt_index);
1134
+ };
1135
+
1136
+
1137
+ /**
1138
+ * Clears the list making it empty but non-null.
1139
+ * @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
1140
+ */
1141
+ proto.gateway.parallax.v1.CreateTraceRequest.prototype.clearEventsList = function() {
1142
+ return this.setEventsList([]);
1143
+ };
1144
+
1145
+
1146
+ /**
1147
+ * optional TxHashHint tx_hash_hint = 5;
1148
+ * @return {?proto.gateway.parallax.v1.TxHashHint}
1149
+ */
1150
+ proto.gateway.parallax.v1.CreateTraceRequest.prototype.getTxHashHint = function() {
1151
+ return /** @type{?proto.gateway.parallax.v1.TxHashHint} */ (
1152
+ jspb.Message.getWrapperField(this, proto.gateway.parallax.v1.TxHashHint, 5));
1153
+ };
1154
+
1155
+
1156
+ /**
1157
+ * @param {?proto.gateway.parallax.v1.TxHashHint|undefined} value
1158
+ * @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
1159
+ */
1160
+ proto.gateway.parallax.v1.CreateTraceRequest.prototype.setTxHashHint = function(value) {
1161
+ return jspb.Message.setWrapperField(this, 5, value);
1162
+ };
1163
+
1164
+
1165
+ /**
1166
+ * Clears the message field making it undefined.
1167
+ * @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
1168
+ */
1169
+ proto.gateway.parallax.v1.CreateTraceRequest.prototype.clearTxHashHint = function() {
1170
+ return this.setTxHashHint(undefined);
1171
+ };
1172
+
1173
+
1174
+ /**
1175
+ * Returns whether this field is set.
1176
+ * @return {boolean}
1177
+ */
1178
+ proto.gateway.parallax.v1.CreateTraceRequest.prototype.hasTxHashHint = function() {
1179
+ return jspb.Message.getField(this, 5) != null;
1180
+ };
1181
+
1182
+
968
1183
 
969
1184
 
970
1185
 
@@ -981,8 +1196,8 @@
981
1196
  * http://goto/soy-param-migration
982
1197
  * @return {!Object}
983
1198
  */
984
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.prototype.toObject = function(opt_includeInstance) {
985
- return proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.toObject(opt_includeInstance, this);
1199
+ proto.gateway.parallax.v1.CreateTraceResponse.prototype.toObject = function(opt_includeInstance) {
1200
+ return proto.gateway.parallax.v1.CreateTraceResponse.toObject(opt_includeInstance, this);
986
1201
  };
987
1202
 
988
1203
 
@@ -991,16 +1206,14 @@
991
1206
  * @param {boolean|undefined} includeInstance Deprecated. Whether to include
992
1207
  * the JSPB instance for transitional soy proto support:
993
1208
  * http://goto/soy-param-migration
994
- * @param {!proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint} msg The msg instance to transform.
1209
+ * @param {!proto.gateway.parallax.v1.CreateTraceResponse} msg The msg instance to transform.
995
1210
  * @return {!Object}
996
1211
  * @suppress {unusedLocalVariables} f is only used for nested messages
997
1212
  */
998
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.toObject = function(includeInstance, msg) {
1213
+ proto.gateway.parallax.v1.CreateTraceResponse.toObject = function(includeInstance, msg) {
999
1214
  var f, obj = {
1000
- chainId: jspb.Message.getFieldWithDefault(msg, 1, ""),
1001
- txHash: jspb.Message.getFieldWithDefault(msg, 2, ""),
1002
- details: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f,
1003
- timestamp: (f = msg.getTimestamp()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f)
1215
+ status: (f = msg.getStatus()) && proto_common_v1_status_pb.ResponseStatus.toObject(includeInstance, f),
1216
+ traceId: jspb.Message.getFieldWithDefault(msg, 2, "")
1004
1217
  };
1005
1218
 
1006
1219
  if (includeInstance) {
@@ -1014,23 +1227,23 @@
1014
1227
  /**
1015
1228
  * Deserializes binary data (in protobuf wire format).
1016
1229
  * @param {jspb.ByteSource} bytes The bytes to deserialize.
1017
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint}
1230
+ * @return {!proto.gateway.parallax.v1.CreateTraceResponse}
1018
1231
  */
1019
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.deserializeBinary = function(bytes) {
1232
+ proto.gateway.parallax.v1.CreateTraceResponse.deserializeBinary = function(bytes) {
1020
1233
  var reader = new jspb.BinaryReader(bytes);
1021
- var msg = new proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint;
1022
- return proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.deserializeBinaryFromReader(msg, reader);
1234
+ var msg = new proto.gateway.parallax.v1.CreateTraceResponse;
1235
+ return proto.gateway.parallax.v1.CreateTraceResponse.deserializeBinaryFromReader(msg, reader);
1023
1236
  };
1024
1237
 
1025
1238
 
1026
1239
  /**
1027
1240
  * Deserializes binary data (in protobuf wire format) from the
1028
1241
  * given reader into the given message object.
1029
- * @param {!proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint} msg The message object to deserialize into.
1242
+ * @param {!proto.gateway.parallax.v1.CreateTraceResponse} msg The message object to deserialize into.
1030
1243
  * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1031
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint}
1244
+ * @return {!proto.gateway.parallax.v1.CreateTraceResponse}
1032
1245
  */
1033
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.deserializeBinaryFromReader = function(msg, reader) {
1246
+ proto.gateway.parallax.v1.CreateTraceResponse.deserializeBinaryFromReader = function(msg, reader) {
1034
1247
  while (reader.nextField()) {
1035
1248
  if (reader.isEndGroup()) {
1036
1249
  break;
@@ -1038,21 +1251,13 @@
1038
1251
  var field = reader.getFieldNumber();
1039
1252
  switch (field) {
1040
1253
  case 1:
1041
- var value = /** @type {string} */ (reader.readString());
1042
- msg.setChainId(value);
1254
+ var value = new proto_common_v1_status_pb.ResponseStatus;
1255
+ reader.readMessage(value,proto_common_v1_status_pb.ResponseStatus.deserializeBinaryFromReader);
1256
+ msg.setStatus(value);
1043
1257
  break;
1044
1258
  case 2:
1045
1259
  var value = /** @type {string} */ (reader.readString());
1046
- msg.setTxHash(value);
1047
- break;
1048
- case 3:
1049
- var value = /** @type {string} */ (reader.readString());
1050
- msg.setDetails(value);
1051
- break;
1052
- case 4:
1053
- var value = new google_protobuf_timestamp_pb.Timestamp;
1054
- reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
1055
- msg.setTimestamp(value);
1260
+ msg.setTraceId(value);
1056
1261
  break;
1057
1262
  default:
1058
1263
  reader.skipField();
@@ -1067,9 +1272,9 @@
1067
1272
  * Serializes the message to binary data (in protobuf wire format).
1068
1273
  * @return {!Uint8Array}
1069
1274
  */
1070
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.prototype.serializeBinary = function() {
1275
+ proto.gateway.parallax.v1.CreateTraceResponse.prototype.serializeBinary = function() {
1071
1276
  var writer = new jspb.BinaryWriter();
1072
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.serializeBinaryToWriter(this, writer);
1277
+ proto.gateway.parallax.v1.CreateTraceResponse.serializeBinaryToWriter(this, writer);
1073
1278
  return writer.getResultBuffer();
1074
1279
  };
1075
1280
 
@@ -1077,28 +1282,219 @@
1077
1282
  /**
1078
1283
  * Serializes the given message to binary data (in protobuf wire
1079
1284
  * format), writing to the given BinaryWriter.
1080
- * @param {!proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint} message
1285
+ * @param {!proto.gateway.parallax.v1.CreateTraceResponse} message
1081
1286
  * @param {!jspb.BinaryWriter} writer
1082
1287
  * @suppress {unusedLocalVariables} f is only used for nested messages
1083
1288
  */
1084
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.serializeBinaryToWriter = function(message, writer) {
1289
+ proto.gateway.parallax.v1.CreateTraceResponse.serializeBinaryToWriter = function(message, writer) {
1085
1290
  var f = undefined;
1086
- f = message.getChainId();
1087
- if (f.length > 0) {
1088
- writer.writeString(
1291
+ f = message.getStatus();
1292
+ if (f != null) {
1293
+ writer.writeMessage(
1089
1294
  1,
1090
- f
1295
+ f,
1296
+ proto_common_v1_status_pb.ResponseStatus.serializeBinaryToWriter
1091
1297
  );
1092
1298
  }
1093
- f = message.getTxHash();
1299
+ f = message.getTraceId();
1094
1300
  if (f.length > 0) {
1095
1301
  writer.writeString(
1096
1302
  2,
1097
1303
  f
1098
1304
  );
1099
1305
  }
1100
- f = /** @type {string} */ (jspb.Message.getField(message, 3));
1101
- if (f != null) {
1306
+ };
1307
+
1308
+
1309
+ /**
1310
+ * optional common.v1.ResponseStatus status = 1;
1311
+ * @return {?proto.common.v1.ResponseStatus}
1312
+ */
1313
+ proto.gateway.parallax.v1.CreateTraceResponse.prototype.getStatus = function() {
1314
+ return /** @type{?proto.common.v1.ResponseStatus} */ (
1315
+ jspb.Message.getWrapperField(this, proto_common_v1_status_pb.ResponseStatus, 1));
1316
+ };
1317
+
1318
+
1319
+ /**
1320
+ * @param {?proto.common.v1.ResponseStatus|undefined} value
1321
+ * @return {!proto.gateway.parallax.v1.CreateTraceResponse} returns this
1322
+ */
1323
+ proto.gateway.parallax.v1.CreateTraceResponse.prototype.setStatus = function(value) {
1324
+ return jspb.Message.setWrapperField(this, 1, value);
1325
+ };
1326
+
1327
+
1328
+ /**
1329
+ * Clears the message field making it undefined.
1330
+ * @return {!proto.gateway.parallax.v1.CreateTraceResponse} returns this
1331
+ */
1332
+ proto.gateway.parallax.v1.CreateTraceResponse.prototype.clearStatus = function() {
1333
+ return this.setStatus(undefined);
1334
+ };
1335
+
1336
+
1337
+ /**
1338
+ * Returns whether this field is set.
1339
+ * @return {boolean}
1340
+ */
1341
+ proto.gateway.parallax.v1.CreateTraceResponse.prototype.hasStatus = function() {
1342
+ return jspb.Message.getField(this, 1) != null;
1343
+ };
1344
+
1345
+
1346
+ /**
1347
+ * optional string trace_id = 2;
1348
+ * @return {string}
1349
+ */
1350
+ proto.gateway.parallax.v1.CreateTraceResponse.prototype.getTraceId = function() {
1351
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
1352
+ };
1353
+
1354
+
1355
+ /**
1356
+ * @param {string} value
1357
+ * @return {!proto.gateway.parallax.v1.CreateTraceResponse} returns this
1358
+ */
1359
+ proto.gateway.parallax.v1.CreateTraceResponse.prototype.setTraceId = function(value) {
1360
+ return jspb.Message.setProto3StringField(this, 2, value);
1361
+ };
1362
+
1363
+
1364
+
1365
+
1366
+
1367
+ if (jspb.Message.GENERATE_TO_OBJECT) {
1368
+ /**
1369
+ * Creates an object representation of this proto.
1370
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
1371
+ * Optional fields that are not set will be set to undefined.
1372
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1373
+ * For the list of reserved names please see:
1374
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1375
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1376
+ * JSPB instance for transitional soy proto support:
1377
+ * http://goto/soy-param-migration
1378
+ * @return {!Object}
1379
+ */
1380
+ proto.gateway.parallax.v1.TxHashHint.prototype.toObject = function(opt_includeInstance) {
1381
+ return proto.gateway.parallax.v1.TxHashHint.toObject(opt_includeInstance, this);
1382
+ };
1383
+
1384
+
1385
+ /**
1386
+ * Static version of the {@see toObject} method.
1387
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1388
+ * the JSPB instance for transitional soy proto support:
1389
+ * http://goto/soy-param-migration
1390
+ * @param {!proto.gateway.parallax.v1.TxHashHint} msg The msg instance to transform.
1391
+ * @return {!Object}
1392
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1393
+ */
1394
+ proto.gateway.parallax.v1.TxHashHint.toObject = function(includeInstance, msg) {
1395
+ var f, obj = {
1396
+ chain: jspb.Message.getFieldWithDefault(msg, 1, 0),
1397
+ txHash: jspb.Message.getFieldWithDefault(msg, 2, ""),
1398
+ details: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f,
1399
+ timestamp: (f = msg.getTimestamp()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f)
1400
+ };
1401
+
1402
+ if (includeInstance) {
1403
+ obj.$jspbMessageInstance = msg;
1404
+ }
1405
+ return obj;
1406
+ };
1407
+ }
1408
+
1409
+
1410
+ /**
1411
+ * Deserializes binary data (in protobuf wire format).
1412
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
1413
+ * @return {!proto.gateway.parallax.v1.TxHashHint}
1414
+ */
1415
+ proto.gateway.parallax.v1.TxHashHint.deserializeBinary = function(bytes) {
1416
+ var reader = new jspb.BinaryReader(bytes);
1417
+ var msg = new proto.gateway.parallax.v1.TxHashHint;
1418
+ return proto.gateway.parallax.v1.TxHashHint.deserializeBinaryFromReader(msg, reader);
1419
+ };
1420
+
1421
+
1422
+ /**
1423
+ * Deserializes binary data (in protobuf wire format) from the
1424
+ * given reader into the given message object.
1425
+ * @param {!proto.gateway.parallax.v1.TxHashHint} msg The message object to deserialize into.
1426
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1427
+ * @return {!proto.gateway.parallax.v1.TxHashHint}
1428
+ */
1429
+ proto.gateway.parallax.v1.TxHashHint.deserializeBinaryFromReader = function(msg, reader) {
1430
+ while (reader.nextField()) {
1431
+ if (reader.isEndGroup()) {
1432
+ break;
1433
+ }
1434
+ var field = reader.getFieldNumber();
1435
+ switch (field) {
1436
+ case 1:
1437
+ var value = /** @type {!proto.gateway.parallax.v1.Chain} */ (reader.readEnum());
1438
+ msg.setChain(value);
1439
+ break;
1440
+ case 2:
1441
+ var value = /** @type {string} */ (reader.readString());
1442
+ msg.setTxHash(value);
1443
+ break;
1444
+ case 3:
1445
+ var value = /** @type {string} */ (reader.readString());
1446
+ msg.setDetails(value);
1447
+ break;
1448
+ case 4:
1449
+ var value = new google_protobuf_timestamp_pb.Timestamp;
1450
+ reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
1451
+ msg.setTimestamp(value);
1452
+ break;
1453
+ default:
1454
+ reader.skipField();
1455
+ break;
1456
+ }
1457
+ }
1458
+ return msg;
1459
+ };
1460
+
1461
+
1462
+ /**
1463
+ * Serializes the message to binary data (in protobuf wire format).
1464
+ * @return {!Uint8Array}
1465
+ */
1466
+ proto.gateway.parallax.v1.TxHashHint.prototype.serializeBinary = function() {
1467
+ var writer = new jspb.BinaryWriter();
1468
+ proto.gateway.parallax.v1.TxHashHint.serializeBinaryToWriter(this, writer);
1469
+ return writer.getResultBuffer();
1470
+ };
1471
+
1472
+
1473
+ /**
1474
+ * Serializes the given message to binary data (in protobuf wire
1475
+ * format), writing to the given BinaryWriter.
1476
+ * @param {!proto.gateway.parallax.v1.TxHashHint} message
1477
+ * @param {!jspb.BinaryWriter} writer
1478
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1479
+ */
1480
+ proto.gateway.parallax.v1.TxHashHint.serializeBinaryToWriter = function(message, writer) {
1481
+ var f = undefined;
1482
+ f = message.getChain();
1483
+ if (f !== 0.0) {
1484
+ writer.writeEnum(
1485
+ 1,
1486
+ f
1487
+ );
1488
+ }
1489
+ f = message.getTxHash();
1490
+ if (f.length > 0) {
1491
+ writer.writeString(
1492
+ 2,
1493
+ f
1494
+ );
1495
+ }
1496
+ f = /** @type {string} */ (jspb.Message.getField(message, 3));
1497
+ if (f != null) {
1102
1498
  writer.writeString(
1103
1499
  3,
1104
1500
  f
@@ -1116,20 +1512,20 @@
1116
1512
 
1117
1513
 
1118
1514
  /**
1119
- * optional string chain_id = 1;
1120
- * @return {string}
1515
+ * optional Chain chain = 1;
1516
+ * @return {!proto.gateway.parallax.v1.Chain}
1121
1517
  */
1122
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.prototype.getChainId = function() {
1123
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
1518
+ proto.gateway.parallax.v1.TxHashHint.prototype.getChain = function() {
1519
+ return /** @type {!proto.gateway.parallax.v1.Chain} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
1124
1520
  };
1125
1521
 
1126
1522
 
1127
1523
  /**
1128
- * @param {string} value
1129
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint} returns this
1524
+ * @param {!proto.gateway.parallax.v1.Chain} value
1525
+ * @return {!proto.gateway.parallax.v1.TxHashHint} returns this
1130
1526
  */
1131
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.prototype.setChainId = function(value) {
1132
- return jspb.Message.setProto3StringField(this, 1, value);
1527
+ proto.gateway.parallax.v1.TxHashHint.prototype.setChain = function(value) {
1528
+ return jspb.Message.setProto3EnumField(this, 1, value);
1133
1529
  };
1134
1530
 
1135
1531
 
@@ -1137,16 +1533,16 @@
1137
1533
  * optional string tx_hash = 2;
1138
1534
  * @return {string}
1139
1535
  */
1140
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.prototype.getTxHash = function() {
1536
+ proto.gateway.parallax.v1.TxHashHint.prototype.getTxHash = function() {
1141
1537
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
1142
1538
  };
1143
1539
 
1144
1540
 
1145
1541
  /**
1146
1542
  * @param {string} value
1147
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint} returns this
1543
+ * @return {!proto.gateway.parallax.v1.TxHashHint} returns this
1148
1544
  */
1149
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.prototype.setTxHash = function(value) {
1545
+ proto.gateway.parallax.v1.TxHashHint.prototype.setTxHash = function(value) {
1150
1546
  return jspb.Message.setProto3StringField(this, 2, value);
1151
1547
  };
1152
1548
 
@@ -1155,25 +1551,25 @@
1155
1551
  * optional string details = 3;
1156
1552
  * @return {string}
1157
1553
  */
1158
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.prototype.getDetails = function() {
1554
+ proto.gateway.parallax.v1.TxHashHint.prototype.getDetails = function() {
1159
1555
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
1160
1556
  };
1161
1557
 
1162
1558
 
1163
1559
  /**
1164
1560
  * @param {string} value
1165
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint} returns this
1561
+ * @return {!proto.gateway.parallax.v1.TxHashHint} returns this
1166
1562
  */
1167
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.prototype.setDetails = function(value) {
1563
+ proto.gateway.parallax.v1.TxHashHint.prototype.setDetails = function(value) {
1168
1564
  return jspb.Message.setField(this, 3, value);
1169
1565
  };
1170
1566
 
1171
1567
 
1172
1568
  /**
1173
1569
  * Clears the field making it undefined.
1174
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint} returns this
1570
+ * @return {!proto.gateway.parallax.v1.TxHashHint} returns this
1175
1571
  */
1176
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.prototype.clearDetails = function() {
1572
+ proto.gateway.parallax.v1.TxHashHint.prototype.clearDetails = function() {
1177
1573
  return jspb.Message.setField(this, 3, undefined);
1178
1574
  };
1179
1575
 
@@ -1182,7 +1578,7 @@
1182
1578
  * Returns whether this field is set.
1183
1579
  * @return {boolean}
1184
1580
  */
1185
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.prototype.hasDetails = function() {
1581
+ proto.gateway.parallax.v1.TxHashHint.prototype.hasDetails = function() {
1186
1582
  return jspb.Message.getField(this, 3) != null;
1187
1583
  };
1188
1584
 
@@ -1191,7 +1587,7 @@
1191
1587
  * optional google.protobuf.Timestamp timestamp = 4;
1192
1588
  * @return {?proto.google.protobuf.Timestamp}
1193
1589
  */
1194
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.prototype.getTimestamp = function() {
1590
+ proto.gateway.parallax.v1.TxHashHint.prototype.getTimestamp = function() {
1195
1591
  return /** @type{?proto.google.protobuf.Timestamp} */ (
1196
1592
  jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 4));
1197
1593
  };
@@ -1199,18 +1595,18 @@
1199
1595
 
1200
1596
  /**
1201
1597
  * @param {?proto.google.protobuf.Timestamp|undefined} value
1202
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint} returns this
1598
+ * @return {!proto.gateway.parallax.v1.TxHashHint} returns this
1203
1599
  */
1204
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.prototype.setTimestamp = function(value) {
1600
+ proto.gateway.parallax.v1.TxHashHint.prototype.setTimestamp = function(value) {
1205
1601
  return jspb.Message.setWrapperField(this, 4, value);
1206
1602
  };
1207
1603
 
1208
1604
 
1209
1605
  /**
1210
1606
  * Clears the message field making it undefined.
1211
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint} returns this
1607
+ * @return {!proto.gateway.parallax.v1.TxHashHint} returns this
1212
1608
  */
1213
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.prototype.clearTimestamp = function() {
1609
+ proto.gateway.parallax.v1.TxHashHint.prototype.clearTimestamp = function() {
1214
1610
  return this.setTimestamp(undefined);
1215
1611
  };
1216
1612
 
@@ -1219,7 +1615,7 @@
1219
1615
  * Returns whether this field is set.
1220
1616
  * @return {boolean}
1221
1617
  */
1222
- proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint.prototype.hasTimestamp = function() {
1618
+ proto.gateway.parallax.v1.TxHashHint.prototype.hasTimestamp = function() {
1223
1619
  return jspb.Message.getField(this, 4) != null;
1224
1620
  };
1225
1621
 
@@ -1240,8 +1636,8 @@
1240
1636
  * http://goto/soy-param-migration
1241
1637
  * @return {!Object}
1242
1638
  */
1243
- proto.gateway.parallax.v1.CreateTraceRequest.Event.prototype.toObject = function(opt_includeInstance) {
1244
- return proto.gateway.parallax.v1.CreateTraceRequest.Event.toObject(opt_includeInstance, this);
1639
+ proto.gateway.parallax.v1.Event.prototype.toObject = function(opt_includeInstance) {
1640
+ return proto.gateway.parallax.v1.Event.toObject(opt_includeInstance, this);
1245
1641
  };
1246
1642
 
1247
1643
 
@@ -1250,13 +1646,13 @@
1250
1646
  * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1251
1647
  * the JSPB instance for transitional soy proto support:
1252
1648
  * http://goto/soy-param-migration
1253
- * @param {!proto.gateway.parallax.v1.CreateTraceRequest.Event} msg The msg instance to transform.
1649
+ * @param {!proto.gateway.parallax.v1.Event} msg The msg instance to transform.
1254
1650
  * @return {!Object}
1255
1651
  * @suppress {unusedLocalVariables} f is only used for nested messages
1256
1652
  */
1257
- proto.gateway.parallax.v1.CreateTraceRequest.Event.toObject = function(includeInstance, msg) {
1653
+ proto.gateway.parallax.v1.Event.toObject = function(includeInstance, msg) {
1258
1654
  var f, obj = {
1259
- eventName: jspb.Message.getFieldWithDefault(msg, 1, ""),
1655
+ name: jspb.Message.getFieldWithDefault(msg, 1, ""),
1260
1656
  details: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f,
1261
1657
  timestamp: (f = msg.getTimestamp()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f)
1262
1658
  };
@@ -1272,23 +1668,23 @@
1272
1668
  /**
1273
1669
  * Deserializes binary data (in protobuf wire format).
1274
1670
  * @param {jspb.ByteSource} bytes The bytes to deserialize.
1275
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest.Event}
1671
+ * @return {!proto.gateway.parallax.v1.Event}
1276
1672
  */
1277
- proto.gateway.parallax.v1.CreateTraceRequest.Event.deserializeBinary = function(bytes) {
1673
+ proto.gateway.parallax.v1.Event.deserializeBinary = function(bytes) {
1278
1674
  var reader = new jspb.BinaryReader(bytes);
1279
- var msg = new proto.gateway.parallax.v1.CreateTraceRequest.Event;
1280
- return proto.gateway.parallax.v1.CreateTraceRequest.Event.deserializeBinaryFromReader(msg, reader);
1675
+ var msg = new proto.gateway.parallax.v1.Event;
1676
+ return proto.gateway.parallax.v1.Event.deserializeBinaryFromReader(msg, reader);
1281
1677
  };
1282
1678
 
1283
1679
 
1284
1680
  /**
1285
1681
  * Deserializes binary data (in protobuf wire format) from the
1286
1682
  * given reader into the given message object.
1287
- * @param {!proto.gateway.parallax.v1.CreateTraceRequest.Event} msg The message object to deserialize into.
1683
+ * @param {!proto.gateway.parallax.v1.Event} msg The message object to deserialize into.
1288
1684
  * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1289
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest.Event}
1685
+ * @return {!proto.gateway.parallax.v1.Event}
1290
1686
  */
1291
- proto.gateway.parallax.v1.CreateTraceRequest.Event.deserializeBinaryFromReader = function(msg, reader) {
1687
+ proto.gateway.parallax.v1.Event.deserializeBinaryFromReader = function(msg, reader) {
1292
1688
  while (reader.nextField()) {
1293
1689
  if (reader.isEndGroup()) {
1294
1690
  break;
@@ -1297,7 +1693,7 @@
1297
1693
  switch (field) {
1298
1694
  case 1:
1299
1695
  var value = /** @type {string} */ (reader.readString());
1300
- msg.setEventName(value);
1696
+ msg.setName(value);
1301
1697
  break;
1302
1698
  case 2:
1303
1699
  var value = /** @type {string} */ (reader.readString());
@@ -1321,9 +1717,9 @@
1321
1717
  * Serializes the message to binary data (in protobuf wire format).
1322
1718
  * @return {!Uint8Array}
1323
1719
  */
1324
- proto.gateway.parallax.v1.CreateTraceRequest.Event.prototype.serializeBinary = function() {
1720
+ proto.gateway.parallax.v1.Event.prototype.serializeBinary = function() {
1325
1721
  var writer = new jspb.BinaryWriter();
1326
- proto.gateway.parallax.v1.CreateTraceRequest.Event.serializeBinaryToWriter(this, writer);
1722
+ proto.gateway.parallax.v1.Event.serializeBinaryToWriter(this, writer);
1327
1723
  return writer.getResultBuffer();
1328
1724
  };
1329
1725
 
@@ -1331,13 +1727,13 @@
1331
1727
  /**
1332
1728
  * Serializes the given message to binary data (in protobuf wire
1333
1729
  * format), writing to the given BinaryWriter.
1334
- * @param {!proto.gateway.parallax.v1.CreateTraceRequest.Event} message
1730
+ * @param {!proto.gateway.parallax.v1.Event} message
1335
1731
  * @param {!jspb.BinaryWriter} writer
1336
1732
  * @suppress {unusedLocalVariables} f is only used for nested messages
1337
1733
  */
1338
- proto.gateway.parallax.v1.CreateTraceRequest.Event.serializeBinaryToWriter = function(message, writer) {
1734
+ proto.gateway.parallax.v1.Event.serializeBinaryToWriter = function(message, writer) {
1339
1735
  var f = undefined;
1340
- f = message.getEventName();
1736
+ f = message.getName();
1341
1737
  if (f.length > 0) {
1342
1738
  writer.writeString(
1343
1739
  1,
@@ -1363,19 +1759,19 @@
1363
1759
 
1364
1760
 
1365
1761
  /**
1366
- * optional string event_name = 1;
1762
+ * optional string name = 1;
1367
1763
  * @return {string}
1368
1764
  */
1369
- proto.gateway.parallax.v1.CreateTraceRequest.Event.prototype.getEventName = function() {
1765
+ proto.gateway.parallax.v1.Event.prototype.getName = function() {
1370
1766
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
1371
1767
  };
1372
1768
 
1373
1769
 
1374
1770
  /**
1375
1771
  * @param {string} value
1376
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest.Event} returns this
1772
+ * @return {!proto.gateway.parallax.v1.Event} returns this
1377
1773
  */
1378
- proto.gateway.parallax.v1.CreateTraceRequest.Event.prototype.setEventName = function(value) {
1774
+ proto.gateway.parallax.v1.Event.prototype.setName = function(value) {
1379
1775
  return jspb.Message.setProto3StringField(this, 1, value);
1380
1776
  };
1381
1777
 
@@ -1384,25 +1780,25 @@
1384
1780
  * optional string details = 2;
1385
1781
  * @return {string}
1386
1782
  */
1387
- proto.gateway.parallax.v1.CreateTraceRequest.Event.prototype.getDetails = function() {
1783
+ proto.gateway.parallax.v1.Event.prototype.getDetails = function() {
1388
1784
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
1389
1785
  };
1390
1786
 
1391
1787
 
1392
1788
  /**
1393
1789
  * @param {string} value
1394
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest.Event} returns this
1790
+ * @return {!proto.gateway.parallax.v1.Event} returns this
1395
1791
  */
1396
- proto.gateway.parallax.v1.CreateTraceRequest.Event.prototype.setDetails = function(value) {
1792
+ proto.gateway.parallax.v1.Event.prototype.setDetails = function(value) {
1397
1793
  return jspb.Message.setField(this, 2, value);
1398
1794
  };
1399
1795
 
1400
1796
 
1401
1797
  /**
1402
1798
  * Clears the field making it undefined.
1403
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest.Event} returns this
1799
+ * @return {!proto.gateway.parallax.v1.Event} returns this
1404
1800
  */
1405
- proto.gateway.parallax.v1.CreateTraceRequest.Event.prototype.clearDetails = function() {
1801
+ proto.gateway.parallax.v1.Event.prototype.clearDetails = function() {
1406
1802
  return jspb.Message.setField(this, 2, undefined);
1407
1803
  };
1408
1804
 
@@ -1411,7 +1807,7 @@
1411
1807
  * Returns whether this field is set.
1412
1808
  * @return {boolean}
1413
1809
  */
1414
- proto.gateway.parallax.v1.CreateTraceRequest.Event.prototype.hasDetails = function() {
1810
+ proto.gateway.parallax.v1.Event.prototype.hasDetails = function() {
1415
1811
  return jspb.Message.getField(this, 2) != null;
1416
1812
  };
1417
1813
 
@@ -1420,7 +1816,7 @@
1420
1816
  * optional google.protobuf.Timestamp timestamp = 3;
1421
1817
  * @return {?proto.google.protobuf.Timestamp}
1422
1818
  */
1423
- proto.gateway.parallax.v1.CreateTraceRequest.Event.prototype.getTimestamp = function() {
1819
+ proto.gateway.parallax.v1.Event.prototype.getTimestamp = function() {
1424
1820
  return /** @type{?proto.google.protobuf.Timestamp} */ (
1425
1821
  jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3));
1426
1822
  };
@@ -1428,18 +1824,18 @@
1428
1824
 
1429
1825
  /**
1430
1826
  * @param {?proto.google.protobuf.Timestamp|undefined} value
1431
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest.Event} returns this
1827
+ * @return {!proto.gateway.parallax.v1.Event} returns this
1432
1828
  */
1433
- proto.gateway.parallax.v1.CreateTraceRequest.Event.prototype.setTimestamp = function(value) {
1829
+ proto.gateway.parallax.v1.Event.prototype.setTimestamp = function(value) {
1434
1830
  return jspb.Message.setWrapperField(this, 3, value);
1435
1831
  };
1436
1832
 
1437
1833
 
1438
1834
  /**
1439
1835
  * Clears the message field making it undefined.
1440
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest.Event} returns this
1836
+ * @return {!proto.gateway.parallax.v1.Event} returns this
1441
1837
  */
1442
- proto.gateway.parallax.v1.CreateTraceRequest.Event.prototype.clearTimestamp = function() {
1838
+ proto.gateway.parallax.v1.Event.prototype.clearTimestamp = function() {
1443
1839
  return this.setTimestamp(undefined);
1444
1840
  };
1445
1841
 
@@ -1448,412 +1844,30 @@
1448
1844
  * Returns whether this field is set.
1449
1845
  * @return {boolean}
1450
1846
  */
1451
- proto.gateway.parallax.v1.CreateTraceRequest.Event.prototype.hasTimestamp = function() {
1847
+ proto.gateway.parallax.v1.Event.prototype.hasTimestamp = function() {
1452
1848
  return jspb.Message.getField(this, 3) != null;
1453
1849
  };
1454
1850
 
1455
1851
 
1456
1852
  /**
1457
- * optional string name = 1;
1458
- * @return {string}
1459
- */
1460
- proto.gateway.parallax.v1.CreateTraceRequest.prototype.getName = function() {
1461
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
1462
- };
1463
-
1464
-
1465
- /**
1466
- * @param {string} value
1467
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
1468
- */
1469
- proto.gateway.parallax.v1.CreateTraceRequest.prototype.setName = function(value) {
1470
- return jspb.Message.setProto3StringField(this, 1, value);
1471
- };
1472
-
1473
-
1474
- /**
1475
- * map<string, string> attributes = 2;
1476
- * @param {boolean=} opt_noLazyCreate Do not create the map if
1477
- * empty, instead returning `undefined`
1478
- * @return {!jspb.Map<string,string>}
1479
- */
1480
- proto.gateway.parallax.v1.CreateTraceRequest.prototype.getAttributesMap = function(opt_noLazyCreate) {
1481
- return /** @type {!jspb.Map<string,string>} */ (
1482
- jspb.Message.getMapField(this, 2, opt_noLazyCreate,
1483
- null));
1484
- };
1485
-
1486
-
1487
- /**
1488
- * Clears values from the map. The map will be non-null.
1489
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
1490
- */
1491
- proto.gateway.parallax.v1.CreateTraceRequest.prototype.clearAttributesMap = function() {
1492
- this.getAttributesMap().clear();
1493
- return this;
1494
- };
1495
-
1496
-
1497
- /**
1498
- * repeated string tags = 3;
1499
- * @return {!Array<string>}
1500
- */
1501
- proto.gateway.parallax.v1.CreateTraceRequest.prototype.getTagsList = function() {
1502
- return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 3));
1503
- };
1504
-
1505
-
1506
- /**
1507
- * @param {!Array<string>} value
1508
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
1853
+ * @enum {number}
1509
1854
  */
1510
- proto.gateway.parallax.v1.CreateTraceRequest.prototype.setTagsList = function(value) {
1511
- return jspb.Message.setField(this, 3, value || []);
1855
+ proto.gateway.parallax.v1.Chain = {
1856
+ CHAIN_UNSPECIFIED: 0,
1857
+ CHAIN_ETHEREUM: 1,
1858
+ CHAIN_POLYGON: 2,
1859
+ CHAIN_ARBITRUM: 3,
1860
+ CHAIN_BASE: 4,
1861
+ CHAIN_OPTIMISM: 5,
1862
+ CHAIN_BSC: 6
1512
1863
  };
1513
1864
 
1865
+ goog.object.extend(exports$1, proto.gateway.parallax.v1);
1866
+ } (parallax_gateway_pb));
1867
+ return parallax_gateway_pb;
1868
+ }
1514
1869
 
1515
- /**
1516
- * @param {string} value
1517
- * @param {number=} opt_index
1518
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
1519
- */
1520
- proto.gateway.parallax.v1.CreateTraceRequest.prototype.addTags = function(value, opt_index) {
1521
- return jspb.Message.addToRepeatedField(this, 3, value, opt_index);
1522
- };
1523
-
1524
-
1525
- /**
1526
- * Clears the list making it empty but non-null.
1527
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
1528
- */
1529
- proto.gateway.parallax.v1.CreateTraceRequest.prototype.clearTagsList = function() {
1530
- return this.setTagsList([]);
1531
- };
1532
-
1533
-
1534
- /**
1535
- * repeated Event events = 4;
1536
- * @return {!Array<!proto.gateway.parallax.v1.CreateTraceRequest.Event>}
1537
- */
1538
- proto.gateway.parallax.v1.CreateTraceRequest.prototype.getEventsList = function() {
1539
- return /** @type{!Array<!proto.gateway.parallax.v1.CreateTraceRequest.Event>} */ (
1540
- jspb.Message.getRepeatedWrapperField(this, proto.gateway.parallax.v1.CreateTraceRequest.Event, 4));
1541
- };
1542
-
1543
-
1544
- /**
1545
- * @param {!Array<!proto.gateway.parallax.v1.CreateTraceRequest.Event>} value
1546
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
1547
- */
1548
- proto.gateway.parallax.v1.CreateTraceRequest.prototype.setEventsList = function(value) {
1549
- return jspb.Message.setRepeatedWrapperField(this, 4, value);
1550
- };
1551
-
1552
-
1553
- /**
1554
- * @param {!proto.gateway.parallax.v1.CreateTraceRequest.Event=} opt_value
1555
- * @param {number=} opt_index
1556
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest.Event}
1557
- */
1558
- proto.gateway.parallax.v1.CreateTraceRequest.prototype.addEvents = function(opt_value, opt_index) {
1559
- return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.gateway.parallax.v1.CreateTraceRequest.Event, opt_index);
1560
- };
1561
-
1562
-
1563
- /**
1564
- * Clears the list making it empty but non-null.
1565
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
1566
- */
1567
- proto.gateway.parallax.v1.CreateTraceRequest.prototype.clearEventsList = function() {
1568
- return this.setEventsList([]);
1569
- };
1570
-
1571
-
1572
- /**
1573
- * optional TxHashHint tx_hash_hint = 5;
1574
- * @return {?proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint}
1575
- */
1576
- proto.gateway.parallax.v1.CreateTraceRequest.prototype.getTxHashHint = function() {
1577
- return /** @type{?proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint} */ (
1578
- jspb.Message.getWrapperField(this, proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint, 5));
1579
- };
1580
-
1581
-
1582
- /**
1583
- * @param {?proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint|undefined} value
1584
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
1585
- */
1586
- proto.gateway.parallax.v1.CreateTraceRequest.prototype.setTxHashHint = function(value) {
1587
- return jspb.Message.setWrapperField(this, 5, value);
1588
- };
1589
-
1590
-
1591
- /**
1592
- * Clears the message field making it undefined.
1593
- * @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
1594
- */
1595
- proto.gateway.parallax.v1.CreateTraceRequest.prototype.clearTxHashHint = function() {
1596
- return this.setTxHashHint(undefined);
1597
- };
1598
-
1599
-
1600
- /**
1601
- * Returns whether this field is set.
1602
- * @return {boolean}
1603
- */
1604
- proto.gateway.parallax.v1.CreateTraceRequest.prototype.hasTxHashHint = function() {
1605
- return jspb.Message.getField(this, 5) != null;
1606
- };
1607
-
1608
-
1609
-
1610
-
1611
-
1612
- if (jspb.Message.GENERATE_TO_OBJECT) {
1613
- /**
1614
- * Creates an object representation of this proto.
1615
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
1616
- * Optional fields that are not set will be set to undefined.
1617
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1618
- * For the list of reserved names please see:
1619
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1620
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1621
- * JSPB instance for transitional soy proto support:
1622
- * http://goto/soy-param-migration
1623
- * @return {!Object}
1624
- */
1625
- proto.gateway.parallax.v1.CreateTraceResponse.prototype.toObject = function(opt_includeInstance) {
1626
- return proto.gateway.parallax.v1.CreateTraceResponse.toObject(opt_includeInstance, this);
1627
- };
1628
-
1629
-
1630
- /**
1631
- * Static version of the {@see toObject} method.
1632
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1633
- * the JSPB instance for transitional soy proto support:
1634
- * http://goto/soy-param-migration
1635
- * @param {!proto.gateway.parallax.v1.CreateTraceResponse} msg The msg instance to transform.
1636
- * @return {!Object}
1637
- * @suppress {unusedLocalVariables} f is only used for nested messages
1638
- */
1639
- proto.gateway.parallax.v1.CreateTraceResponse.toObject = function(includeInstance, msg) {
1640
- var f, obj = {
1641
- status: (f = msg.getStatus()) && proto_common_v1_status_pb.ResponseStatus.toObject(includeInstance, f),
1642
- traceId: jspb.Message.getFieldWithDefault(msg, 2, "")
1643
- };
1644
-
1645
- if (includeInstance) {
1646
- obj.$jspbMessageInstance = msg;
1647
- }
1648
- return obj;
1649
- };
1650
- }
1651
-
1652
-
1653
- /**
1654
- * Deserializes binary data (in protobuf wire format).
1655
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
1656
- * @return {!proto.gateway.parallax.v1.CreateTraceResponse}
1657
- */
1658
- proto.gateway.parallax.v1.CreateTraceResponse.deserializeBinary = function(bytes) {
1659
- var reader = new jspb.BinaryReader(bytes);
1660
- var msg = new proto.gateway.parallax.v1.CreateTraceResponse;
1661
- return proto.gateway.parallax.v1.CreateTraceResponse.deserializeBinaryFromReader(msg, reader);
1662
- };
1663
-
1664
-
1665
- /**
1666
- * Deserializes binary data (in protobuf wire format) from the
1667
- * given reader into the given message object.
1668
- * @param {!proto.gateway.parallax.v1.CreateTraceResponse} msg The message object to deserialize into.
1669
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1670
- * @return {!proto.gateway.parallax.v1.CreateTraceResponse}
1671
- */
1672
- proto.gateway.parallax.v1.CreateTraceResponse.deserializeBinaryFromReader = function(msg, reader) {
1673
- while (reader.nextField()) {
1674
- if (reader.isEndGroup()) {
1675
- break;
1676
- }
1677
- var field = reader.getFieldNumber();
1678
- switch (field) {
1679
- case 1:
1680
- var value = new proto_common_v1_status_pb.ResponseStatus;
1681
- reader.readMessage(value,proto_common_v1_status_pb.ResponseStatus.deserializeBinaryFromReader);
1682
- msg.setStatus(value);
1683
- break;
1684
- case 2:
1685
- var value = /** @type {string} */ (reader.readString());
1686
- msg.setTraceId(value);
1687
- break;
1688
- default:
1689
- reader.skipField();
1690
- break;
1691
- }
1692
- }
1693
- return msg;
1694
- };
1695
-
1696
-
1697
- /**
1698
- * Serializes the message to binary data (in protobuf wire format).
1699
- * @return {!Uint8Array}
1700
- */
1701
- proto.gateway.parallax.v1.CreateTraceResponse.prototype.serializeBinary = function() {
1702
- var writer = new jspb.BinaryWriter();
1703
- proto.gateway.parallax.v1.CreateTraceResponse.serializeBinaryToWriter(this, writer);
1704
- return writer.getResultBuffer();
1705
- };
1706
-
1707
-
1708
- /**
1709
- * Serializes the given message to binary data (in protobuf wire
1710
- * format), writing to the given BinaryWriter.
1711
- * @param {!proto.gateway.parallax.v1.CreateTraceResponse} message
1712
- * @param {!jspb.BinaryWriter} writer
1713
- * @suppress {unusedLocalVariables} f is only used for nested messages
1714
- */
1715
- proto.gateway.parallax.v1.CreateTraceResponse.serializeBinaryToWriter = function(message, writer) {
1716
- var f = undefined;
1717
- f = message.getStatus();
1718
- if (f != null) {
1719
- writer.writeMessage(
1720
- 1,
1721
- f,
1722
- proto_common_v1_status_pb.ResponseStatus.serializeBinaryToWriter
1723
- );
1724
- }
1725
- f = message.getTraceId();
1726
- if (f.length > 0) {
1727
- writer.writeString(
1728
- 2,
1729
- f
1730
- );
1731
- }
1732
- };
1733
-
1734
-
1735
- /**
1736
- * optional common.v1.ResponseStatus status = 1;
1737
- * @return {?proto.common.v1.ResponseStatus}
1738
- */
1739
- proto.gateway.parallax.v1.CreateTraceResponse.prototype.getStatus = function() {
1740
- return /** @type{?proto.common.v1.ResponseStatus} */ (
1741
- jspb.Message.getWrapperField(this, proto_common_v1_status_pb.ResponseStatus, 1));
1742
- };
1743
-
1744
-
1745
- /**
1746
- * @param {?proto.common.v1.ResponseStatus|undefined} value
1747
- * @return {!proto.gateway.parallax.v1.CreateTraceResponse} returns this
1748
- */
1749
- proto.gateway.parallax.v1.CreateTraceResponse.prototype.setStatus = function(value) {
1750
- return jspb.Message.setWrapperField(this, 1, value);
1751
- };
1752
-
1753
-
1754
- /**
1755
- * Clears the message field making it undefined.
1756
- * @return {!proto.gateway.parallax.v1.CreateTraceResponse} returns this
1757
- */
1758
- proto.gateway.parallax.v1.CreateTraceResponse.prototype.clearStatus = function() {
1759
- return this.setStatus(undefined);
1760
- };
1761
-
1762
-
1763
- /**
1764
- * Returns whether this field is set.
1765
- * @return {boolean}
1766
- */
1767
- proto.gateway.parallax.v1.CreateTraceResponse.prototype.hasStatus = function() {
1768
- return jspb.Message.getField(this, 1) != null;
1769
- };
1770
-
1771
-
1772
- /**
1773
- * optional string trace_id = 2;
1774
- * @return {string}
1775
- */
1776
- proto.gateway.parallax.v1.CreateTraceResponse.prototype.getTraceId = function() {
1777
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
1778
- };
1779
-
1780
-
1781
- /**
1782
- * @param {string} value
1783
- * @return {!proto.gateway.parallax.v1.CreateTraceResponse} returns this
1784
- */
1785
- proto.gateway.parallax.v1.CreateTraceResponse.prototype.setTraceId = function(value) {
1786
- return jspb.Message.setProto3StringField(this, 2, value);
1787
- };
1788
-
1789
-
1790
- goog.object.extend(exports$1, proto.gateway.parallax.v1);
1791
- } (parallax_gateway_pb));
1792
- return parallax_gateway_pb;
1793
- }
1794
-
1795
- var parallax_gateway_pbExports = requireParallax_gateway_pb();
1796
-
1797
- var grpcWeb = {};
1798
-
1799
- /*
1800
-
1801
- Copyright The Closure Library Authors.
1802
- SPDX-License-Identifier: Apache-2.0
1803
- */
1804
-
1805
- var hasRequiredGrpcWeb;
1806
-
1807
- function requireGrpcWeb () {
1808
- if (hasRequiredGrpcWeb) return grpcWeb;
1809
- hasRequiredGrpcWeb = 1;
1810
- var n,p=p||{},q=grpcWeb||self;function r(a,b){a=a.split(".");b=b||q;for(var c=0;c<a.length;c++)if(b=b[a[c]],b==null)return null;return b}function t(a){var b=typeof a;return b=="object"&&a!=null||b=="function"}function ca(a,b,c){return a.call.apply(a.bind,arguments)}
1811
- function da(a,b,c){if(!a)throw Error();if(arguments.length>2){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}function w(a,b,c){w=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?ca:da;return w.apply(null,arguments)}
1812
- function x(a,b){function c(){}c.prototype=b.prototype;a.N=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.aa=function(d,e,g){for(var f=Array(arguments.length-2),h=2;h<arguments.length;h++)f[h-2]=arguments[h];return b.prototype[e].apply(d,f)};}class ea{constructor(a){this.g=a||{};}get(a){return this.g[a]}}class fa{constructor(a,b,c){var d=new ea;this.j=a;this.h=b;this.g=c;this.i=d;}getRequestMessage(){return this.j}getMethodDescriptor(){return this.h}getMetadata(){return this.g}getCallOptions(){return this.i}}class ha{constructor(a,b,c={},d=null){this.i=a;this.g=c;this.h=b;this.j=d;}getResponseMessage(){return this.i}getMetadata(){return this.g}getMethodDescriptor(){return this.h}getStatus(){return this.j}}function ia(a,b,c={}){return new fa(b,a,c)}function ja(a,b,c={},d=null){return new ha(b,a,c,d)}const ka=class{constructor(a,b,c,d,e,g){this.name=a;this.g=e;this.h=g;}getName(){return this.name}};ka.prototype.getName=ka.prototype.getName;class la{constructor(a){this.g=a;}on(a,b){return a=="data"||a=="error"?this:this.g.on(a,b)}removeListener(a,b){return this.g.removeListener(a,b)}cancel(){this.g.cancel();}}function ma(a){switch(a){case 0:return "No Error";case 1:return "Access denied to content document";case 2:return "File not found";case 3:return "Firefox silently errored";case 4:return "Application custom error";case 5:return "An exception occurred";case 6:return "Http response at 400 or 500 level";case 7:return "Request was aborted";case 8:return "Request timed out";case 9:return "The resource is not available offline";default:return "Unrecognized error code"}}function y(a,b){if(Error.captureStackTrace)Error.captureStackTrace(this,y);else {const c=Error().stack;c&&(this.stack=c);}a&&(this.message=String(a));b!==void 0&&(this.cause=b);}x(y,Error);y.prototype.name="CustomError";function na(a,b){a=a.split("%s");let c="";const d=a.length-1;for(let e=0;e<d;e++)c+=a[e]+(e<b.length?b[e]:"%s");y.call(this,c+a[d]);}x(na,y);na.prototype.name="AssertionError";function oa(a,b){throw new na("Failure"+(": "+a),Array.prototype.slice.call(arguments,1));}function pa(a,b){function c(l){l==qa?f.o=l:l==B?f.o=l:ra(f,h,k,"invalid frame byte");f.h=sa;f.g=0;f.l=0;}function d(l){f.l++;f.g=(f.g<<8)+l;f.l==4&&(f.h=ta,f.m=0,typeof Uint8Array!=="undefined"?f.i=new Uint8Array(f.g):f.i=Array(f.g),f.g==0&&g());}function e(l){f.i[f.m++]=l;f.m==f.g&&g();}function g(){var l={};l[f.o]=f.i;f.j.push(l);f.h=ua;}var f=a,h,k=0;for(b instanceof Uint8Array||b instanceof Array?h=b:h=new Uint8Array(b);k<h.length;){switch(f.h){case va:ra(f,h,k,"stream already broken");break;case ua:c(h[k]);
1813
- break;case sa:d(h[k]);break;case ta:e(h[k]);break;default:throw Error("unexpected parser state: "+f.h);}f.v++;k++;}a=f.j;f.j=[];return a.length>0?a:null}class wa{constructor(){this.u=null;this.j=[];this.v=0;this.h=ua;this.l=this.g=this.o=0;this.i=null;this.m=0;}}var ua=0,sa=1,ta=2,va=3,qa=0,B=128;function ra(a,b,c,d){a.h=va;a.u="The stream is broken @"+a.v+"/"+c+". Error: "+d+". With input:\n"+b;throw Error(a.u);}function xa(a){switch(a){case 200:return 0;case 400:return 3;case 401:return 16;case 403:return 7;case 404:return 5;case 409:return 10;case 412:return 9;case 429:return 8;case 499:return 1;case 500:return 2;case 501:return 12;case 503:return 14;case 504:return 4;default:return 2}}
1814
- function ya(a){switch(a){case 0:return "OK";case 1:return "CANCELLED";case 2:return "UNKNOWN";case 3:return "INVALID_ARGUMENT";case 4:return "DEADLINE_EXCEEDED";case 5:return "NOT_FOUND";case 6:return "ALREADY_EXISTS";case 7:return "PERMISSION_DENIED";case 16:return "UNAUTHENTICATED";case 8:return "RESOURCE_EXHAUSTED";case 9:return "FAILED_PRECONDITION";case 10:return "ABORTED";case 11:return "OUT_OF_RANGE";case 12:return "UNIMPLEMENTED";case 13:return "INTERNAL";case 14:return "UNAVAILABLE";case 15:return "DATA_LOSS";
1815
- default:return ""}}class C extends Error{constructor(a,b,c={}){super(b);this.code=a;this.metadata=c;}toString(){let a=`RpcError(${ya(this.code)||String(this.code)})`;this.message&&(a+=": "+this.message);return a}}C.prototype.name="RpcError";const za=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(typeof a==="string")return typeof b!=="string"||b.length!=1?-1:a.indexOf(b,0);for(let c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return -1};function Aa(){var a=q.navigator;return a&&(a=a.userAgent)?a:""}function D(a){return Aa().indexOf(a)!=-1}function Ba(a){Ba[" "](a);return a}Ba[" "]=function(){};var Ca=D("Trident")||D("MSIE"),Da=D("Gecko")&&!(Aa().toLowerCase().indexOf("webkit")!=-1&&!D("Edge"))&&!(D("Trident")||D("MSIE"))&&!D("Edge");var Fa=class{constructor(a){if(Ea!==Ea)throw Error("SafeUrl is not meant to be built directly");this.g=a;}toString(){return this.g.toString()}},Ea={};new Fa("about:invalid#zClosurez");new Fa("about:blank");const Ga={};class Ha{constructor(){if(Ga!==Ga)throw Error("SafeStyle is not meant to be built directly");}toString(){return "".toString()}}new Ha;function Ia(a,b){for(const c in a)b.call(void 0,a[c],c,a);}function Ja(a,b){const c={};for(const d in a)c[d]=b.call(void 0,a[d],d,a);return c}const Ka="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function La(a,b){let c,d;for(let e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(let g=0;g<Ka.length;g++)c=Ka[g],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c]);}}const Ma={};class Na{constructor(){if(Ma!==Ma)throw Error("SafeStyleSheet is not meant to be built directly");}toString(){return "".toString()}}new Na;const Oa={};class Pa{constructor(){var a=q.trustedTypes&&q.trustedTypes.emptyHTML||"";if(Oa!==Oa)throw Error("SafeHtml is not meant to be built directly");this.g=a;}toString(){return this.g.toString()}}new Pa;function Qa(a){var b=1;a=a.split(":");const c=[];for(;b>0&&a.length;)c.push(a.shift()),b--;a.length&&c.push(a.join(":"));return c}function E(){this.v=this.v;this.o=this.o;}var Ra=0;E.prototype.v=false;E.prototype.dispose=function(){if(!this.v&&(this.v=true,this.C(),0!=Ra));};E.prototype.C=function(){if(this.o)for(;this.o.length;)this.o.shift()();};var Ta=Object.freeze||function(a){return a};function F(a,b){this.type=a;this.g=this.target=b;this.defaultPrevented=false;}F.prototype.h=function(){this.defaultPrevented=true;};var Ua=function(){if(!q.addEventListener||!Object.defineProperty)return false;var a=false,b=Object.defineProperty({},"passive",{get:function(){a=true;}});try{const c=()=>{};q.addEventListener("test",c,b);q.removeEventListener("test",c,b);}catch(c){}return a}();function G(a,b){F.call(this,a?a.type:"");this.relatedTarget=this.g=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.key="";this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=false;this.state=null;this.pointerId=0;this.pointerType="";this.i=null;a&&this.init(a,b);}x(G,F);var Va=Ta({2:"touch",3:"pen",4:"mouse"});
1816
- G.prototype.init=function(a,b){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.g=b;if(b=a.relatedTarget){if(Da){a:{try{Ba(b.nodeName);var e=!0;break a}catch(g){}e=false;}e||(b=null);}}else c=="mouseover"?b=a.fromElement:c=="mouseout"&&(b=a.toElement);this.relatedTarget=b;d?(this.clientX=d.clientX!==void 0?d.clientX:d.pageX,this.clientY=d.clientY!==void 0?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||
1817
- 0):(this.clientX=a.clientX!==void 0?a.clientX:a.pageX,this.clientY=a.clientY!==void 0?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0);this.button=a.button;this.key=a.key||"";this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.pointerId=a.pointerId||0;this.pointerType=typeof a.pointerType==="string"?a.pointerType:Va[a.pointerType]||"";this.state=a.state;this.i=a;a.defaultPrevented&&G.N.h.call(this);};
1818
- G.prototype.h=function(){G.N.h.call(this);var a=this.i;a.preventDefault?a.preventDefault():a.returnValue=false;};var H="closure_listenable_"+(Math.random()*1E6|0);var Wa=0;function Xa(a,b,c,d,e){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.M=e;this.key=++Wa;this.D=this.L=false;}function I(a){a.D=true;a.listener=null;a.proxy=null;a.src=null;a.M=null;}function J(a){this.src=a;this.g={};this.h=0;}J.prototype.add=function(a,b,c,d,e){var g=a.toString();a=this.g[g];a||(a=this.g[g]=[],this.h++);var f=Ya(a,b,d,e);f>-1?(b=a[f],c||(b.L=false)):(b=new Xa(b,this.src,g,!!d,e),b.L=c,a.push(b));return b};function Za(a,b){var c=b.type;if(c in a.g){var d=a.g[c],e=za(d,b),g;(g=e>=0)&&Array.prototype.splice.call(d,e,1);g&&(I(b),a.g[c].length==0&&(delete a.g[c],a.h--));}}
1819
- function Ya(a,b,c,d){for(var e=0;e<a.length;++e){var g=a[e];if(!g.D&&g.listener==b&&g.capture==!!c&&g.M==d)return e}return -1}var $a="closure_lm_"+(Math.random()*1E6|0),ab={};function cb(a,b,c,d,e){if(Array.isArray(b))for(var g=0;g<b.length;g++)cb(a,b[g],c,d,e);else c=eb(c),a&&a[H]?a.j.add(String(b),c,false,t(d)?!!d.capture:false,e):fb(a,b,c,false,d,e);}
1820
- function fb(a,b,c,d,e,g){if(!b)throw Error("Invalid event type");var f=t(e)?!!e.capture:!!e,h=gb(a);h||(a[$a]=h=new J(a));c=h.add(b,c,d,f,g);if(!c.proxy){d=hb();c.proxy=d;d.src=a;d.listener=c;if(a.addEventListener)Ua||(e=f),e===void 0&&(e=false),a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(mb(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error("addEventListener and attachEvent are unavailable.");}}
1821
- function hb(){function a(c){return b.call(a.src,a.listener,c)}const b=nb;return a} function ob(a,b,c,d,e){if(Array.isArray(b))for(var g=0;g<b.length;g++)ob(a,b[g],c,d,e);else (d=t(d)?!!d.capture:!!d,c=eb(c),a&&a[H])?(a=a.j,b=String(b).toString(),b in a.g&&(g=a.g[b],c=Ya(g,c,d,e),c>-1&&(I(g[c]),Array.prototype.splice.call(g,c,1),g.length==0&&(delete a.g[b],a.h--)))):a&&(a=gb(a))&&(b=a.g[b.toString()],a=-1,b&&(a=Ya(b,c,d,e)),(c=a>-1?b[a]:null)&&pb(c));}
1822
- function pb(a){if(typeof a!=="number"&&a&&!a.D){var b=a.src;if(b&&b[H])Za(b.j,a);else {var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(mb(c),d):b.addListener&&b.removeListener&&b.removeListener(d);(c=gb(b))?(Za(c,a),c.h==0&&(c.src=null,b[$a]=null)):I(a);}}}function mb(a){return a in ab?ab[a]:ab[a]="on"+a}function nb(a,b){if(a.D)a=true;else {b=new G(b,this);var c=a.listener,d=a.M||a.src;a.L&&pb(a);a=c.call(d,b);}return a}
1823
- function gb(a){a=a[$a];return a instanceof J?a:null}var qb="__closure_events_fn_"+(Math.random()*1E9>>>0);function eb(a){if(typeof a==="function")return a;a[qb]||(a[qb]=function(b){return a.handleEvent(b)});return a[qb]}function K(){E.call(this);this.j=new J(this);this.W=this;this.S=null;}x(K,E);K.prototype[H]=true;K.prototype.removeEventListener=function(a,b,c,d){ob(this,a,b,c,d);};
1824
- function L(a,b){var c,d=a.S;if(d)for(c=[];d;d=d.S)c.push(d);a=a.W;d=b.type||b;if(typeof b==="string")b=new F(b,a);else if(b instanceof F)b.target=b.target||a;else {var e=b;b=new F(d,a);La(b,e);}e=true;if(c)for(var g=c.length-1;g>=0;g--){var f=b.g=c[g];e=M(f,d,true,b)&&e;}f=b.g=a;e=M(f,d,true,b)&&e;e=M(f,d,false,b)&&e;if(c)for(g=0;g<c.length;g++)f=b.g=c[g],e=M(f,d,false,b)&&e;}
1825
- K.prototype.C=function(){K.N.C.call(this);if(this.j){var a=this.j,c;for(c in a.g){for(var d=a.g[c],e=0;e<d.length;e++)I(d[e]);delete a.g[c];a.h--;}}this.S=null;};function M(a,b,c,d){b=a.j.g[String(b)];if(!b)return true;b=b.concat();for(var e=true,g=0;g<b.length;++g){var f=b[g];if(f&&!f.D&&f.capture==c){var h=f.listener,k=f.M||f.src;f.L&&Za(a.j,f);e=h.call(k,d)!==false&&e;}}return e&&!d.defaultPrevented}var rb=q;function sb(a,b,c){if(typeof a==="function")c&&(a=w(a,c));else if(a&&typeof a.handleEvent=="function")a=w(a.handleEvent,a);else throw Error("Invalid listener argument");return Number(b)>2147483647?-1:rb.setTimeout(a,b||0)}var N=class{constructor(a,b){this.name=a;this.value=b;}toString(){return this.name}},O=new N("OFF",Infinity),tb=new N("SEVERE",1E3),ub=new N("CONFIG",700),vb=new N("FINE",500),yb=class{constructor(a,b,c){this.reset(a||O,b,c,void 0,void 0);}reset(){}};function zb(a){if(a.g)return a.g;if(a.h)return zb(a.h);oa("Root logger has no level set.");return O}function Ab(a,b){for(;a;)a.j.forEach(c=>{c(b);}),a=a.h;}
1826
- var Bb=class{constructor(a,b=null){this.g=null;this.j=[];this.h=b||null;this.i=[];this.l={getName:()=>a};}};function P(a,b){var c=a.entries[b];if(c)return c;c=P(a,b.slice(0,Math.max(b.lastIndexOf("."),0)));const d=new Bb(b,c);a.entries[b]=d;c.i.push(d);return d}var Cb=class{constructor(){this.entries={};const a=new Bb("");a.g=ub;this.entries[""]=a;}},Db;function Eb(){Db||=new Cb;return Db}
1827
- function Fb(a,b,c){var d;if(d=a)if(d=a&&b){d=b.value;var e=a?zb(P(Eb(),a.getName())):O;d=d>=e.value;}d&&(b=b||O,d=P(Eb(),a.getName()),typeof c==="function"&&(c=c()),a=a.getName(),a=new yb(b,c,a),Ab(d,a));}function Gb(a,b){a&&Fb(a,tb,b);}function Q(a,b){a&&Fb(a,vb,b);}function Hb(){}Hb.prototype.g=null;function Ib(a){var b;(b=a.g)||(b={},Jb(a)&&(b[0]=true,b[1]=true),b=a.g=b);return b}var Kb;function Lb(){}x(Lb,Hb);function Mb(a){return (a=Jb(a))?new ActiveXObject(a):new XMLHttpRequest}function Jb(a){if(!a.h&&typeof XMLHttpRequest=="undefined"&&typeof ActiveXObject!="undefined"){const b=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];for(let c=0;c<b.length;c++){const d=b[c];try{return new ActiveXObject(d),a.h=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.h}Kb=new Lb;var Nb=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function R(a){K.call(this);this.headers=new Map;this.K=a||null;this.i=false;this.J=this.g=null;this.T=this.G="";this.m=0;this.A="";this.l=this.R=this.F=this.P=false;this.u=0;this.H=null;this.B=Ob;this.I=this.O=false;}x(R,K);var Ob="";R.prototype.h=P(Eb(),"goog.net.XhrIo").l;var Pb=/^https?$/i,Qb=["POST","PUT"];
1828
- function Rb(a,b,c){if(a.g)throw Error("[goog.net.XhrIo] Object is active with another request="+a.G+"; newUri="+b);a.G=b;a.A="";a.m=0;a.T="POST";a.P=false;a.i=true;a.g=a.K?Mb(a.K):Mb(Kb);a.J=a.K?Ib(a.K):Ib(Kb);a.g.onreadystatechange=w(a.U,a);try{Q(a.h,S(a,"Opening Xhr")),a.R=!0,a.g.open("POST",String(b),!0),a.R=!1;}catch(g){Q(a.h,S(a,"Error opening Xhr: "+g.message));Sb(a,g);return}b=c||"";c=new Map(a.headers);const d=Array.from(c.keys()).find(g=>"content-type"==g.toLowerCase()),e=q.FormData&&b instanceof
1829
- q.FormData;!(za(Qb,"POST")>=0)||d||e||c.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const [g,f]of c)a.g.setRequestHeader(g,f);a.B&&(a.g.responseType=a.B);"withCredentials"in a.g&&a.g.withCredentials!==a.O&&(a.g.withCredentials=a.O);try{Tb(a),a.u>0&&(a.I=Ub(a.g),Q(a.h,S(a,"Will abort after "+a.u+"ms if incomplete, xhr2 "+a.I)),a.I?(a.g.timeout=a.u,a.g.ontimeout=w(a.V,a)):a.H=sb(a.V,a.u,a)),Q(a.h,S(a,"Sending request")),a.F=!0,a.g.send(b),a.F=!1;}catch(g){Q(a.h,S(a,"Send error: "+
1830
- g.message)),Sb(a,g);}}function Ub(a){return Ca&&typeof a.timeout==="number"&&a.ontimeout!==void 0}n=R.prototype;n.V=function(){typeof p!="undefined"&&this.g&&(this.A="Timed out after "+this.u+"ms, aborting",this.m=8,Q(this.h,S(this,this.A)),L(this,"timeout"),this.abort(8));};function Sb(a,b){a.i=false;a.g&&(a.l=true,a.g.abort(),a.l=false);a.A=b;a.m=5;Vb(a);T(a);}function Vb(a){a.P||(a.P=true,L(a,"complete"),L(a,"error"));}
1831
- n.abort=function(a){this.g&&this.i&&(Q(this.h,S(this,"Aborting")),this.i=false,this.l=true,this.g.abort(),this.l=false,this.m=a||7,L(this,"complete"),L(this,"abort"),T(this));};n.C=function(){this.g&&(this.i&&(this.i=false,this.l=true,this.g.abort(),this.l=false),T(this,true));R.N.C.call(this);};n.U=function(){this.v||(this.R||this.F||this.l?Wb(this):this.X());};n.X=function(){Wb(this);};
1832
- function Wb(a){if(a.i&&typeof p!="undefined")if(a.J[1]&&U(a)==4&&a.getStatus()==2)Q(a.h,S(a,"Local request error detected and ignored"));else if(a.F&&U(a)==4)sb(a.U,0,a);else if(L(a,"readystatechange"),U(a)==4){Q(a.h,S(a,"Request complete"));a.i=false;try{const f=a.getStatus();a:switch(f){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var b=!0;break a;default:b=!1;}var c;if(!(c=b)){var d;if(d=f===0){var e=String(a.G).match(Nb)[1]||null;!e&&q.self&&q.self.location&&(e=q.self.location.protocol.slice(0,
1833
- -1));d=!Pb.test(e?e.toLowerCase():"");}c=d;}if(c)L(a,"complete"),L(a,"success");else {a.m=6;try{var g=U(a)>2?a.g.statusText:"";}catch(h){Q(a.h,"Can not get status: "+h.message),g="";}a.A=g+" ["+a.getStatus()+"]";Vb(a);}}finally{T(a);}}}function T(a,b){if(a.g){Tb(a);const c=a.g,d=a.J[0]?()=>{}:null;a.g=null;a.J=null;b||L(a,"ready");try{c.onreadystatechange=d;}catch(e){Gb(a.h,"Problem encountered resetting onreadystatechange: "+e.message);}}}
1834
- function Tb(a){a.g&&a.I&&(a.g.ontimeout=null);a.H&&(rb.clearTimeout(a.H),a.H=null);}n.isActive=function(){return !!this.g};function U(a){return a.g?a.g.readyState:0}n.getStatus=function(){try{return U(this)>2?this.g.status:-1}catch(a){return -1}};
1835
- function Xb(a){try{if(!a.g)return null;if("response"in a.g)return a.g.response;switch(a.B){case Ob:case "text":return a.g.responseText;case "arraybuffer":if("mozResponseArrayBuffer"in a.g)return a.g.mozResponseArrayBuffer}Gb(a.h,"Response type "+a.B+" is not supported on this browser");return null}catch(b){return Q(a.h,"Can not get response: "+b.message),null}}
1836
- function Yb(a){const b={};a=(a.g&&U(a)>=2?a.g.getAllResponseHeaders()||"":"").split("\r\n");for(let d=0;d<a.length;d++){if(/^[\s\xa0]*$/.test(a[d]))continue;var c=Qa(a[d]);const e=c[0];c=c[1];if(typeof c!=="string")continue;c=c.trim();const g=b[e]||[];b[e]=g;g.push(c);}return Ja(b,function(d){return d.join(", ")})}function S(a,b){return b+" ["+a.T+" "+a.G+" "+a.getStatus()+"]"}var Zb={},V=null;function $b(a){var b=a.length,c=b*3/4;c%3?c=Math.floor(c):"=.".indexOf(a[b-1])!=-1&&(c="=.".indexOf(a[b-2])!=-1?c-2:c-1);var d=new Uint8Array(c),e=0;ac(a,function(g){d[e++]=g;});return e!==c?d.subarray(0,e):d}
1837
- function ac(a,b){function c(k){for(;d<a.length;){var l=a.charAt(d++),m=V[l];if(m!=null)return m;if(!/^[\s\xa0]*$/.test(l))throw Error("Unknown base64 encoding at char: "+l);}return k}bc();for(var d=0;;){var e=c(-1),g=c(0),f=c(64),h=c(64);if(h===64&&e===-1)break;b(e<<2|g>>4);f!=64&&(b(g<<4&240|f>>2),h!=64&&b(f<<6&192|h));}}
1838
- function bc(){if(!V){V={};for(var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),b=["+/=","+/","-_=","-_.","-_"],c=0;c<5;c++){var d=a.concat(b[c].split(""));Zb[c]=d;for(var e=0;e<d.length;e++){var g=d[e];V[g]===void 0&&(V[g]=e);}}}}const cc=["content-type","grpc-status","grpc-message"];function W(a,b){if(b.code!=0){var c=new C(b.code,decodeURIComponent(b.message||""),b.metadata);for(let d=0;d<a.j.length;d++)a.j[d](c);}b={code:b.code,details:decodeURIComponent(b.message||""),metadata:b.metadata};for(c=0;c<a.m.length;c++)a.m[c](b);}function dc(a,b){for(let c=0;c<a.l.length;c++)a.l[c](b);}function ec(a){for(let b=0;b<a.i.length;b++)a.i[b]();}function X(a,b){b=a.indexOf(b);b>-1&&a.splice(b,1);}
1839
- class Y{constructor(a){this.g=a.$;this.v=null;this.h=[];this.m=[];this.l=[];this.j=[];this.i=[];this.u=false;this.o=0;this.A=new wa;const b=this;cb(this.g,"readystatechange",function(){var c=b.g;if(c=c.g?c.g.getResponseHeader("Content-Type"):null){c=c.toLowerCase();if(c.lastIndexOf("application/grpc-web-text",0)==0){c=b.g;try{var d=c.g?c.g.responseText:"";}catch(h){Q(c.h,"Can not get responseText: "+h.message),d="";}c=d||"";d=c.length-c.length%4;c=c.substr(b.o,d-b.o);if(c.length==0)return;b.o=d;c=$b(c);}else if(c.lastIndexOf("application/grpc",
1840
- 0)==0)c=new Uint8Array(Xb(b.g));else {W(b,new C(2,"Unknown Content-type received."));return}d=null;try{d=pa(b.A,c);}catch(h){W(b,new C(2,"Error in parsing response body"));}if(d)for(c=0;c<d.length;c++){if(qa in d[c]){var e=d[c][qa];if(e){var g=false;let h;try{h=b.v(e),g=!0;}catch(k){W(b,new C(13,`Error when deserializing response data; error: ${k}`+`, response: ${h}`));}if(g){e=b;g=h;for(var f=0;f<e.h.length;f++)e.h[f](g);}}}if(B in d[c]&&d[c][B].length>0){e="";for(g=0;g<d[c][B].length;g++)e+=String.fromCharCode(d[c][B][g]);
1841
- e=e.trim().split("\r\n");g={};for(f=0;f<e.length;f++){const h=e[f].indexOf(":");g[e[f].substring(0,h).trim()]=e[f].substring(h+1).trim();}e=g;g=0;f="";"grpc-status"in e&&(g=Number(e["grpc-status"]),delete e["grpc-status"]);"grpc-message"in e&&(f=e["grpc-message"],delete e["grpc-message"]);W(b,new C(g,f,e));}}}});cb(this.g,"complete",function(){var c=b.g.m,d=2,e="";const g={};d=Yb(b.g);const f={};for(var h in d)d.hasOwnProperty(h)&&(f[h.toLowerCase()]=d[h]);Object.keys(f).forEach(k=>{cc.includes(k)||
1842
- (g[k]=f[k]);});dc(b,g);h=-1;if(c!=0){switch(c){case 7:d=10;break;case 8:d=4;break;case 6:h=b.g.getStatus();d=xa(h);break;default:d=14;}d==10&&b.u||(e=ma(c),h!=-1&&(e+=", http status code: "+h),W(b,new C(d,e)));}else c=false,"grpc-status"in f&&(d=Number(f["grpc-status"]),"grpc-message"in f&&(e=f["grpc-message"]),d!=0&&(W(b,new C(d,e||"",f)),c=true)),c||ec(b);});}on(a,b){a=="data"?this.h.push(b):a=="status"?this.m.push(b):a=="metadata"?this.l.push(b):a=="end"?this.i.push(b):a=="error"&&this.j.push(b);return this}removeListener(a,
1843
- b){a=="data"?X(this.h,b):a=="status"?X(this.m,b):a=="metadata"?X(this.l,b):a=="end"?X(this.i,b):a=="error"&&X(this.j,b);return this}cancel(){this.u=true;this.g.abort();}}Y.prototype.cancel=Y.prototype.cancel;Y.prototype.removeListener=Y.prototype.removeListener;Y.prototype.on=Y.prototype.on;function fc(a){let b="";Ia(a,function(c,d){b+=d;b+=":";b+=c;b+="\r\n";});return b}function hc(a,b){return b.reduce((c,d)=>e=>d.intercept(e,c),a)}
1844
- function ic(a,b,c){let d=false,e=null,g=false;a.on("data",function(f){d=true;e=f;});a.on("error",function(f){f.code==0||g||(g=true,b(f,null));});a.on("status",function(f){f.code==0||g?c&&b(null,null,f):(g=true,b({code:f.code,message:f.details,metadata:f.metadata},null));});if(c)a.on("metadata",function(f){b(null,null,null,f);});a.on("end",function(){g||(d?c?b(null,e,null,null,true):b(null,e):b({code:2,message:"Incomplete response"}));c&&b(null,null);});}
1845
- function jc(a,b,c){var d=b.getMethodDescriptor(),e=c+d.getName();c=a.i?a.i:new R;c.O=a.j;const g=new Y({$:c});g.v=d.h;var f=b.getMetadata();for(var h in f)c.headers.set(h,f[h]);a.g=="text"?(c.headers.set("Content-Type","application/grpc-web-text"),c.headers.set("Accept","application/grpc-web-text")):c.headers.set("Content-Type","application/grpc-web+proto");c.headers.set("X-User-Agent","grpc-web-javascript/0.1");c.headers.set("X-Grpc-Web","1");c.headers.has("deadline")&&(h=Number(c.headers.get("deadline")),
1846
- h=Math.ceil(h-(new Date).getTime()),c.headers.delete("deadline"),h===Infinity&&(h=0),h>0&&(c.headers.set("grpc-timeout",h+"m"),c.u=Math.max(0,Math.max(1E3,Math.ceil(h*1.1)))));if(a.l){h=c.headers;f={};for(k of h.keys())f[k]=h.get(k);var k=f;c.headers.clear();b:{for(l in k){var l=false;break b}l=true;}if(!l)if(k=fc(k),typeof e==="string"){if(l=encodeURIComponent("$httpHeaders"),k=k!=null?"="+encodeURIComponent(String(k)):"",l+=k)k=e.indexOf("#"),k<0&&(k=e.length),h=e.indexOf("?"),h<0||h>k?(h=k,f=""):f=e.substring(h+
1847
- 1,k),e=[e.slice(0,h),f,e.slice(k)],k=e[1],e[1]=l?k?k+"&"+l:l:k,e=e[0]+(e[1]?"?"+e[1]:"")+e[2];}else e.g("$httpHeaders",k);}b=(0, d.g)(b.getRequestMessage());d=b.length;l=[0,0,0,0];k=new Uint8Array(5+d);for(h=3;h>=0;h--)l[h]=d%256,d>>>=8;k.set(new Uint8Array(l),1);k.set(b,5);b=k;if(a.g=="text"){a=b;var m;m===void 0&&(m=0);bc();m=Zb[m];b=Array(Math.floor(a.length/3));d=m[64]||"";for(l=k=0;k<a.length-2;k+=3){var z=a[k],A=a[k+1];f=a[k+2];h=m[z>>2];z=m[(z&3)<<4|A>>4];A=m[(A&15)<<2|f>>6];f=m[f&63];b[l++]=
1848
- h+z+A+f;}h=0;f=d;switch(a.length-k){case 2:h=a[k+1],f=m[(h&15)<<2]||d;case 1:a=a[k],b[l]=m[a>>2]+m[(a&3)<<4|h>>4]+f+d;}b=b.join("");}else a.g=="binary"&&(c.B="arraybuffer");Rb(c,e,b);return g}
1849
- function kc(a,b,c,d,e,g={}){const f=b.substr(0,b.length-e.name.length),h=g&&g.signal;return hc(k=>new Promise((l,m)=>{if(h&&h.aborted){const v=new C(1,"Aborted");v.cause=h.reason;m(v);}else {var z=jc(a,k,f),A,ib,jb;ic(z,(v,lc,kb,lb,mc)=>{v?m(v):mc?jb=lc:kb?ib=kb:lb?A=lb:l(ja(k.getMethodDescriptor(),jb,A,ib));},true);h&&h.addEventListener("abort",()=>{z.cancel();const v=new C(1,"Aborted");v.cause=h.reason;m(v);});}}),a.m).call(a,ia(e,c,d)).then(k=>k.getResponseMessage())}
1850
- class Z{constructor(a={},b){this.g=a.format||r("format",a)||"text";this.l=a.ca||r("suppressCorsPreflight",a)||false;this.j=a.withCredentials||r("withCredentials",a)||false;this.h=a.ba||r("streamInterceptors",a)||[];this.m=a.da||r("unaryInterceptors",a)||[];this.i=b||null;}Y(a,b,c,d,e){const g=a.substr(0,a.length-d.name.length);a=hc(f=>jc(this,f,g),this.h).call(this,ia(d,b,c));ic(a,e,false);return new la(a)}unaryCall(a,b,c,d,e={}){return kc(this,a,b,c,d,e)}Z(a,b,c,d){const e=a.substr(0,a.length-d.name.length);
1851
- return hc(g=>jc(this,g,e),this.h).call(this,ia(d,b,c))}}Z.prototype.serverStreaming=Z.prototype.Z;Z.prototype.unaryCall=Z.prototype.unaryCall;Z.prototype.rpcCall=Z.prototype.Y;grpcWeb.CallOptions=ea;grpcWeb.MethodDescriptor=ka;grpcWeb.GrpcWebClientBase=Z;grpcWeb.RpcError=C;grpcWeb.StatusCode={OK:0,CANCELLED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,UNAUTHENTICATED:16,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15};grpcWeb.MethodType={UNARY:"unary",SERVER_STREAMING:"server_streaming",BIDI_STREAMING:"bidi_streaming"};
1852
- rb=typeof globalThis!=="undefined"&&globalThis||self;
1853
- return grpcWeb;
1854
- }
1855
-
1856
- var grpcWebExports = requireGrpcWeb();
1870
+ var parallax_gateway_pbExports = requireParallax_gateway_pb();
1857
1871
 
1858
1872
  /**
1859
1873
  * @fileoverview gRPC-Web generated client stub for gateway.parallax.v1
@@ -1921,210 +1935,171 @@
1921
1935
  }
1922
1936
  }
1923
1937
 
1938
+ var status_pbExports = requireStatus_pb();
1939
+
1924
1940
  var timestamp_pbExports = requireTimestamp_pb();
1925
1941
 
1926
- // Parallax SDK Web Client
1927
- const GRPC_GATEWAY_API_URL = "https://parallax-gateway.dev.mirador.org:443";
1928
- const debugIssue = (trace, error) => {
1929
- // Handle our own debugging / logging here
1930
- console.error(`[ParallaxClient][${trace}] Error:`, error);
1931
- };
1932
- class ParallaxClient {
1933
- constructor(apiKey, apiUrl) {
1934
- Object.defineProperty(this, "apiKey", {
1935
- enumerable: true,
1936
- configurable: true,
1937
- writable: true,
1938
- value: apiKey
1939
- });
1940
- Object.defineProperty(this, "apiUrl", {
1941
- enumerable: true,
1942
- configurable: true,
1943
- writable: true,
1944
- value: GRPC_GATEWAY_API_URL
1945
- });
1946
- Object.defineProperty(this, "client", {
1947
- enumerable: true,
1948
- configurable: true,
1949
- writable: true,
1950
- value: void 0
1951
- });
1952
- if (apiUrl) {
1953
- this.apiUrl = apiUrl;
1954
- }
1955
- // Create credentials object with API key if provided
1956
- const credentials = apiKey ? { 'x-parallax-api-key': apiKey } : undefined;
1957
- // Initialize the gRPC-Web client
1958
- this.client = new ParallaxGatewayServiceClient(this.apiUrl, credentials);
1942
+ /**
1943
+ * Browser metadata collection utilities
1944
+ */
1945
+ /**
1946
+ * Detect browser name and version from user agent
1947
+ */
1948
+ function detectBrowser(ua) {
1949
+ if (ua.includes('Edg/')) {
1950
+ return {
1951
+ name: 'Edge',
1952
+ version: ua.match(/Edg\/(\d+(\.\d+)?)/)?.[1] || 'unknown',
1953
+ };
1959
1954
  }
1960
- /**
1961
- * Gather client metadata for traces/spans
1962
- * Returns a metadata object with client environment details
1963
- * This includes browser, OS, screen size, IP address, and more
1964
- * @returns metadata
1965
- */
1966
- async getClientMetadata() {
1967
- const metadata = {};
1968
- // Browser info
1969
- metadata.userAgent = navigator.userAgent;
1970
- metadata.platform = navigator.platform;
1971
- metadata.language = navigator.language;
1972
- // Screen info
1973
- metadata.screenWidth = window.screen.width.toString();
1974
- metadata.screenHeight = window.screen.height.toString();
1975
- metadata.viewportWidth = window.innerWidth.toString();
1976
- metadata.viewportHeight = window.innerHeight.toString();
1977
- // Try to get IP address (non-blocking)
1978
- // Note: This may be blocked by Content Security Policy (CSP)
1979
- // If blocked, the backend should capture IP from request headers instead
1980
- try {
1981
- // Use ipify API (simple and fast JSON response)
1982
- const ipResponse = await fetch('https://api.ipify.org?format=json');
1983
- if (ipResponse && ipResponse.ok) {
1984
- const data = await ipResponse.json();
1985
- if (data && data.ip) {
1986
- metadata.ip = data.ip;
1987
- }
1988
- else {
1989
- metadata.ip = 'client_unavailable';
1990
- }
1991
- }
1992
- else {
1993
- metadata.ip = 'client_unavailable';
1994
- }
1995
- }
1996
- catch (error) {
1997
- // IP lookup failed (CSP block, timeout, or network error)
1998
- // This is expected if CSP blocks external requests
1999
- // Backend should capture IP from request headers instead
2000
- if (error instanceof Error && error.message.includes('Content Security Policy')) {
2001
- console.debug('IP fetch blocked by CSP - backend will capture from headers');
2002
- }
2003
- else {
2004
- console.debug('Could not fetch IP address');
2005
- }
2006
- metadata.ip = 'client_unavailable';
2007
- }
2008
- // Browser details (parse from user agent)
2009
- const ua = navigator.userAgent;
2010
- if (ua.includes('Chrome')) {
2011
- metadata.browser = 'Chrome';
2012
- }
2013
- else if (ua.includes('Firefox')) {
2014
- metadata.browser = 'Firefox';
2015
- }
2016
- else if (ua.includes('Safari')) {
2017
- metadata.browser = 'Safari';
2018
- }
2019
- else if (ua.includes('Edge')) {
2020
- metadata.browser = 'Edge';
2021
- }
2022
- else {
2023
- metadata.browser = 'Unknown';
2024
- }
2025
- // OS detection
2026
- if (ua.includes('Windows')) {
2027
- metadata.os = 'Windows';
2028
- }
2029
- else if (ua.includes('Mac')) {
2030
- metadata.os = 'macOS';
2031
- }
2032
- else if (ua.includes('Linux')) {
2033
- metadata.os = 'Linux';
2034
- }
2035
- else if (ua.includes('Android')) {
2036
- metadata.os = 'Android';
2037
- }
2038
- else if (ua.includes('iOS')) {
2039
- metadata.os = 'iOS';
2040
- }
2041
- else {
2042
- metadata.os = 'Unknown';
2043
- }
2044
- // Timezone
2045
- metadata.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
2046
- metadata.timezoneOffset = new Date().getTimezoneOffset().toString();
2047
- // Page info
2048
- metadata.url = window.location.href;
2049
- metadata.referrer = document.referrer || 'direct';
2050
- return metadata;
1955
+ if (ua.includes('Chrome/')) {
1956
+ return {
1957
+ name: 'Chrome',
1958
+ version: ua.match(/Chrome\/(\d+(\.\d+)?)/)?.[1] || 'unknown',
1959
+ };
2051
1960
  }
2052
- /**
2053
- * Creates a CreateTraceRequest with optional attributes and client metadata
2054
- * @param name name of the trace
2055
- * @param tags optional tags for trace
2056
- * @param attr optional attributes for trace
2057
- * @param includeClientMeta optional flag to include client metadata (ip, browser, os, etc)
2058
- * @returns a CreateTraceRequest object to be used for the createTrace request
2059
- */
2060
- async createTraceRequest({ name, tags, attr, includeClientMeta = false }) {
2061
- const createTraceReq = new parallax_gateway_pbExports.CreateTraceRequest();
2062
- createTraceReq.setName(name);
2063
- if (tags) {
2064
- createTraceReq.setTagsList(tags);
2065
- }
2066
- const traceAttrs = createTraceReq.getAttributesMap();
2067
- if (attr) {
2068
- Object.entries(attr).forEach(([key, value]) => {
2069
- if (key.includes('client.')) {
2070
- console.warn(`Attribute key "${key}" is reserved for client metadata. It will be prefixed with "custom."`);
2071
- }
2072
- else {
2073
- traceAttrs.set(key, typeof value === 'object' ? JSON.stringify(value) : String(value));
2074
- }
2075
- });
2076
- }
2077
- if (includeClientMeta) {
2078
- const clientMetadata = await this.getClientMetadata();
2079
- Object.entries(clientMetadata).forEach(([key, value]) => {
2080
- traceAttrs.set(`client.${key}`, value);
2081
- });
2082
- }
2083
- return createTraceReq;
1961
+ if (ua.includes('Firefox/')) {
1962
+ return {
1963
+ name: 'Firefox',
1964
+ version: ua.match(/Firefox\/(\d+(\.\d+)?)/)?.[1] || 'unknown',
1965
+ };
2084
1966
  }
2085
- /**
2086
- * Create a new trace
2087
- * @param params Parameters to create a new trace
2088
- * @returns Response from the create trace operation
2089
- */
2090
- async createTrace(params) {
2091
- try {
2092
- return await this.client.createTrace(params, null);
1967
+ if (ua.includes('Safari/') && !ua.includes('Chrome')) {
1968
+ return {
1969
+ name: 'Safari',
1970
+ version: ua.match(/Version\/(\d+(\.\d+)?)/)?.[1] || 'unknown',
1971
+ };
1972
+ }
1973
+ return { name: 'Unknown', version: 'unknown' };
1974
+ }
1975
+ /**
1976
+ * Detect operating system name and version from user agent
1977
+ */
1978
+ function detectOS(ua) {
1979
+ if (ua.includes('Windows NT')) {
1980
+ const ntVersion = ua.match(/Windows NT (\d+\.\d+)/)?.[1];
1981
+ return {
1982
+ name: 'Windows',
1983
+ version: ntVersion === '10.0' ? '10/11' : ntVersion || 'unknown',
1984
+ };
1985
+ }
1986
+ if (ua.includes('Mac OS X')) {
1987
+ return {
1988
+ name: 'macOS',
1989
+ version: ua.match(/Mac OS X (\d+[._]\d+)/)?.[1]?.replace('_', '.') || 'unknown',
1990
+ };
1991
+ }
1992
+ if (ua.includes('Android')) {
1993
+ return {
1994
+ name: 'Android',
1995
+ version: ua.match(/Android (\d+(\.\d+)?)/)?.[1] || 'unknown',
1996
+ };
1997
+ }
1998
+ if (ua.includes('iPhone') || ua.includes('iPad')) {
1999
+ return {
2000
+ name: 'iOS',
2001
+ version: ua.match(/OS (\d+[._]\d+)/)?.[1]?.replace('_', '.') || 'unknown',
2002
+ };
2003
+ }
2004
+ if (ua.includes('Linux')) {
2005
+ return { name: 'Linux', version: 'unknown' };
2006
+ }
2007
+ return { name: 'Unknown', version: 'unknown' };
2008
+ }
2009
+ /**
2010
+ * Detect device type from user agent
2011
+ */
2012
+ function detectDeviceType(ua) {
2013
+ if (/Mobile|Android|iPhone|iPad|iPod/i.test(ua)) {
2014
+ return /iPad|Tablet/i.test(ua) ? 'tablet' : 'mobile';
2015
+ }
2016
+ return 'desktop';
2017
+ }
2018
+ /**
2019
+ * Gather client metadata from the browser environment
2020
+ * Note: IP address is captured by the backend from request headers
2021
+ */
2022
+ function getClientMetadata() {
2023
+ const metadata = {};
2024
+ const ua = navigator.userAgent;
2025
+ // Browser detection
2026
+ const browser = detectBrowser(ua);
2027
+ metadata.browser = browser.name;
2028
+ metadata.browserVersion = browser.version;
2029
+ // OS detection
2030
+ const os = detectOS(ua);
2031
+ metadata.os = os.name;
2032
+ metadata.osVersion = os.version;
2033
+ // Device type
2034
+ metadata.deviceType = detectDeviceType(ua);
2035
+ // Core browser info
2036
+ metadata.userAgent = ua;
2037
+ metadata.language = navigator.language;
2038
+ metadata.languages = navigator.languages?.join(',') || navigator.language;
2039
+ // Screen and display
2040
+ metadata.screenWidth = window.screen.width.toString();
2041
+ metadata.screenHeight = window.screen.height.toString();
2042
+ metadata.viewportWidth = window.innerWidth.toString();
2043
+ metadata.viewportHeight = window.innerHeight.toString();
2044
+ metadata.colorDepth = window.screen.colorDepth.toString();
2045
+ metadata.pixelRatio = window.devicePixelRatio?.toString() || '1';
2046
+ // Hardware capabilities
2047
+ metadata.cpuCores = navigator.hardwareConcurrency?.toString() || 'unknown';
2048
+ const nav = navigator;
2049
+ if (nav.deviceMemory) {
2050
+ metadata.deviceMemory = nav.deviceMemory.toString();
2051
+ }
2052
+ // Touch support
2053
+ metadata.touchSupport = ('ontouchstart' in window || navigator.maxTouchPoints > 0).toString();
2054
+ metadata.maxTouchPoints = navigator.maxTouchPoints?.toString() || '0';
2055
+ // Connection info (Network Information API - non-standard)
2056
+ const connection = navigator.connection;
2057
+ if (connection) {
2058
+ metadata.connectionType = connection.effectiveType || 'unknown';
2059
+ if (connection.downlink) {
2060
+ metadata.connectionSpeed = connection.downlink.toString();
2093
2061
  }
2094
- catch (_error) {
2095
- debugIssue("createTrace", new Error('Error creating trace'));
2096
- throw _error;
2062
+ if (connection.saveData !== undefined) {
2063
+ metadata.dataSaver = connection.saveData.toString();
2097
2064
  }
2098
2065
  }
2099
- /**
2100
- * Create a new trace builder
2101
- *
2102
- * Example usage:
2103
- * ```typescript
2104
- * const response = await client.trace("swap_execution")
2105
- * .addAttribute("user", "0xabc...")
2106
- * .addAttribute("slippage_bps", 25)
2107
- * .addTag("dex")
2108
- * .addTag("swap")
2109
- * .addEvent("wallet_connected", { wallet: "MetaMask" })
2110
- * .addEvent("quote_received")
2111
- * .submit("0x123...", "ethereum");
2112
- * ```
2113
- *
2114
- * @param name The name of the trace
2115
- * @param includeClientMeta Optional flag to automatically include client metadata
2116
- * @returns A ParallaxTrace builder instance
2117
- */
2118
- trace(name, includeClientMeta = false) {
2119
- return new ParallaxTrace(this, name, includeClientMeta);
2120
- }
2066
+ // Browser state
2067
+ metadata.cookiesEnabled = navigator.cookieEnabled.toString();
2068
+ metadata.online = navigator.onLine.toString();
2069
+ metadata.doNotTrack = navigator.doNotTrack || 'unspecified';
2070
+ // Timezone
2071
+ metadata.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
2072
+ metadata.timezoneOffset = new Date().getTimezoneOffset().toString();
2073
+ // Page context
2074
+ metadata.url = window.location.href;
2075
+ metadata.origin = window.location.origin;
2076
+ metadata.pathname = window.location.pathname;
2077
+ metadata.referrer = document.referrer || 'direct';
2078
+ // Document state
2079
+ metadata.documentVisibility = document.visibilityState;
2080
+ return metadata;
2121
2081
  }
2082
+
2083
+ /**
2084
+ * ParallaxTrace builder class for constructing traces with method chaining
2085
+ */
2086
+ /**
2087
+ * Maps chain names to proto Chain enum values
2088
+ */
2089
+ const CHAIN_MAP = {
2090
+ ethereum: parallax_gateway_pbExports.Chain.CHAIN_ETHEREUM,
2091
+ polygon: parallax_gateway_pbExports.Chain.CHAIN_POLYGON,
2092
+ arbitrum: parallax_gateway_pbExports.Chain.CHAIN_ARBITRUM,
2093
+ base: parallax_gateway_pbExports.Chain.CHAIN_BASE,
2094
+ optimism: parallax_gateway_pbExports.Chain.CHAIN_OPTIMISM,
2095
+ bsc: parallax_gateway_pbExports.Chain.CHAIN_BSC,
2096
+ };
2122
2097
  /**
2123
2098
  * Builder class for constructing traces with method chaining
2124
2099
  * Automatically handles web-specific features like client metadata
2125
2100
  */
2126
2101
  class ParallaxTrace {
2127
- constructor(client, name, includeClientMeta = false) {
2102
+ constructor(client, name = '', includeClientMeta = true) {
2128
2103
  Object.defineProperty(this, "name", {
2129
2104
  enumerable: true,
2130
2105
  configurable: true,
@@ -2174,21 +2149,27 @@
2174
2149
  /**
2175
2150
  * Add an attribute to the trace
2176
2151
  * @param key Attribute key
2177
- * @param value Attribute value (will be converted to string)
2152
+ * @param value Attribute value (objects are stringified, primitives converted to string)
2178
2153
  * @returns This trace builder for chaining
2179
2154
  */
2180
2155
  addAttribute(key, value) {
2181
- this.attributes[key] = String(value);
2156
+ this.attributes[key] =
2157
+ typeof value === 'object' && value !== null
2158
+ ? JSON.stringify(value)
2159
+ : String(value);
2182
2160
  return this;
2183
2161
  }
2184
2162
  /**
2185
2163
  * Add multiple attributes to the trace
2186
- * @param attributes Object containing key-value pairs
2164
+ * @param attributes Object containing key-value pairs (objects are stringified)
2187
2165
  * @returns This trace builder for chaining
2188
2166
  */
2189
2167
  addAttributes(attributes) {
2190
2168
  for (const [key, value] of Object.entries(attributes)) {
2191
- this.attributes[key] = String(value);
2169
+ this.attributes[key] =
2170
+ typeof value === 'object' && value !== null
2171
+ ? JSON.stringify(value)
2172
+ : String(value);
2192
2173
  }
2193
2174
  return this;
2194
2175
  }
@@ -2229,30 +2210,26 @@
2229
2210
  return this;
2230
2211
  }
2231
2212
  /**
2232
- * Set or update the transaction hash hint
2213
+ * Set the transaction hash hint for blockchain correlation
2233
2214
  * @param txHash Transaction hash
2234
- * @param chainId Chain ID (e.g., "ethereum", "polygon")
2215
+ * @param chain Chain name (e.g., "ethereum", "polygon", "base")
2235
2216
  * @param details Optional details about the transaction
2236
- * @param timestamp Optional timestamp (defaults to current time)
2237
2217
  * @returns This trace builder for chaining
2238
2218
  */
2239
- setTxHash(txHash, chainId, details, timestamp) {
2219
+ setTxHint(txHash, chain, details) {
2240
2220
  this.txHashHint = {
2241
2221
  txHash,
2242
- chainId,
2222
+ chain,
2243
2223
  details,
2244
- timestamp: timestamp || new Date(),
2224
+ timestamp: new Date(),
2245
2225
  };
2246
2226
  return this;
2247
2227
  }
2248
- async submit(txHash, chainId, details) {
2249
- // If txHash and chainId are provided in submit(), they override any previously set txHashHint
2250
- const finalTxHashHint = txHash && chainId ? {
2251
- txHash,
2252
- chainId,
2253
- details,
2254
- timestamp: new Date(),
2255
- } : this.txHashHint;
2228
+ /**
2229
+ * Create and submit the trace to the gateway
2230
+ * @returns The trace ID if successful, undefined if failed
2231
+ */
2232
+ async create() {
2256
2233
  // Build the CreateTraceRequest
2257
2234
  const request = new parallax_gateway_pbExports.CreateTraceRequest();
2258
2235
  request.setName(this.name);
@@ -2264,7 +2241,7 @@
2264
2241
  }
2265
2242
  // Add client metadata if requested
2266
2243
  if (this.includeClientMeta) {
2267
- const clientMetadata = await this.client.getClientMetadata();
2244
+ const clientMetadata = getClientMetadata();
2268
2245
  for (const [key, value] of Object.entries(clientMetadata)) {
2269
2246
  attrsMap.set(`client.${key}`, value);
2270
2247
  }
@@ -2272,8 +2249,8 @@
2272
2249
  // Add events
2273
2250
  const eventsList = [];
2274
2251
  for (const event of this.events) {
2275
- const eventMsg = new parallax_gateway_pbExports.CreateTraceRequest.Event();
2276
- eventMsg.setEventName(event.eventName);
2252
+ const eventMsg = new parallax_gateway_pbExports.Event();
2253
+ eventMsg.setName(event.eventName);
2277
2254
  if (event.details) {
2278
2255
  eventMsg.setDetails(event.details);
2279
2256
  }
@@ -2284,374 +2261,107 @@
2284
2261
  }
2285
2262
  request.setEventsList(eventsList);
2286
2263
  // Add transaction hash hint if present
2287
- if (finalTxHashHint) {
2288
- const txHint = new parallax_gateway_pbExports.CreateTraceRequest.TxHashHint();
2289
- txHint.setTxHash(finalTxHashHint.txHash);
2290
- txHint.setChainId(finalTxHashHint.chainId);
2291
- if (finalTxHashHint.details) {
2292
- txHint.setDetails(finalTxHashHint.details);
2264
+ if (this.txHashHint) {
2265
+ const txHint = new parallax_gateway_pbExports.TxHashHint();
2266
+ txHint.setTxHash(this.txHashHint.txHash);
2267
+ txHint.setChain(CHAIN_MAP[this.txHashHint.chain]);
2268
+ if (this.txHashHint.details) {
2269
+ txHint.setDetails(this.txHashHint.details);
2293
2270
  }
2294
2271
  const timestamp = new timestamp_pbExports.Timestamp();
2295
- timestamp.fromDate(finalTxHashHint.timestamp);
2272
+ timestamp.fromDate(this.txHashHint.timestamp);
2296
2273
  txHint.setTimestamp(timestamp);
2297
2274
  request.setTxHashHint(txHint);
2298
2275
  }
2299
- return this.client.createTrace(request);
2300
- }
2301
- }
2302
-
2303
- class GrpcWebRpc {
2304
- constructor(url, apiKey) {
2305
- Object.defineProperty(this, "url", {
2306
- enumerable: true,
2307
- configurable: true,
2308
- writable: true,
2309
- value: void 0
2310
- });
2311
- Object.defineProperty(this, "apiKey", {
2312
- enumerable: true,
2313
- configurable: true,
2314
- writable: true,
2315
- value: void 0
2316
- });
2317
- this.url = url;
2318
- this.apiKey = apiKey;
2319
- }
2320
- async request(service, method, data, metadata) {
2321
- console.log(`[gRPC-Web] Making request to ${this.url}/${service}/${method}`);
2322
- const headers = {
2323
- 'Content-Type': 'application/grpc-web+proto',
2324
- 'X-Grpc-Web': '1',
2325
- };
2326
- // Add API key to headers if provided
2327
- if (this.apiKey) {
2328
- headers['x-parallax-api-key'] = this.apiKey;
2329
- }
2330
- // Add custom metadata
2331
- if (metadata) {
2332
- Object.entries(metadata).forEach(([key, value]) => {
2333
- headers[key] = value;
2334
- });
2335
- }
2336
2276
  try {
2337
- const response = await fetch(`${this.url}/${service}/${method}`, {
2338
- method: 'POST',
2339
- headers,
2340
- body: data.buffer,
2341
- });
2342
- if (!response.ok) {
2343
- const errorText = await response.text();
2344
- throw new Error(`gRPC-Web error: ${response.status} ${response.statusText} - ${errorText}`);
2277
+ const response = await this.client._sendTrace(request);
2278
+ const responseStatus = response.getStatus();
2279
+ if (responseStatus?.getCode() !== status_pbExports.ResponseStatus.StatusCode.STATUS_CODE_SUCCESS) {
2280
+ console.log('[ParallaxTrace] Error:', responseStatus?.getErrorMessage() || 'Unknown error');
2281
+ return undefined;
2345
2282
  }
2346
- const arrayBuffer = await response.arrayBuffer();
2347
- console.log(`[gRPC-Web] Success from ${this.url}/${service}/${method}`);
2348
- return new Uint8Array(arrayBuffer);
2283
+ return response.getTraceId();
2349
2284
  }
2350
2285
  catch (error) {
2351
- console.error(`[gRPC-Web] Error from ${this.url}/${service}/${method}:`, error instanceof Error ? error.message : String(error));
2352
- throw error;
2286
+ console.log('[ParallaxTrace] Error creating trace:', error);
2287
+ return undefined;
2353
2288
  }
2354
2289
  }
2355
- clientStreamingRequest() {
2356
- throw new Error("Client streaming not yet implemented for gRPC-Web");
2357
- }
2358
- serverStreamingRequest(service, method, data) {
2359
- return new rxjs.Observable((subscriber) => {
2360
- const headers = {
2361
- 'Content-Type': 'application/grpc-web+proto',
2362
- 'X-Grpc-Web': '1',
2363
- };
2364
- // Add API key to headers if provided
2365
- if (this.apiKey) {
2366
- headers['x-parallax-api-key'] = this.apiKey;
2367
- }
2368
- fetch(`${this.url}/${service}/${method}`, {
2369
- method: 'POST',
2370
- headers,
2371
- body: data.buffer,
2372
- })
2373
- .then(async (response) => {
2374
- if (!response.ok) {
2375
- throw new Error(`gRPC-Web error: ${response.status} ${response.statusText}`);
2376
- }
2377
- if (!response.body) {
2378
- throw new Error('Response body is null');
2379
- }
2380
- const reader = response.body.getReader();
2381
- try {
2382
- while (true) {
2383
- const { done, value } = await reader.read();
2384
- if (done) {
2385
- subscriber.complete();
2386
- break;
2387
- }
2388
- if (value) {
2389
- subscriber.next(value);
2390
- }
2391
- }
2392
- }
2393
- catch (error) {
2394
- subscriber.error(error);
2395
- }
2396
- })
2397
- .catch((error) => {
2398
- subscriber.error(error);
2399
- });
2400
- return () => {
2401
- // Cleanup logic if needed
2402
- };
2403
- });
2404
- }
2405
- bidirectionalStreamingRequest() {
2406
- throw new Error("Bidirectional streaming not yet implemented for gRPC-Web");
2407
- }
2408
2290
  }
2409
2291
 
2292
+ const DEFAULT_API_URL = 'https://parallax-gateway.dev.mirador.org:443';
2410
2293
  /**
2411
- * Parallax Service - Transaction Tracing for Web Applications
2412
- * Creates individual traces for each transaction and tracks them through their lifecycle
2413
- *
2414
- * This service provides a simplified interface for tracking transactions with automatic
2415
- * client metadata collection and lifecycle management.
2294
+ * Main client for interacting with the Parallax Gateway API
2416
2295
  */
2417
- class ParallaxService {
2418
- constructor() {
2419
- Object.defineProperty(this, "client", {
2296
+ class ParallaxClient {
2297
+ /**
2298
+ * Create a new ParallaxClient instance
2299
+ * @param apiKey Required API key for authentication (sent as x-parallax-api-key header)
2300
+ * @param apiUrl Optional gateway URL (defaults to parallax-gateway.dev.mirador.org:443)
2301
+ */
2302
+ constructor(apiKey, apiUrl) {
2303
+ Object.defineProperty(this, "apiUrl", {
2420
2304
  enumerable: true,
2421
2305
  configurable: true,
2422
2306
  writable: true,
2423
- value: null
2307
+ value: void 0
2424
2308
  });
2425
- Object.defineProperty(this, "activeTransactions", {
2309
+ Object.defineProperty(this, "apiKey", {
2426
2310
  enumerable: true,
2427
2311
  configurable: true,
2428
2312
  writable: true,
2429
- value: new Map()
2313
+ value: void 0
2430
2314
  });
2431
- // Client will be initialized lazily
2432
- }
2433
- /**
2434
- * Initialize the Parallax client (lazy initialization)
2435
- * @param apiKey - Optional API key for authentication
2436
- * @param gatewayUrl - Optional custom gateway URL
2437
- */
2438
- _ensureClient(apiKey, gatewayUrl) {
2439
- if (this.client)
2440
- return;
2441
- // Determine gateway URL based on environment if not provided
2442
- let url = gatewayUrl;
2443
- if (!url && typeof window !== 'undefined') {
2444
- const isDevelopment = window.location.hostname === 'localhost' ||
2445
- window.location.hostname === '127.0.0.1';
2446
- url = isDevelopment
2447
- ? `${window.location.protocol}//${window.location.host}/parallax-gateway`
2448
- : 'https://gateway-parallax-dev.mirador.org';
2449
- }
2450
- this.client = new ParallaxClient(apiKey || '', url);
2451
- console.log('[ParallaxService] Client initialized with URL:', url);
2452
- }
2453
- /**
2454
- * Start a new transaction trace
2455
- * Called when user initiates a transaction
2456
- *
2457
- * Uses the builder pattern to create a trace with events
2458
- *
2459
- * @param txData - Transaction data
2460
- * @param name - Name for the trace (e.g., 'SendingTrace', 'SwappingTrace')
2461
- * @param options - Optional configuration (apiKey, gatewayUrl, includeClientMeta)
2462
- * @returns Promise with traceId, rootSpanId, and txId
2463
- */
2464
- async startTransactionTrace(txData, name = 'WalletTransaction', options) {
2465
- this._ensureClient(options?.apiKey, options?.gatewayUrl);
2466
- if (!this.client) {
2467
- throw new Error('Failed to initialize Parallax client');
2468
- }
2469
- try {
2470
- const txId = `tx_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
2471
- const timestamp = new Date();
2472
- // Build the trace using the builder pattern
2473
- const builder = this.client
2474
- .trace(name, options?.includeClientMeta ?? true)
2475
- .addAttribute('transactionId', txId)
2476
- .addAttribute('walletAddress', txData.walletAddress || txData.from)
2477
- .addAttribute('network', txData.network || 'Unknown')
2478
- .addAttribute('transactionStart', timestamp.toISOString())
2479
- .addAttribute('from', txData.from)
2480
- .addAttribute('to', txData.to)
2481
- .addAttribute('value', txData.value)
2482
- .addTags(['transaction', 'wallet', txData.network || 'unknown'])
2483
- .addEvent('transaction_initiated', {
2484
- from: txData.from,
2485
- to: txData.to,
2486
- value: txData.value,
2487
- timestamp: timestamp.toISOString(),
2488
- });
2489
- // Add any additional transaction data as attributes
2490
- if (txData.additionalData) {
2491
- Object.entries(txData.additionalData).forEach(([key, value]) => {
2492
- builder.addAttribute(key, typeof value === 'object' ? JSON.stringify(value) : String(value));
2493
- });
2494
- }
2495
- // Submit the trace
2496
- const traceResponse = await builder.submit();
2497
- const traceId = traceResponse.getTraceId();
2498
- // Store transaction info
2499
- this.activeTransactions.set(txId, {
2500
- traceId,
2501
- timestamp: timestamp.toISOString(),
2502
- txHash: null,
2503
- from: txData.from,
2504
- to: txData.to,
2505
- network: txData.network,
2506
- });
2507
- console.log('[ParallaxService] Transaction trace started:', {
2508
- txId,
2509
- traceId,
2510
- from: txData.from,
2511
- to: txData.to,
2512
- });
2513
- return { traceId, rootSpanId: traceId, txId };
2514
- }
2515
- catch (error) {
2516
- console.error('[ParallaxService] Failed to start transaction trace:', error);
2517
- throw error;
2518
- }
2519
- }
2520
- /**
2521
- * Associate a transaction hash with an existing trace
2522
- * Called when the transaction hash is available after signing/sending
2523
- *
2524
- * NOTE: This method is deprecated as the new API does not support adding hints to existing traces.
2525
- * Transaction hashes should be provided at trace creation time via the builder's submit(txHash, chainId) method.
2526
- *
2527
- * @param txId - Transaction identifier returned from startTransactionTrace
2528
- * @param txHash - Blockchain transaction hash
2529
- * @param chainId - Chain ID
2530
- * @deprecated Use submit(txHash, chainId) when creating the trace instead
2531
- */
2532
- async associateTransactionHash(txId, txHash, chainId) {
2533
- const txInfo = this.activeTransactions.get(txId);
2534
- if (!txInfo) {
2535
- console.warn(`[ParallaxService] Transaction ${txId} not found in active transactions`);
2536
- return;
2537
- }
2538
- // Update stored tx info
2539
- txInfo.txHash = txHash;
2540
- this.activeTransactions.set(txId, txInfo);
2541
- console.warn('[ParallaxService] associateTransactionHash is deprecated. The new API does not support adding transaction hashes after trace creation. Please provide the txHash when creating the trace using submit(txHash, chainId).');
2542
- console.log('[ParallaxService] Transaction hash updated in local cache:', {
2543
- txId,
2544
- txHash,
2545
- traceId: txInfo.traceId,
2315
+ Object.defineProperty(this, "client", {
2316
+ enumerable: true,
2317
+ configurable: true,
2318
+ writable: true,
2319
+ value: void 0
2546
2320
  });
2321
+ this.apiKey = apiKey;
2322
+ this.apiUrl = apiUrl || DEFAULT_API_URL;
2323
+ // API key is required - always include in credentials
2324
+ const credentials = { 'x-parallax-api-key': apiKey };
2325
+ // Initialize the gRPC-Web client
2326
+ this.client = new ParallaxGatewayServiceClient(this.apiUrl, credentials);
2547
2327
  }
2548
2328
  /**
2549
- * Add an event to a transaction trace
2550
- *
2551
- * NOTE: This method is deprecated as the new API does not support adding events to existing traces.
2552
- * Events should be added to the trace builder before calling submit().
2553
- *
2554
- * @param txId - Transaction identifier
2555
- * @param eventName - Event name
2556
- * @param attributes - Event attributes
2557
- * @deprecated Use the trace builder's addEvent() method before calling submit() instead
2558
- */
2559
- async addTransactionEvent(txId, eventName, attributes = {}) {
2560
- const txInfo = this.activeTransactions.get(txId);
2561
- if (!txInfo) {
2562
- console.warn(`[ParallaxService] Transaction ${txId} not found. Cannot add event '${eventName}'`);
2563
- return;
2564
- }
2565
- console.warn('[ParallaxService] addTransactionEvent is deprecated. The new API does not support adding events after trace creation. Events should be added using the builder pattern before calling submit().');
2566
- }
2567
- /**
2568
- * Add an error to a transaction trace
2569
- *
2570
- * NOTE: This method is deprecated as the new API does not support adding errors to existing traces.
2571
- * Errors should be added as events to the trace builder before calling submit().
2572
- *
2573
- * @param txId - Transaction identifier
2574
- * @param error - Error object or message
2575
- * @param errorType - Type/category of error (e.g., 'TransactionError', 'NetworkError', 'UserRejection')
2576
- * @deprecated Use the trace builder's addEvent() method to add error events before calling submit() instead
2577
- */
2578
- async addTransactionError(txId, error, errorType = 'TransactionError') {
2579
- const txInfo = this.activeTransactions.get(txId);
2580
- if (!txInfo) {
2581
- console.warn(`[ParallaxService] Transaction ${txId} not found. Cannot add error.`);
2582
- return;
2583
- }
2584
- console.warn('[ParallaxService] addTransactionError is deprecated. The new API does not support adding errors after trace creation. Add error events using the builder pattern before calling submit().');
2585
- }
2586
- /**
2587
- * Finish a transaction trace
2588
- *
2589
- * NOTE: This method is deprecated as the new API does not support span lifecycle management.
2590
- * Traces are completed when submit() is called on the builder.
2591
- *
2592
- * @param txId - Transaction identifier
2593
- * @param options - Finish options (success, error message)
2594
- * @deprecated Traces are automatically completed when submit() is called
2329
+ * Internal method to send trace to gateway
2330
+ * @internal
2595
2331
  */
2596
- async finishTransactionTrace(txId, options = { success: true }) {
2597
- const txInfo = this.activeTransactions.get(txId);
2598
- if (!txInfo) {
2599
- console.warn(`[ParallaxService] Transaction ${txId} not found. Cannot finish.`);
2600
- return;
2601
- }
2602
- console.warn('[ParallaxService] finishTransactionTrace is deprecated. The new API does not support span lifecycle. Traces are completed when submit() is called.');
2603
- console.log('[ParallaxService] Transaction trace marked as finished (local only):', {
2604
- txId,
2605
- traceId: txInfo.traceId,
2606
- success: options.success,
2607
- txHash: txInfo.txHash,
2608
- });
2609
- // Remove from active transactions
2610
- this.activeTransactions.delete(txId);
2332
+ async _sendTrace(request) {
2333
+ const metadata = { 'x-parallax-api-key': this.apiKey };
2334
+ return await this.client.createTrace(request, metadata);
2611
2335
  }
2612
2336
  /**
2613
- * Get info about an active transaction
2337
+ * Create a new trace builder
2614
2338
  *
2615
- * @param txId - Transaction identifier
2616
- * @returns Transaction info or null if not found
2617
- */
2618
- getTransactionInfo(txId) {
2619
- return this.activeTransactions.get(txId) || null;
2620
- }
2621
- /**
2622
- * Get all active transactions
2339
+ * Example usage:
2340
+ * ```typescript
2341
+ * const response = await client.trace("swap_execution")
2342
+ * .addAttribute("user", "0xabc...")
2343
+ * .addAttribute("slippage_bps", 25)
2344
+ * .addTag("dex")
2345
+ * .addTag("swap")
2346
+ * .addEvent("wallet_connected", { wallet: "MetaMask" })
2347
+ * .addEvent("quote_received")
2348
+ * .setTxHint("0x123...", "ethereum")
2349
+ * .create();
2350
+ * ```
2623
2351
  *
2624
- * @returns Array of active transaction info
2625
- */
2626
- getAllActiveTransactions() {
2627
- return Array.from(this.activeTransactions.entries()).map(([txId, info]) => ({
2628
- txId,
2629
- ...info,
2630
- }));
2631
- }
2632
- /**
2633
- * Get the ParallaxClient instance for advanced usage
2634
- * @param apiKey - Optional API key
2635
- * @param gatewayUrl - Optional gateway URL
2352
+ * @param name Optional name of the trace (defaults to empty string)
2353
+ * @param includeClientMeta Optional flag to automatically include client metadata
2354
+ * @returns A ParallaxTrace builder instance
2636
2355
  */
2637
- getClient(apiKey, gatewayUrl) {
2638
- this._ensureClient(apiKey, gatewayUrl);
2639
- if (!this.client) {
2640
- throw new Error('Failed to initialize Parallax client');
2641
- }
2642
- return this.client;
2356
+ trace(name = '', includeClientMeta = true) {
2357
+ return new ParallaxTrace(this, name, includeClientMeta);
2643
2358
  }
2644
2359
  }
2645
- // Export singleton instance
2646
- const parallaxService = new ParallaxService();
2647
2360
 
2648
2361
  exports.CreateTraceRequest = parallax_gateway_pbExports.CreateTraceRequest;
2649
2362
  exports.CreateTraceResponse = parallax_gateway_pbExports.CreateTraceResponse;
2650
- exports.GrpcWebRpc = GrpcWebRpc;
2651
2363
  exports.ParallaxClient = ParallaxClient;
2652
- exports.ParallaxService = ParallaxService;
2653
2364
  exports.ParallaxTrace = ParallaxTrace;
2654
- exports.parallaxService = parallaxService;
2655
2365
 
2656
2366
  }));
2657
2367
  //# sourceMappingURL=index.umd.js.map