@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/.claude/settings.local.json +15 -0
- package/.github/dependabot.yml +39 -0
- package/.github/workflows/pr.yml +33 -0
- package/README.md +145 -280
- package/dist/index.d.ts +56 -214
- package/dist/index.esm.js +760 -1049
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +764 -1054
- package/dist/index.umd.js.map +1 -1
- package/index.ts +2 -5
- package/package.json +4 -2
- package/scripts/release.sh +109 -0
- package/src/index.ts +2 -0
- package/src/parallax/client.ts +66 -0
- package/src/parallax/index.ts +22 -372
- package/src/parallax/metadata.ts +173 -0
- package/src/parallax/trace.ts +209 -0
- package/src/parallax/types.ts +73 -0
- package/tests/parallax.test.ts +395 -372
- package/src/grpc/index.ts +0 -155
- package/src/helpers/index.ts +0 -13
- package/src/parallax/ParallaxService.ts +0 -296
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,66 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
|
|
3
1
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
2
|
|
|
3
|
+
var grpcWeb = {};
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
|
|
7
|
+
Copyright The Closure Library Authors.
|
|
8
|
+
SPDX-License-Identifier: Apache-2.0
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
var hasRequiredGrpcWeb;
|
|
12
|
+
|
|
13
|
+
function requireGrpcWeb () {
|
|
14
|
+
if (hasRequiredGrpcWeb) return grpcWeb;
|
|
15
|
+
hasRequiredGrpcWeb = 1;
|
|
16
|
+
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)}
|
|
17
|
+
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)}
|
|
18
|
+
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]);
|
|
19
|
+
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}}
|
|
20
|
+
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";
|
|
21
|
+
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"});
|
|
22
|
+
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||
|
|
23
|
+
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);};
|
|
24
|
+
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--));}}
|
|
25
|
+
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);}
|
|
26
|
+
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.");}}
|
|
27
|
+
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));}
|
|
28
|
+
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}
|
|
29
|
+
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);};
|
|
30
|
+
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;}
|
|
31
|
+
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;}
|
|
32
|
+
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}
|
|
33
|
+
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"];
|
|
34
|
+
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
|
|
35
|
+
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: "+
|
|
36
|
+
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"));}
|
|
37
|
+
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);};
|
|
38
|
+
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,
|
|
39
|
+
-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);}}}
|
|
40
|
+
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}};
|
|
41
|
+
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}}
|
|
42
|
+
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}
|
|
43
|
+
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));}}
|
|
44
|
+
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);}
|
|
45
|
+
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",
|
|
46
|
+
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]);
|
|
47
|
+
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)||
|
|
48
|
+
(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,
|
|
49
|
+
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)}
|
|
50
|
+
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);});}
|
|
51
|
+
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")),
|
|
52
|
+
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+
|
|
53
|
+
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++]=
|
|
54
|
+
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}
|
|
55
|
+
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())}
|
|
56
|
+
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);
|
|
57
|
+
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"};
|
|
58
|
+
rb=typeof globalThis!=="undefined"&&globalThis||self;
|
|
59
|
+
return grpcWeb;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
var grpcWebExports = requireGrpcWeb();
|
|
63
|
+
|
|
5
64
|
var parallax_gateway_pb = {};
|
|
6
65
|
|
|
7
66
|
var googleProtobuf = {};
|
|
@@ -702,10 +761,11 @@ function requireParallax_gateway_pb () {
|
|
|
702
761
|
goog.object.extend(proto, google_protobuf_timestamp_pb);
|
|
703
762
|
var proto_common_v1_status_pb = requireStatus_pb();
|
|
704
763
|
goog.object.extend(proto, proto_common_v1_status_pb);
|
|
764
|
+
goog.exportSymbol('proto.gateway.parallax.v1.Chain', null, global);
|
|
705
765
|
goog.exportSymbol('proto.gateway.parallax.v1.CreateTraceRequest', null, global);
|
|
706
|
-
goog.exportSymbol('proto.gateway.parallax.v1.CreateTraceRequest.Event', null, global);
|
|
707
|
-
goog.exportSymbol('proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint', null, global);
|
|
708
766
|
goog.exportSymbol('proto.gateway.parallax.v1.CreateTraceResponse', null, global);
|
|
767
|
+
goog.exportSymbol('proto.gateway.parallax.v1.Event', null, global);
|
|
768
|
+
goog.exportSymbol('proto.gateway.parallax.v1.TxHashHint', null, global);
|
|
709
769
|
/**
|
|
710
770
|
* Generated by JsPbCodeGenerator.
|
|
711
771
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
@@ -737,16 +797,16 @@ function requireParallax_gateway_pb () {
|
|
|
737
797
|
* @extends {jspb.Message}
|
|
738
798
|
* @constructor
|
|
739
799
|
*/
|
|
740
|
-
proto.gateway.parallax.v1.
|
|
800
|
+
proto.gateway.parallax.v1.CreateTraceResponse = function(opt_data) {
|
|
741
801
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
742
802
|
};
|
|
743
|
-
goog.inherits(proto.gateway.parallax.v1.
|
|
803
|
+
goog.inherits(proto.gateway.parallax.v1.CreateTraceResponse, jspb.Message);
|
|
744
804
|
if (goog.DEBUG && !COMPILED) {
|
|
745
805
|
/**
|
|
746
806
|
* @public
|
|
747
807
|
* @override
|
|
748
808
|
*/
|
|
749
|
-
proto.gateway.parallax.v1.
|
|
809
|
+
proto.gateway.parallax.v1.CreateTraceResponse.displayName = 'proto.gateway.parallax.v1.CreateTraceResponse';
|
|
750
810
|
}
|
|
751
811
|
/**
|
|
752
812
|
* Generated by JsPbCodeGenerator.
|
|
@@ -758,16 +818,16 @@ function requireParallax_gateway_pb () {
|
|
|
758
818
|
* @extends {jspb.Message}
|
|
759
819
|
* @constructor
|
|
760
820
|
*/
|
|
761
|
-
proto.gateway.parallax.v1.
|
|
821
|
+
proto.gateway.parallax.v1.TxHashHint = function(opt_data) {
|
|
762
822
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
763
823
|
};
|
|
764
|
-
goog.inherits(proto.gateway.parallax.v1.
|
|
824
|
+
goog.inherits(proto.gateway.parallax.v1.TxHashHint, jspb.Message);
|
|
765
825
|
if (goog.DEBUG && !COMPILED) {
|
|
766
826
|
/**
|
|
767
827
|
* @public
|
|
768
828
|
* @override
|
|
769
829
|
*/
|
|
770
|
-
proto.gateway.parallax.v1.
|
|
830
|
+
proto.gateway.parallax.v1.TxHashHint.displayName = 'proto.gateway.parallax.v1.TxHashHint';
|
|
771
831
|
}
|
|
772
832
|
/**
|
|
773
833
|
* Generated by JsPbCodeGenerator.
|
|
@@ -779,16 +839,16 @@ function requireParallax_gateway_pb () {
|
|
|
779
839
|
* @extends {jspb.Message}
|
|
780
840
|
* @constructor
|
|
781
841
|
*/
|
|
782
|
-
proto.gateway.parallax.v1.
|
|
842
|
+
proto.gateway.parallax.v1.Event = function(opt_data) {
|
|
783
843
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
784
844
|
};
|
|
785
|
-
goog.inherits(proto.gateway.parallax.v1.
|
|
845
|
+
goog.inherits(proto.gateway.parallax.v1.Event, jspb.Message);
|
|
786
846
|
if (goog.DEBUG && !COMPILED) {
|
|
787
847
|
/**
|
|
788
848
|
* @public
|
|
789
849
|
* @override
|
|
790
850
|
*/
|
|
791
|
-
proto.gateway.parallax.v1.
|
|
851
|
+
proto.gateway.parallax.v1.Event.displayName = 'proto.gateway.parallax.v1.Event';
|
|
792
852
|
}
|
|
793
853
|
|
|
794
854
|
/**
|
|
@@ -833,8 +893,8 @@ function requireParallax_gateway_pb () {
|
|
|
833
893
|
attributesMap: (f = msg.getAttributesMap()) ? f.toObject(includeInstance, undefined) : [],
|
|
834
894
|
tagsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f,
|
|
835
895
|
eventsList: jspb.Message.toObjectList(msg.getEventsList(),
|
|
836
|
-
proto.gateway.parallax.v1.
|
|
837
|
-
txHashHint: (f = msg.getTxHashHint()) && proto.gateway.parallax.v1.
|
|
896
|
+
proto.gateway.parallax.v1.Event.toObject, includeInstance),
|
|
897
|
+
txHashHint: (f = msg.getTxHashHint()) && proto.gateway.parallax.v1.TxHashHint.toObject(includeInstance, f)
|
|
838
898
|
};
|
|
839
899
|
|
|
840
900
|
if (includeInstance) {
|
|
@@ -886,13 +946,13 @@ function requireParallax_gateway_pb () {
|
|
|
886
946
|
msg.addTags(value);
|
|
887
947
|
break;
|
|
888
948
|
case 4:
|
|
889
|
-
var value = new proto.gateway.parallax.v1.
|
|
890
|
-
reader.readMessage(value,proto.gateway.parallax.v1.
|
|
949
|
+
var value = new proto.gateway.parallax.v1.Event;
|
|
950
|
+
reader.readMessage(value,proto.gateway.parallax.v1.Event.deserializeBinaryFromReader);
|
|
891
951
|
msg.addEvents(value);
|
|
892
952
|
break;
|
|
893
953
|
case 5:
|
|
894
|
-
var value = new proto.gateway.parallax.v1.
|
|
895
|
-
reader.readMessage(value,proto.gateway.parallax.v1.
|
|
954
|
+
var value = new proto.gateway.parallax.v1.TxHashHint;
|
|
955
|
+
reader.readMessage(value,proto.gateway.parallax.v1.TxHashHint.deserializeBinaryFromReader);
|
|
896
956
|
msg.setTxHashHint(value);
|
|
897
957
|
break;
|
|
898
958
|
default:
|
|
@@ -947,7 +1007,7 @@ function requireParallax_gateway_pb () {
|
|
|
947
1007
|
writer.writeRepeatedMessage(
|
|
948
1008
|
4,
|
|
949
1009
|
f,
|
|
950
|
-
proto.gateway.parallax.v1.
|
|
1010
|
+
proto.gateway.parallax.v1.Event.serializeBinaryToWriter
|
|
951
1011
|
);
|
|
952
1012
|
}
|
|
953
1013
|
f = message.getTxHashHint();
|
|
@@ -955,12 +1015,165 @@ function requireParallax_gateway_pb () {
|
|
|
955
1015
|
writer.writeMessage(
|
|
956
1016
|
5,
|
|
957
1017
|
f,
|
|
958
|
-
proto.gateway.parallax.v1.
|
|
1018
|
+
proto.gateway.parallax.v1.TxHashHint.serializeBinaryToWriter
|
|
959
1019
|
);
|
|
960
1020
|
}
|
|
961
1021
|
};
|
|
962
1022
|
|
|
963
1023
|
|
|
1024
|
+
/**
|
|
1025
|
+
* optional string name = 1;
|
|
1026
|
+
* @return {string}
|
|
1027
|
+
*/
|
|
1028
|
+
proto.gateway.parallax.v1.CreateTraceRequest.prototype.getName = function() {
|
|
1029
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
1030
|
+
};
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
/**
|
|
1034
|
+
* @param {string} value
|
|
1035
|
+
* @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
|
|
1036
|
+
*/
|
|
1037
|
+
proto.gateway.parallax.v1.CreateTraceRequest.prototype.setName = function(value) {
|
|
1038
|
+
return jspb.Message.setProto3StringField(this, 1, value);
|
|
1039
|
+
};
|
|
1040
|
+
|
|
1041
|
+
|
|
1042
|
+
/**
|
|
1043
|
+
* map<string, string> attributes = 2;
|
|
1044
|
+
* @param {boolean=} opt_noLazyCreate Do not create the map if
|
|
1045
|
+
* empty, instead returning `undefined`
|
|
1046
|
+
* @return {!jspb.Map<string,string>}
|
|
1047
|
+
*/
|
|
1048
|
+
proto.gateway.parallax.v1.CreateTraceRequest.prototype.getAttributesMap = function(opt_noLazyCreate) {
|
|
1049
|
+
return /** @type {!jspb.Map<string,string>} */ (
|
|
1050
|
+
jspb.Message.getMapField(this, 2, opt_noLazyCreate,
|
|
1051
|
+
null));
|
|
1052
|
+
};
|
|
1053
|
+
|
|
1054
|
+
|
|
1055
|
+
/**
|
|
1056
|
+
* Clears values from the map. The map will be non-null.
|
|
1057
|
+
* @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
|
|
1058
|
+
*/
|
|
1059
|
+
proto.gateway.parallax.v1.CreateTraceRequest.prototype.clearAttributesMap = function() {
|
|
1060
|
+
this.getAttributesMap().clear();
|
|
1061
|
+
return this;
|
|
1062
|
+
};
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
/**
|
|
1066
|
+
* repeated string tags = 3;
|
|
1067
|
+
* @return {!Array<string>}
|
|
1068
|
+
*/
|
|
1069
|
+
proto.gateway.parallax.v1.CreateTraceRequest.prototype.getTagsList = function() {
|
|
1070
|
+
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 3));
|
|
1071
|
+
};
|
|
1072
|
+
|
|
1073
|
+
|
|
1074
|
+
/**
|
|
1075
|
+
* @param {!Array<string>} value
|
|
1076
|
+
* @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
|
|
1077
|
+
*/
|
|
1078
|
+
proto.gateway.parallax.v1.CreateTraceRequest.prototype.setTagsList = function(value) {
|
|
1079
|
+
return jspb.Message.setField(this, 3, value || []);
|
|
1080
|
+
};
|
|
1081
|
+
|
|
1082
|
+
|
|
1083
|
+
/**
|
|
1084
|
+
* @param {string} value
|
|
1085
|
+
* @param {number=} opt_index
|
|
1086
|
+
* @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
|
|
1087
|
+
*/
|
|
1088
|
+
proto.gateway.parallax.v1.CreateTraceRequest.prototype.addTags = function(value, opt_index) {
|
|
1089
|
+
return jspb.Message.addToRepeatedField(this, 3, value, opt_index);
|
|
1090
|
+
};
|
|
1091
|
+
|
|
1092
|
+
|
|
1093
|
+
/**
|
|
1094
|
+
* Clears the list making it empty but non-null.
|
|
1095
|
+
* @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
|
|
1096
|
+
*/
|
|
1097
|
+
proto.gateway.parallax.v1.CreateTraceRequest.prototype.clearTagsList = function() {
|
|
1098
|
+
return this.setTagsList([]);
|
|
1099
|
+
};
|
|
1100
|
+
|
|
1101
|
+
|
|
1102
|
+
/**
|
|
1103
|
+
* repeated Event events = 4;
|
|
1104
|
+
* @return {!Array<!proto.gateway.parallax.v1.Event>}
|
|
1105
|
+
*/
|
|
1106
|
+
proto.gateway.parallax.v1.CreateTraceRequest.prototype.getEventsList = function() {
|
|
1107
|
+
return /** @type{!Array<!proto.gateway.parallax.v1.Event>} */ (
|
|
1108
|
+
jspb.Message.getRepeatedWrapperField(this, proto.gateway.parallax.v1.Event, 4));
|
|
1109
|
+
};
|
|
1110
|
+
|
|
1111
|
+
|
|
1112
|
+
/**
|
|
1113
|
+
* @param {!Array<!proto.gateway.parallax.v1.Event>} value
|
|
1114
|
+
* @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
|
|
1115
|
+
*/
|
|
1116
|
+
proto.gateway.parallax.v1.CreateTraceRequest.prototype.setEventsList = function(value) {
|
|
1117
|
+
return jspb.Message.setRepeatedWrapperField(this, 4, value);
|
|
1118
|
+
};
|
|
1119
|
+
|
|
1120
|
+
|
|
1121
|
+
/**
|
|
1122
|
+
* @param {!proto.gateway.parallax.v1.Event=} opt_value
|
|
1123
|
+
* @param {number=} opt_index
|
|
1124
|
+
* @return {!proto.gateway.parallax.v1.Event}
|
|
1125
|
+
*/
|
|
1126
|
+
proto.gateway.parallax.v1.CreateTraceRequest.prototype.addEvents = function(opt_value, opt_index) {
|
|
1127
|
+
return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.gateway.parallax.v1.Event, opt_index);
|
|
1128
|
+
};
|
|
1129
|
+
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* Clears the list making it empty but non-null.
|
|
1133
|
+
* @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
|
|
1134
|
+
*/
|
|
1135
|
+
proto.gateway.parallax.v1.CreateTraceRequest.prototype.clearEventsList = function() {
|
|
1136
|
+
return this.setEventsList([]);
|
|
1137
|
+
};
|
|
1138
|
+
|
|
1139
|
+
|
|
1140
|
+
/**
|
|
1141
|
+
* optional TxHashHint tx_hash_hint = 5;
|
|
1142
|
+
* @return {?proto.gateway.parallax.v1.TxHashHint}
|
|
1143
|
+
*/
|
|
1144
|
+
proto.gateway.parallax.v1.CreateTraceRequest.prototype.getTxHashHint = function() {
|
|
1145
|
+
return /** @type{?proto.gateway.parallax.v1.TxHashHint} */ (
|
|
1146
|
+
jspb.Message.getWrapperField(this, proto.gateway.parallax.v1.TxHashHint, 5));
|
|
1147
|
+
};
|
|
1148
|
+
|
|
1149
|
+
|
|
1150
|
+
/**
|
|
1151
|
+
* @param {?proto.gateway.parallax.v1.TxHashHint|undefined} value
|
|
1152
|
+
* @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
|
|
1153
|
+
*/
|
|
1154
|
+
proto.gateway.parallax.v1.CreateTraceRequest.prototype.setTxHashHint = function(value) {
|
|
1155
|
+
return jspb.Message.setWrapperField(this, 5, value);
|
|
1156
|
+
};
|
|
1157
|
+
|
|
1158
|
+
|
|
1159
|
+
/**
|
|
1160
|
+
* Clears the message field making it undefined.
|
|
1161
|
+
* @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
|
|
1162
|
+
*/
|
|
1163
|
+
proto.gateway.parallax.v1.CreateTraceRequest.prototype.clearTxHashHint = function() {
|
|
1164
|
+
return this.setTxHashHint(undefined);
|
|
1165
|
+
};
|
|
1166
|
+
|
|
1167
|
+
|
|
1168
|
+
/**
|
|
1169
|
+
* Returns whether this field is set.
|
|
1170
|
+
* @return {boolean}
|
|
1171
|
+
*/
|
|
1172
|
+
proto.gateway.parallax.v1.CreateTraceRequest.prototype.hasTxHashHint = function() {
|
|
1173
|
+
return jspb.Message.getField(this, 5) != null;
|
|
1174
|
+
};
|
|
1175
|
+
|
|
1176
|
+
|
|
964
1177
|
|
|
965
1178
|
|
|
966
1179
|
|
|
@@ -977,8 +1190,8 @@ function requireParallax_gateway_pb () {
|
|
|
977
1190
|
* http://goto/soy-param-migration
|
|
978
1191
|
* @return {!Object}
|
|
979
1192
|
*/
|
|
980
|
-
proto.gateway.parallax.v1.
|
|
981
|
-
return proto.gateway.parallax.v1.
|
|
1193
|
+
proto.gateway.parallax.v1.CreateTraceResponse.prototype.toObject = function(opt_includeInstance) {
|
|
1194
|
+
return proto.gateway.parallax.v1.CreateTraceResponse.toObject(opt_includeInstance, this);
|
|
982
1195
|
};
|
|
983
1196
|
|
|
984
1197
|
|
|
@@ -987,16 +1200,14 @@ function requireParallax_gateway_pb () {
|
|
|
987
1200
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
988
1201
|
* the JSPB instance for transitional soy proto support:
|
|
989
1202
|
* http://goto/soy-param-migration
|
|
990
|
-
* @param {!proto.gateway.parallax.v1.
|
|
1203
|
+
* @param {!proto.gateway.parallax.v1.CreateTraceResponse} msg The msg instance to transform.
|
|
991
1204
|
* @return {!Object}
|
|
992
1205
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
993
1206
|
*/
|
|
994
|
-
proto.gateway.parallax.v1.
|
|
1207
|
+
proto.gateway.parallax.v1.CreateTraceResponse.toObject = function(includeInstance, msg) {
|
|
995
1208
|
var f, obj = {
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
details: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f,
|
|
999
|
-
timestamp: (f = msg.getTimestamp()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f)
|
|
1209
|
+
status: (f = msg.getStatus()) && proto_common_v1_status_pb.ResponseStatus.toObject(includeInstance, f),
|
|
1210
|
+
traceId: jspb.Message.getFieldWithDefault(msg, 2, "")
|
|
1000
1211
|
};
|
|
1001
1212
|
|
|
1002
1213
|
if (includeInstance) {
|
|
@@ -1010,23 +1221,23 @@ function requireParallax_gateway_pb () {
|
|
|
1010
1221
|
/**
|
|
1011
1222
|
* Deserializes binary data (in protobuf wire format).
|
|
1012
1223
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
1013
|
-
* @return {!proto.gateway.parallax.v1.
|
|
1224
|
+
* @return {!proto.gateway.parallax.v1.CreateTraceResponse}
|
|
1014
1225
|
*/
|
|
1015
|
-
proto.gateway.parallax.v1.
|
|
1226
|
+
proto.gateway.parallax.v1.CreateTraceResponse.deserializeBinary = function(bytes) {
|
|
1016
1227
|
var reader = new jspb.BinaryReader(bytes);
|
|
1017
|
-
var msg = new proto.gateway.parallax.v1.
|
|
1018
|
-
return proto.gateway.parallax.v1.
|
|
1228
|
+
var msg = new proto.gateway.parallax.v1.CreateTraceResponse;
|
|
1229
|
+
return proto.gateway.parallax.v1.CreateTraceResponse.deserializeBinaryFromReader(msg, reader);
|
|
1019
1230
|
};
|
|
1020
1231
|
|
|
1021
1232
|
|
|
1022
1233
|
/**
|
|
1023
1234
|
* Deserializes binary data (in protobuf wire format) from the
|
|
1024
1235
|
* given reader into the given message object.
|
|
1025
|
-
* @param {!proto.gateway.parallax.v1.
|
|
1236
|
+
* @param {!proto.gateway.parallax.v1.CreateTraceResponse} msg The message object to deserialize into.
|
|
1026
1237
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
1027
|
-
* @return {!proto.gateway.parallax.v1.
|
|
1238
|
+
* @return {!proto.gateway.parallax.v1.CreateTraceResponse}
|
|
1028
1239
|
*/
|
|
1029
|
-
proto.gateway.parallax.v1.
|
|
1240
|
+
proto.gateway.parallax.v1.CreateTraceResponse.deserializeBinaryFromReader = function(msg, reader) {
|
|
1030
1241
|
while (reader.nextField()) {
|
|
1031
1242
|
if (reader.isEndGroup()) {
|
|
1032
1243
|
break;
|
|
@@ -1034,21 +1245,13 @@ function requireParallax_gateway_pb () {
|
|
|
1034
1245
|
var field = reader.getFieldNumber();
|
|
1035
1246
|
switch (field) {
|
|
1036
1247
|
case 1:
|
|
1037
|
-
var value =
|
|
1038
|
-
|
|
1248
|
+
var value = new proto_common_v1_status_pb.ResponseStatus;
|
|
1249
|
+
reader.readMessage(value,proto_common_v1_status_pb.ResponseStatus.deserializeBinaryFromReader);
|
|
1250
|
+
msg.setStatus(value);
|
|
1039
1251
|
break;
|
|
1040
1252
|
case 2:
|
|
1041
1253
|
var value = /** @type {string} */ (reader.readString());
|
|
1042
|
-
msg.
|
|
1043
|
-
break;
|
|
1044
|
-
case 3:
|
|
1045
|
-
var value = /** @type {string} */ (reader.readString());
|
|
1046
|
-
msg.setDetails(value);
|
|
1047
|
-
break;
|
|
1048
|
-
case 4:
|
|
1049
|
-
var value = new google_protobuf_timestamp_pb.Timestamp;
|
|
1050
|
-
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
|
|
1051
|
-
msg.setTimestamp(value);
|
|
1254
|
+
msg.setTraceId(value);
|
|
1052
1255
|
break;
|
|
1053
1256
|
default:
|
|
1054
1257
|
reader.skipField();
|
|
@@ -1063,9 +1266,9 @@ function requireParallax_gateway_pb () {
|
|
|
1063
1266
|
* Serializes the message to binary data (in protobuf wire format).
|
|
1064
1267
|
* @return {!Uint8Array}
|
|
1065
1268
|
*/
|
|
1066
|
-
proto.gateway.parallax.v1.
|
|
1269
|
+
proto.gateway.parallax.v1.CreateTraceResponse.prototype.serializeBinary = function() {
|
|
1067
1270
|
var writer = new jspb.BinaryWriter();
|
|
1068
|
-
proto.gateway.parallax.v1.
|
|
1271
|
+
proto.gateway.parallax.v1.CreateTraceResponse.serializeBinaryToWriter(this, writer);
|
|
1069
1272
|
return writer.getResultBuffer();
|
|
1070
1273
|
};
|
|
1071
1274
|
|
|
@@ -1073,27 +1276,218 @@ function requireParallax_gateway_pb () {
|
|
|
1073
1276
|
/**
|
|
1074
1277
|
* Serializes the given message to binary data (in protobuf wire
|
|
1075
1278
|
* format), writing to the given BinaryWriter.
|
|
1076
|
-
* @param {!proto.gateway.parallax.v1.
|
|
1279
|
+
* @param {!proto.gateway.parallax.v1.CreateTraceResponse} message
|
|
1077
1280
|
* @param {!jspb.BinaryWriter} writer
|
|
1078
1281
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
1079
1282
|
*/
|
|
1080
|
-
proto.gateway.parallax.v1.
|
|
1283
|
+
proto.gateway.parallax.v1.CreateTraceResponse.serializeBinaryToWriter = function(message, writer) {
|
|
1081
1284
|
var f = undefined;
|
|
1082
|
-
f = message.
|
|
1083
|
-
if (f
|
|
1084
|
-
writer.
|
|
1285
|
+
f = message.getStatus();
|
|
1286
|
+
if (f != null) {
|
|
1287
|
+
writer.writeMessage(
|
|
1085
1288
|
1,
|
|
1086
|
-
f
|
|
1289
|
+
f,
|
|
1290
|
+
proto_common_v1_status_pb.ResponseStatus.serializeBinaryToWriter
|
|
1087
1291
|
);
|
|
1088
1292
|
}
|
|
1089
|
-
f = message.
|
|
1293
|
+
f = message.getTraceId();
|
|
1090
1294
|
if (f.length > 0) {
|
|
1091
1295
|
writer.writeString(
|
|
1092
1296
|
2,
|
|
1093
1297
|
f
|
|
1094
1298
|
);
|
|
1095
1299
|
}
|
|
1096
|
-
|
|
1300
|
+
};
|
|
1301
|
+
|
|
1302
|
+
|
|
1303
|
+
/**
|
|
1304
|
+
* optional common.v1.ResponseStatus status = 1;
|
|
1305
|
+
* @return {?proto.common.v1.ResponseStatus}
|
|
1306
|
+
*/
|
|
1307
|
+
proto.gateway.parallax.v1.CreateTraceResponse.prototype.getStatus = function() {
|
|
1308
|
+
return /** @type{?proto.common.v1.ResponseStatus} */ (
|
|
1309
|
+
jspb.Message.getWrapperField(this, proto_common_v1_status_pb.ResponseStatus, 1));
|
|
1310
|
+
};
|
|
1311
|
+
|
|
1312
|
+
|
|
1313
|
+
/**
|
|
1314
|
+
* @param {?proto.common.v1.ResponseStatus|undefined} value
|
|
1315
|
+
* @return {!proto.gateway.parallax.v1.CreateTraceResponse} returns this
|
|
1316
|
+
*/
|
|
1317
|
+
proto.gateway.parallax.v1.CreateTraceResponse.prototype.setStatus = function(value) {
|
|
1318
|
+
return jspb.Message.setWrapperField(this, 1, value);
|
|
1319
|
+
};
|
|
1320
|
+
|
|
1321
|
+
|
|
1322
|
+
/**
|
|
1323
|
+
* Clears the message field making it undefined.
|
|
1324
|
+
* @return {!proto.gateway.parallax.v1.CreateTraceResponse} returns this
|
|
1325
|
+
*/
|
|
1326
|
+
proto.gateway.parallax.v1.CreateTraceResponse.prototype.clearStatus = function() {
|
|
1327
|
+
return this.setStatus(undefined);
|
|
1328
|
+
};
|
|
1329
|
+
|
|
1330
|
+
|
|
1331
|
+
/**
|
|
1332
|
+
* Returns whether this field is set.
|
|
1333
|
+
* @return {boolean}
|
|
1334
|
+
*/
|
|
1335
|
+
proto.gateway.parallax.v1.CreateTraceResponse.prototype.hasStatus = function() {
|
|
1336
|
+
return jspb.Message.getField(this, 1) != null;
|
|
1337
|
+
};
|
|
1338
|
+
|
|
1339
|
+
|
|
1340
|
+
/**
|
|
1341
|
+
* optional string trace_id = 2;
|
|
1342
|
+
* @return {string}
|
|
1343
|
+
*/
|
|
1344
|
+
proto.gateway.parallax.v1.CreateTraceResponse.prototype.getTraceId = function() {
|
|
1345
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
1346
|
+
};
|
|
1347
|
+
|
|
1348
|
+
|
|
1349
|
+
/**
|
|
1350
|
+
* @param {string} value
|
|
1351
|
+
* @return {!proto.gateway.parallax.v1.CreateTraceResponse} returns this
|
|
1352
|
+
*/
|
|
1353
|
+
proto.gateway.parallax.v1.CreateTraceResponse.prototype.setTraceId = function(value) {
|
|
1354
|
+
return jspb.Message.setProto3StringField(this, 2, value);
|
|
1355
|
+
};
|
|
1356
|
+
|
|
1357
|
+
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
|
|
1361
|
+
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
1362
|
+
/**
|
|
1363
|
+
* Creates an object representation of this proto.
|
|
1364
|
+
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
1365
|
+
* Optional fields that are not set will be set to undefined.
|
|
1366
|
+
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
1367
|
+
* For the list of reserved names please see:
|
|
1368
|
+
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
1369
|
+
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
1370
|
+
* JSPB instance for transitional soy proto support:
|
|
1371
|
+
* http://goto/soy-param-migration
|
|
1372
|
+
* @return {!Object}
|
|
1373
|
+
*/
|
|
1374
|
+
proto.gateway.parallax.v1.TxHashHint.prototype.toObject = function(opt_includeInstance) {
|
|
1375
|
+
return proto.gateway.parallax.v1.TxHashHint.toObject(opt_includeInstance, this);
|
|
1376
|
+
};
|
|
1377
|
+
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* Static version of the {@see toObject} method.
|
|
1381
|
+
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
1382
|
+
* the JSPB instance for transitional soy proto support:
|
|
1383
|
+
* http://goto/soy-param-migration
|
|
1384
|
+
* @param {!proto.gateway.parallax.v1.TxHashHint} msg The msg instance to transform.
|
|
1385
|
+
* @return {!Object}
|
|
1386
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
1387
|
+
*/
|
|
1388
|
+
proto.gateway.parallax.v1.TxHashHint.toObject = function(includeInstance, msg) {
|
|
1389
|
+
var f, obj = {
|
|
1390
|
+
chain: jspb.Message.getFieldWithDefault(msg, 1, 0),
|
|
1391
|
+
txHash: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
|
1392
|
+
details: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f,
|
|
1393
|
+
timestamp: (f = msg.getTimestamp()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f)
|
|
1394
|
+
};
|
|
1395
|
+
|
|
1396
|
+
if (includeInstance) {
|
|
1397
|
+
obj.$jspbMessageInstance = msg;
|
|
1398
|
+
}
|
|
1399
|
+
return obj;
|
|
1400
|
+
};
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
|
|
1404
|
+
/**
|
|
1405
|
+
* Deserializes binary data (in protobuf wire format).
|
|
1406
|
+
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
1407
|
+
* @return {!proto.gateway.parallax.v1.TxHashHint}
|
|
1408
|
+
*/
|
|
1409
|
+
proto.gateway.parallax.v1.TxHashHint.deserializeBinary = function(bytes) {
|
|
1410
|
+
var reader = new jspb.BinaryReader(bytes);
|
|
1411
|
+
var msg = new proto.gateway.parallax.v1.TxHashHint;
|
|
1412
|
+
return proto.gateway.parallax.v1.TxHashHint.deserializeBinaryFromReader(msg, reader);
|
|
1413
|
+
};
|
|
1414
|
+
|
|
1415
|
+
|
|
1416
|
+
/**
|
|
1417
|
+
* Deserializes binary data (in protobuf wire format) from the
|
|
1418
|
+
* given reader into the given message object.
|
|
1419
|
+
* @param {!proto.gateway.parallax.v1.TxHashHint} msg The message object to deserialize into.
|
|
1420
|
+
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
1421
|
+
* @return {!proto.gateway.parallax.v1.TxHashHint}
|
|
1422
|
+
*/
|
|
1423
|
+
proto.gateway.parallax.v1.TxHashHint.deserializeBinaryFromReader = function(msg, reader) {
|
|
1424
|
+
while (reader.nextField()) {
|
|
1425
|
+
if (reader.isEndGroup()) {
|
|
1426
|
+
break;
|
|
1427
|
+
}
|
|
1428
|
+
var field = reader.getFieldNumber();
|
|
1429
|
+
switch (field) {
|
|
1430
|
+
case 1:
|
|
1431
|
+
var value = /** @type {!proto.gateway.parallax.v1.Chain} */ (reader.readEnum());
|
|
1432
|
+
msg.setChain(value);
|
|
1433
|
+
break;
|
|
1434
|
+
case 2:
|
|
1435
|
+
var value = /** @type {string} */ (reader.readString());
|
|
1436
|
+
msg.setTxHash(value);
|
|
1437
|
+
break;
|
|
1438
|
+
case 3:
|
|
1439
|
+
var value = /** @type {string} */ (reader.readString());
|
|
1440
|
+
msg.setDetails(value);
|
|
1441
|
+
break;
|
|
1442
|
+
case 4:
|
|
1443
|
+
var value = new google_protobuf_timestamp_pb.Timestamp;
|
|
1444
|
+
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
|
|
1445
|
+
msg.setTimestamp(value);
|
|
1446
|
+
break;
|
|
1447
|
+
default:
|
|
1448
|
+
reader.skipField();
|
|
1449
|
+
break;
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
return msg;
|
|
1453
|
+
};
|
|
1454
|
+
|
|
1455
|
+
|
|
1456
|
+
/**
|
|
1457
|
+
* Serializes the message to binary data (in protobuf wire format).
|
|
1458
|
+
* @return {!Uint8Array}
|
|
1459
|
+
*/
|
|
1460
|
+
proto.gateway.parallax.v1.TxHashHint.prototype.serializeBinary = function() {
|
|
1461
|
+
var writer = new jspb.BinaryWriter();
|
|
1462
|
+
proto.gateway.parallax.v1.TxHashHint.serializeBinaryToWriter(this, writer);
|
|
1463
|
+
return writer.getResultBuffer();
|
|
1464
|
+
};
|
|
1465
|
+
|
|
1466
|
+
|
|
1467
|
+
/**
|
|
1468
|
+
* Serializes the given message to binary data (in protobuf wire
|
|
1469
|
+
* format), writing to the given BinaryWriter.
|
|
1470
|
+
* @param {!proto.gateway.parallax.v1.TxHashHint} message
|
|
1471
|
+
* @param {!jspb.BinaryWriter} writer
|
|
1472
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
1473
|
+
*/
|
|
1474
|
+
proto.gateway.parallax.v1.TxHashHint.serializeBinaryToWriter = function(message, writer) {
|
|
1475
|
+
var f = undefined;
|
|
1476
|
+
f = message.getChain();
|
|
1477
|
+
if (f !== 0.0) {
|
|
1478
|
+
writer.writeEnum(
|
|
1479
|
+
1,
|
|
1480
|
+
f
|
|
1481
|
+
);
|
|
1482
|
+
}
|
|
1483
|
+
f = message.getTxHash();
|
|
1484
|
+
if (f.length > 0) {
|
|
1485
|
+
writer.writeString(
|
|
1486
|
+
2,
|
|
1487
|
+
f
|
|
1488
|
+
);
|
|
1489
|
+
}
|
|
1490
|
+
f = /** @type {string} */ (jspb.Message.getField(message, 3));
|
|
1097
1491
|
if (f != null) {
|
|
1098
1492
|
writer.writeString(
|
|
1099
1493
|
3,
|
|
@@ -1112,20 +1506,20 @@ function requireParallax_gateway_pb () {
|
|
|
1112
1506
|
|
|
1113
1507
|
|
|
1114
1508
|
/**
|
|
1115
|
-
* optional
|
|
1116
|
-
* @return {
|
|
1509
|
+
* optional Chain chain = 1;
|
|
1510
|
+
* @return {!proto.gateway.parallax.v1.Chain}
|
|
1117
1511
|
*/
|
|
1118
|
-
proto.gateway.parallax.v1.
|
|
1119
|
-
return /** @type {
|
|
1512
|
+
proto.gateway.parallax.v1.TxHashHint.prototype.getChain = function() {
|
|
1513
|
+
return /** @type {!proto.gateway.parallax.v1.Chain} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
|
|
1120
1514
|
};
|
|
1121
1515
|
|
|
1122
1516
|
|
|
1123
1517
|
/**
|
|
1124
|
-
* @param {
|
|
1125
|
-
* @return {!proto.gateway.parallax.v1.
|
|
1518
|
+
* @param {!proto.gateway.parallax.v1.Chain} value
|
|
1519
|
+
* @return {!proto.gateway.parallax.v1.TxHashHint} returns this
|
|
1126
1520
|
*/
|
|
1127
|
-
proto.gateway.parallax.v1.
|
|
1128
|
-
return jspb.Message.
|
|
1521
|
+
proto.gateway.parallax.v1.TxHashHint.prototype.setChain = function(value) {
|
|
1522
|
+
return jspb.Message.setProto3EnumField(this, 1, value);
|
|
1129
1523
|
};
|
|
1130
1524
|
|
|
1131
1525
|
|
|
@@ -1133,16 +1527,16 @@ function requireParallax_gateway_pb () {
|
|
|
1133
1527
|
* optional string tx_hash = 2;
|
|
1134
1528
|
* @return {string}
|
|
1135
1529
|
*/
|
|
1136
|
-
proto.gateway.parallax.v1.
|
|
1530
|
+
proto.gateway.parallax.v1.TxHashHint.prototype.getTxHash = function() {
|
|
1137
1531
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
1138
1532
|
};
|
|
1139
1533
|
|
|
1140
1534
|
|
|
1141
1535
|
/**
|
|
1142
1536
|
* @param {string} value
|
|
1143
|
-
* @return {!proto.gateway.parallax.v1.
|
|
1537
|
+
* @return {!proto.gateway.parallax.v1.TxHashHint} returns this
|
|
1144
1538
|
*/
|
|
1145
|
-
proto.gateway.parallax.v1.
|
|
1539
|
+
proto.gateway.parallax.v1.TxHashHint.prototype.setTxHash = function(value) {
|
|
1146
1540
|
return jspb.Message.setProto3StringField(this, 2, value);
|
|
1147
1541
|
};
|
|
1148
1542
|
|
|
@@ -1151,25 +1545,25 @@ function requireParallax_gateway_pb () {
|
|
|
1151
1545
|
* optional string details = 3;
|
|
1152
1546
|
* @return {string}
|
|
1153
1547
|
*/
|
|
1154
|
-
proto.gateway.parallax.v1.
|
|
1548
|
+
proto.gateway.parallax.v1.TxHashHint.prototype.getDetails = function() {
|
|
1155
1549
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
|
|
1156
1550
|
};
|
|
1157
1551
|
|
|
1158
1552
|
|
|
1159
1553
|
/**
|
|
1160
1554
|
* @param {string} value
|
|
1161
|
-
* @return {!proto.gateway.parallax.v1.
|
|
1555
|
+
* @return {!proto.gateway.parallax.v1.TxHashHint} returns this
|
|
1162
1556
|
*/
|
|
1163
|
-
proto.gateway.parallax.v1.
|
|
1557
|
+
proto.gateway.parallax.v1.TxHashHint.prototype.setDetails = function(value) {
|
|
1164
1558
|
return jspb.Message.setField(this, 3, value);
|
|
1165
1559
|
};
|
|
1166
1560
|
|
|
1167
1561
|
|
|
1168
1562
|
/**
|
|
1169
1563
|
* Clears the field making it undefined.
|
|
1170
|
-
* @return {!proto.gateway.parallax.v1.
|
|
1564
|
+
* @return {!proto.gateway.parallax.v1.TxHashHint} returns this
|
|
1171
1565
|
*/
|
|
1172
|
-
proto.gateway.parallax.v1.
|
|
1566
|
+
proto.gateway.parallax.v1.TxHashHint.prototype.clearDetails = function() {
|
|
1173
1567
|
return jspb.Message.setField(this, 3, undefined);
|
|
1174
1568
|
};
|
|
1175
1569
|
|
|
@@ -1178,7 +1572,7 @@ function requireParallax_gateway_pb () {
|
|
|
1178
1572
|
* Returns whether this field is set.
|
|
1179
1573
|
* @return {boolean}
|
|
1180
1574
|
*/
|
|
1181
|
-
proto.gateway.parallax.v1.
|
|
1575
|
+
proto.gateway.parallax.v1.TxHashHint.prototype.hasDetails = function() {
|
|
1182
1576
|
return jspb.Message.getField(this, 3) != null;
|
|
1183
1577
|
};
|
|
1184
1578
|
|
|
@@ -1187,7 +1581,7 @@ function requireParallax_gateway_pb () {
|
|
|
1187
1581
|
* optional google.protobuf.Timestamp timestamp = 4;
|
|
1188
1582
|
* @return {?proto.google.protobuf.Timestamp}
|
|
1189
1583
|
*/
|
|
1190
|
-
proto.gateway.parallax.v1.
|
|
1584
|
+
proto.gateway.parallax.v1.TxHashHint.prototype.getTimestamp = function() {
|
|
1191
1585
|
return /** @type{?proto.google.protobuf.Timestamp} */ (
|
|
1192
1586
|
jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 4));
|
|
1193
1587
|
};
|
|
@@ -1195,18 +1589,18 @@ function requireParallax_gateway_pb () {
|
|
|
1195
1589
|
|
|
1196
1590
|
/**
|
|
1197
1591
|
* @param {?proto.google.protobuf.Timestamp|undefined} value
|
|
1198
|
-
* @return {!proto.gateway.parallax.v1.
|
|
1592
|
+
* @return {!proto.gateway.parallax.v1.TxHashHint} returns this
|
|
1199
1593
|
*/
|
|
1200
|
-
proto.gateway.parallax.v1.
|
|
1594
|
+
proto.gateway.parallax.v1.TxHashHint.prototype.setTimestamp = function(value) {
|
|
1201
1595
|
return jspb.Message.setWrapperField(this, 4, value);
|
|
1202
1596
|
};
|
|
1203
1597
|
|
|
1204
1598
|
|
|
1205
1599
|
/**
|
|
1206
1600
|
* Clears the message field making it undefined.
|
|
1207
|
-
* @return {!proto.gateway.parallax.v1.
|
|
1601
|
+
* @return {!proto.gateway.parallax.v1.TxHashHint} returns this
|
|
1208
1602
|
*/
|
|
1209
|
-
proto.gateway.parallax.v1.
|
|
1603
|
+
proto.gateway.parallax.v1.TxHashHint.prototype.clearTimestamp = function() {
|
|
1210
1604
|
return this.setTimestamp(undefined);
|
|
1211
1605
|
};
|
|
1212
1606
|
|
|
@@ -1215,7 +1609,7 @@ function requireParallax_gateway_pb () {
|
|
|
1215
1609
|
* Returns whether this field is set.
|
|
1216
1610
|
* @return {boolean}
|
|
1217
1611
|
*/
|
|
1218
|
-
proto.gateway.parallax.v1.
|
|
1612
|
+
proto.gateway.parallax.v1.TxHashHint.prototype.hasTimestamp = function() {
|
|
1219
1613
|
return jspb.Message.getField(this, 4) != null;
|
|
1220
1614
|
};
|
|
1221
1615
|
|
|
@@ -1236,8 +1630,8 @@ function requireParallax_gateway_pb () {
|
|
|
1236
1630
|
* http://goto/soy-param-migration
|
|
1237
1631
|
* @return {!Object}
|
|
1238
1632
|
*/
|
|
1239
|
-
proto.gateway.parallax.v1.
|
|
1240
|
-
return proto.gateway.parallax.v1.
|
|
1633
|
+
proto.gateway.parallax.v1.Event.prototype.toObject = function(opt_includeInstance) {
|
|
1634
|
+
return proto.gateway.parallax.v1.Event.toObject(opt_includeInstance, this);
|
|
1241
1635
|
};
|
|
1242
1636
|
|
|
1243
1637
|
|
|
@@ -1246,13 +1640,13 @@ function requireParallax_gateway_pb () {
|
|
|
1246
1640
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
1247
1641
|
* the JSPB instance for transitional soy proto support:
|
|
1248
1642
|
* http://goto/soy-param-migration
|
|
1249
|
-
* @param {!proto.gateway.parallax.v1.
|
|
1643
|
+
* @param {!proto.gateway.parallax.v1.Event} msg The msg instance to transform.
|
|
1250
1644
|
* @return {!Object}
|
|
1251
1645
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
1252
1646
|
*/
|
|
1253
|
-
proto.gateway.parallax.v1.
|
|
1647
|
+
proto.gateway.parallax.v1.Event.toObject = function(includeInstance, msg) {
|
|
1254
1648
|
var f, obj = {
|
|
1255
|
-
|
|
1649
|
+
name: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
1256
1650
|
details: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f,
|
|
1257
1651
|
timestamp: (f = msg.getTimestamp()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f)
|
|
1258
1652
|
};
|
|
@@ -1268,23 +1662,23 @@ function requireParallax_gateway_pb () {
|
|
|
1268
1662
|
/**
|
|
1269
1663
|
* Deserializes binary data (in protobuf wire format).
|
|
1270
1664
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
1271
|
-
* @return {!proto.gateway.parallax.v1.
|
|
1665
|
+
* @return {!proto.gateway.parallax.v1.Event}
|
|
1272
1666
|
*/
|
|
1273
|
-
proto.gateway.parallax.v1.
|
|
1667
|
+
proto.gateway.parallax.v1.Event.deserializeBinary = function(bytes) {
|
|
1274
1668
|
var reader = new jspb.BinaryReader(bytes);
|
|
1275
|
-
var msg = new proto.gateway.parallax.v1.
|
|
1276
|
-
return proto.gateway.parallax.v1.
|
|
1669
|
+
var msg = new proto.gateway.parallax.v1.Event;
|
|
1670
|
+
return proto.gateway.parallax.v1.Event.deserializeBinaryFromReader(msg, reader);
|
|
1277
1671
|
};
|
|
1278
1672
|
|
|
1279
1673
|
|
|
1280
1674
|
/**
|
|
1281
1675
|
* Deserializes binary data (in protobuf wire format) from the
|
|
1282
1676
|
* given reader into the given message object.
|
|
1283
|
-
* @param {!proto.gateway.parallax.v1.
|
|
1677
|
+
* @param {!proto.gateway.parallax.v1.Event} msg The message object to deserialize into.
|
|
1284
1678
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
1285
|
-
* @return {!proto.gateway.parallax.v1.
|
|
1679
|
+
* @return {!proto.gateway.parallax.v1.Event}
|
|
1286
1680
|
*/
|
|
1287
|
-
proto.gateway.parallax.v1.
|
|
1681
|
+
proto.gateway.parallax.v1.Event.deserializeBinaryFromReader = function(msg, reader) {
|
|
1288
1682
|
while (reader.nextField()) {
|
|
1289
1683
|
if (reader.isEndGroup()) {
|
|
1290
1684
|
break;
|
|
@@ -1293,7 +1687,7 @@ function requireParallax_gateway_pb () {
|
|
|
1293
1687
|
switch (field) {
|
|
1294
1688
|
case 1:
|
|
1295
1689
|
var value = /** @type {string} */ (reader.readString());
|
|
1296
|
-
msg.
|
|
1690
|
+
msg.setName(value);
|
|
1297
1691
|
break;
|
|
1298
1692
|
case 2:
|
|
1299
1693
|
var value = /** @type {string} */ (reader.readString());
|
|
@@ -1317,9 +1711,9 @@ function requireParallax_gateway_pb () {
|
|
|
1317
1711
|
* Serializes the message to binary data (in protobuf wire format).
|
|
1318
1712
|
* @return {!Uint8Array}
|
|
1319
1713
|
*/
|
|
1320
|
-
proto.gateway.parallax.v1.
|
|
1714
|
+
proto.gateway.parallax.v1.Event.prototype.serializeBinary = function() {
|
|
1321
1715
|
var writer = new jspb.BinaryWriter();
|
|
1322
|
-
proto.gateway.parallax.v1.
|
|
1716
|
+
proto.gateway.parallax.v1.Event.serializeBinaryToWriter(this, writer);
|
|
1323
1717
|
return writer.getResultBuffer();
|
|
1324
1718
|
};
|
|
1325
1719
|
|
|
@@ -1327,13 +1721,13 @@ function requireParallax_gateway_pb () {
|
|
|
1327
1721
|
/**
|
|
1328
1722
|
* Serializes the given message to binary data (in protobuf wire
|
|
1329
1723
|
* format), writing to the given BinaryWriter.
|
|
1330
|
-
* @param {!proto.gateway.parallax.v1.
|
|
1724
|
+
* @param {!proto.gateway.parallax.v1.Event} message
|
|
1331
1725
|
* @param {!jspb.BinaryWriter} writer
|
|
1332
1726
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
1333
1727
|
*/
|
|
1334
|
-
proto.gateway.parallax.v1.
|
|
1728
|
+
proto.gateway.parallax.v1.Event.serializeBinaryToWriter = function(message, writer) {
|
|
1335
1729
|
var f = undefined;
|
|
1336
|
-
f = message.
|
|
1730
|
+
f = message.getName();
|
|
1337
1731
|
if (f.length > 0) {
|
|
1338
1732
|
writer.writeString(
|
|
1339
1733
|
1,
|
|
@@ -1359,19 +1753,19 @@ function requireParallax_gateway_pb () {
|
|
|
1359
1753
|
|
|
1360
1754
|
|
|
1361
1755
|
/**
|
|
1362
|
-
* optional string
|
|
1756
|
+
* optional string name = 1;
|
|
1363
1757
|
* @return {string}
|
|
1364
1758
|
*/
|
|
1365
|
-
proto.gateway.parallax.v1.
|
|
1759
|
+
proto.gateway.parallax.v1.Event.prototype.getName = function() {
|
|
1366
1760
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
1367
1761
|
};
|
|
1368
1762
|
|
|
1369
1763
|
|
|
1370
1764
|
/**
|
|
1371
1765
|
* @param {string} value
|
|
1372
|
-
* @return {!proto.gateway.parallax.v1.
|
|
1766
|
+
* @return {!proto.gateway.parallax.v1.Event} returns this
|
|
1373
1767
|
*/
|
|
1374
|
-
proto.gateway.parallax.v1.
|
|
1768
|
+
proto.gateway.parallax.v1.Event.prototype.setName = function(value) {
|
|
1375
1769
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
1376
1770
|
};
|
|
1377
1771
|
|
|
@@ -1380,25 +1774,25 @@ function requireParallax_gateway_pb () {
|
|
|
1380
1774
|
* optional string details = 2;
|
|
1381
1775
|
* @return {string}
|
|
1382
1776
|
*/
|
|
1383
|
-
proto.gateway.parallax.v1.
|
|
1777
|
+
proto.gateway.parallax.v1.Event.prototype.getDetails = function() {
|
|
1384
1778
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
1385
1779
|
};
|
|
1386
1780
|
|
|
1387
1781
|
|
|
1388
1782
|
/**
|
|
1389
1783
|
* @param {string} value
|
|
1390
|
-
* @return {!proto.gateway.parallax.v1.
|
|
1784
|
+
* @return {!proto.gateway.parallax.v1.Event} returns this
|
|
1391
1785
|
*/
|
|
1392
|
-
proto.gateway.parallax.v1.
|
|
1786
|
+
proto.gateway.parallax.v1.Event.prototype.setDetails = function(value) {
|
|
1393
1787
|
return jspb.Message.setField(this, 2, value);
|
|
1394
1788
|
};
|
|
1395
1789
|
|
|
1396
1790
|
|
|
1397
1791
|
/**
|
|
1398
1792
|
* Clears the field making it undefined.
|
|
1399
|
-
* @return {!proto.gateway.parallax.v1.
|
|
1793
|
+
* @return {!proto.gateway.parallax.v1.Event} returns this
|
|
1400
1794
|
*/
|
|
1401
|
-
proto.gateway.parallax.v1.
|
|
1795
|
+
proto.gateway.parallax.v1.Event.prototype.clearDetails = function() {
|
|
1402
1796
|
return jspb.Message.setField(this, 2, undefined);
|
|
1403
1797
|
};
|
|
1404
1798
|
|
|
@@ -1407,7 +1801,7 @@ function requireParallax_gateway_pb () {
|
|
|
1407
1801
|
* Returns whether this field is set.
|
|
1408
1802
|
* @return {boolean}
|
|
1409
1803
|
*/
|
|
1410
|
-
proto.gateway.parallax.v1.
|
|
1804
|
+
proto.gateway.parallax.v1.Event.prototype.hasDetails = function() {
|
|
1411
1805
|
return jspb.Message.getField(this, 2) != null;
|
|
1412
1806
|
};
|
|
1413
1807
|
|
|
@@ -1416,7 +1810,7 @@ function requireParallax_gateway_pb () {
|
|
|
1416
1810
|
* optional google.protobuf.Timestamp timestamp = 3;
|
|
1417
1811
|
* @return {?proto.google.protobuf.Timestamp}
|
|
1418
1812
|
*/
|
|
1419
|
-
proto.gateway.parallax.v1.
|
|
1813
|
+
proto.gateway.parallax.v1.Event.prototype.getTimestamp = function() {
|
|
1420
1814
|
return /** @type{?proto.google.protobuf.Timestamp} */ (
|
|
1421
1815
|
jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3));
|
|
1422
1816
|
};
|
|
@@ -1424,18 +1818,18 @@ function requireParallax_gateway_pb () {
|
|
|
1424
1818
|
|
|
1425
1819
|
/**
|
|
1426
1820
|
* @param {?proto.google.protobuf.Timestamp|undefined} value
|
|
1427
|
-
* @return {!proto.gateway.parallax.v1.
|
|
1821
|
+
* @return {!proto.gateway.parallax.v1.Event} returns this
|
|
1428
1822
|
*/
|
|
1429
|
-
proto.gateway.parallax.v1.
|
|
1823
|
+
proto.gateway.parallax.v1.Event.prototype.setTimestamp = function(value) {
|
|
1430
1824
|
return jspb.Message.setWrapperField(this, 3, value);
|
|
1431
1825
|
};
|
|
1432
1826
|
|
|
1433
1827
|
|
|
1434
1828
|
/**
|
|
1435
1829
|
* Clears the message field making it undefined.
|
|
1436
|
-
* @return {!proto.gateway.parallax.v1.
|
|
1830
|
+
* @return {!proto.gateway.parallax.v1.Event} returns this
|
|
1437
1831
|
*/
|
|
1438
|
-
proto.gateway.parallax.v1.
|
|
1832
|
+
proto.gateway.parallax.v1.Event.prototype.clearTimestamp = function() {
|
|
1439
1833
|
return this.setTimestamp(undefined);
|
|
1440
1834
|
};
|
|
1441
1835
|
|
|
@@ -1444,412 +1838,30 @@ function requireParallax_gateway_pb () {
|
|
|
1444
1838
|
* Returns whether this field is set.
|
|
1445
1839
|
* @return {boolean}
|
|
1446
1840
|
*/
|
|
1447
|
-
proto.gateway.parallax.v1.
|
|
1841
|
+
proto.gateway.parallax.v1.Event.prototype.hasTimestamp = function() {
|
|
1448
1842
|
return jspb.Message.getField(this, 3) != null;
|
|
1449
1843
|
};
|
|
1450
1844
|
|
|
1451
1845
|
|
|
1452
1846
|
/**
|
|
1453
|
-
*
|
|
1454
|
-
* @return {string}
|
|
1455
|
-
*/
|
|
1456
|
-
proto.gateway.parallax.v1.CreateTraceRequest.prototype.getName = function() {
|
|
1457
|
-
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
1458
|
-
};
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
/**
|
|
1462
|
-
* @param {string} value
|
|
1463
|
-
* @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
|
|
1464
|
-
*/
|
|
1465
|
-
proto.gateway.parallax.v1.CreateTraceRequest.prototype.setName = function(value) {
|
|
1466
|
-
return jspb.Message.setProto3StringField(this, 1, value);
|
|
1467
|
-
};
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
/**
|
|
1471
|
-
* map<string, string> attributes = 2;
|
|
1472
|
-
* @param {boolean=} opt_noLazyCreate Do not create the map if
|
|
1473
|
-
* empty, instead returning `undefined`
|
|
1474
|
-
* @return {!jspb.Map<string,string>}
|
|
1475
|
-
*/
|
|
1476
|
-
proto.gateway.parallax.v1.CreateTraceRequest.prototype.getAttributesMap = function(opt_noLazyCreate) {
|
|
1477
|
-
return /** @type {!jspb.Map<string,string>} */ (
|
|
1478
|
-
jspb.Message.getMapField(this, 2, opt_noLazyCreate,
|
|
1479
|
-
null));
|
|
1480
|
-
};
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
/**
|
|
1484
|
-
* Clears values from the map. The map will be non-null.
|
|
1485
|
-
* @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
|
|
1486
|
-
*/
|
|
1487
|
-
proto.gateway.parallax.v1.CreateTraceRequest.prototype.clearAttributesMap = function() {
|
|
1488
|
-
this.getAttributesMap().clear();
|
|
1489
|
-
return this;
|
|
1490
|
-
};
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
/**
|
|
1494
|
-
* repeated string tags = 3;
|
|
1495
|
-
* @return {!Array<string>}
|
|
1496
|
-
*/
|
|
1497
|
-
proto.gateway.parallax.v1.CreateTraceRequest.prototype.getTagsList = function() {
|
|
1498
|
-
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 3));
|
|
1499
|
-
};
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
/**
|
|
1503
|
-
* @param {!Array<string>} value
|
|
1504
|
-
* @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
|
|
1847
|
+
* @enum {number}
|
|
1505
1848
|
*/
|
|
1506
|
-
proto.gateway.parallax.v1.
|
|
1507
|
-
|
|
1849
|
+
proto.gateway.parallax.v1.Chain = {
|
|
1850
|
+
CHAIN_UNSPECIFIED: 0,
|
|
1851
|
+
CHAIN_ETHEREUM: 1,
|
|
1852
|
+
CHAIN_POLYGON: 2,
|
|
1853
|
+
CHAIN_ARBITRUM: 3,
|
|
1854
|
+
CHAIN_BASE: 4,
|
|
1855
|
+
CHAIN_OPTIMISM: 5,
|
|
1856
|
+
CHAIN_BSC: 6
|
|
1508
1857
|
};
|
|
1509
1858
|
|
|
1859
|
+
goog.object.extend(exports$1, proto.gateway.parallax.v1);
|
|
1860
|
+
} (parallax_gateway_pb));
|
|
1861
|
+
return parallax_gateway_pb;
|
|
1862
|
+
}
|
|
1510
1863
|
|
|
1511
|
-
|
|
1512
|
-
* @param {string} value
|
|
1513
|
-
* @param {number=} opt_index
|
|
1514
|
-
* @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
|
|
1515
|
-
*/
|
|
1516
|
-
proto.gateway.parallax.v1.CreateTraceRequest.prototype.addTags = function(value, opt_index) {
|
|
1517
|
-
return jspb.Message.addToRepeatedField(this, 3, value, opt_index);
|
|
1518
|
-
};
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
/**
|
|
1522
|
-
* Clears the list making it empty but non-null.
|
|
1523
|
-
* @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
|
|
1524
|
-
*/
|
|
1525
|
-
proto.gateway.parallax.v1.CreateTraceRequest.prototype.clearTagsList = function() {
|
|
1526
|
-
return this.setTagsList([]);
|
|
1527
|
-
};
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
/**
|
|
1531
|
-
* repeated Event events = 4;
|
|
1532
|
-
* @return {!Array<!proto.gateway.parallax.v1.CreateTraceRequest.Event>}
|
|
1533
|
-
*/
|
|
1534
|
-
proto.gateway.parallax.v1.CreateTraceRequest.prototype.getEventsList = function() {
|
|
1535
|
-
return /** @type{!Array<!proto.gateway.parallax.v1.CreateTraceRequest.Event>} */ (
|
|
1536
|
-
jspb.Message.getRepeatedWrapperField(this, proto.gateway.parallax.v1.CreateTraceRequest.Event, 4));
|
|
1537
|
-
};
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
/**
|
|
1541
|
-
* @param {!Array<!proto.gateway.parallax.v1.CreateTraceRequest.Event>} value
|
|
1542
|
-
* @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
|
|
1543
|
-
*/
|
|
1544
|
-
proto.gateway.parallax.v1.CreateTraceRequest.prototype.setEventsList = function(value) {
|
|
1545
|
-
return jspb.Message.setRepeatedWrapperField(this, 4, value);
|
|
1546
|
-
};
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
/**
|
|
1550
|
-
* @param {!proto.gateway.parallax.v1.CreateTraceRequest.Event=} opt_value
|
|
1551
|
-
* @param {number=} opt_index
|
|
1552
|
-
* @return {!proto.gateway.parallax.v1.CreateTraceRequest.Event}
|
|
1553
|
-
*/
|
|
1554
|
-
proto.gateway.parallax.v1.CreateTraceRequest.prototype.addEvents = function(opt_value, opt_index) {
|
|
1555
|
-
return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.gateway.parallax.v1.CreateTraceRequest.Event, opt_index);
|
|
1556
|
-
};
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
/**
|
|
1560
|
-
* Clears the list making it empty but non-null.
|
|
1561
|
-
* @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
|
|
1562
|
-
*/
|
|
1563
|
-
proto.gateway.parallax.v1.CreateTraceRequest.prototype.clearEventsList = function() {
|
|
1564
|
-
return this.setEventsList([]);
|
|
1565
|
-
};
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
/**
|
|
1569
|
-
* optional TxHashHint tx_hash_hint = 5;
|
|
1570
|
-
* @return {?proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint}
|
|
1571
|
-
*/
|
|
1572
|
-
proto.gateway.parallax.v1.CreateTraceRequest.prototype.getTxHashHint = function() {
|
|
1573
|
-
return /** @type{?proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint} */ (
|
|
1574
|
-
jspb.Message.getWrapperField(this, proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint, 5));
|
|
1575
|
-
};
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
/**
|
|
1579
|
-
* @param {?proto.gateway.parallax.v1.CreateTraceRequest.TxHashHint|undefined} value
|
|
1580
|
-
* @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
|
|
1581
|
-
*/
|
|
1582
|
-
proto.gateway.parallax.v1.CreateTraceRequest.prototype.setTxHashHint = function(value) {
|
|
1583
|
-
return jspb.Message.setWrapperField(this, 5, value);
|
|
1584
|
-
};
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
/**
|
|
1588
|
-
* Clears the message field making it undefined.
|
|
1589
|
-
* @return {!proto.gateway.parallax.v1.CreateTraceRequest} returns this
|
|
1590
|
-
*/
|
|
1591
|
-
proto.gateway.parallax.v1.CreateTraceRequest.prototype.clearTxHashHint = function() {
|
|
1592
|
-
return this.setTxHashHint(undefined);
|
|
1593
|
-
};
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
/**
|
|
1597
|
-
* Returns whether this field is set.
|
|
1598
|
-
* @return {boolean}
|
|
1599
|
-
*/
|
|
1600
|
-
proto.gateway.parallax.v1.CreateTraceRequest.prototype.hasTxHashHint = function() {
|
|
1601
|
-
return jspb.Message.getField(this, 5) != null;
|
|
1602
|
-
};
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
1609
|
-
/**
|
|
1610
|
-
* Creates an object representation of this proto.
|
|
1611
|
-
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
1612
|
-
* Optional fields that are not set will be set to undefined.
|
|
1613
|
-
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
1614
|
-
* For the list of reserved names please see:
|
|
1615
|
-
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
1616
|
-
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
1617
|
-
* JSPB instance for transitional soy proto support:
|
|
1618
|
-
* http://goto/soy-param-migration
|
|
1619
|
-
* @return {!Object}
|
|
1620
|
-
*/
|
|
1621
|
-
proto.gateway.parallax.v1.CreateTraceResponse.prototype.toObject = function(opt_includeInstance) {
|
|
1622
|
-
return proto.gateway.parallax.v1.CreateTraceResponse.toObject(opt_includeInstance, this);
|
|
1623
|
-
};
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
/**
|
|
1627
|
-
* Static version of the {@see toObject} method.
|
|
1628
|
-
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
1629
|
-
* the JSPB instance for transitional soy proto support:
|
|
1630
|
-
* http://goto/soy-param-migration
|
|
1631
|
-
* @param {!proto.gateway.parallax.v1.CreateTraceResponse} msg The msg instance to transform.
|
|
1632
|
-
* @return {!Object}
|
|
1633
|
-
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
1634
|
-
*/
|
|
1635
|
-
proto.gateway.parallax.v1.CreateTraceResponse.toObject = function(includeInstance, msg) {
|
|
1636
|
-
var f, obj = {
|
|
1637
|
-
status: (f = msg.getStatus()) && proto_common_v1_status_pb.ResponseStatus.toObject(includeInstance, f),
|
|
1638
|
-
traceId: jspb.Message.getFieldWithDefault(msg, 2, "")
|
|
1639
|
-
};
|
|
1640
|
-
|
|
1641
|
-
if (includeInstance) {
|
|
1642
|
-
obj.$jspbMessageInstance = msg;
|
|
1643
|
-
}
|
|
1644
|
-
return obj;
|
|
1645
|
-
};
|
|
1646
|
-
}
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
/**
|
|
1650
|
-
* Deserializes binary data (in protobuf wire format).
|
|
1651
|
-
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
1652
|
-
* @return {!proto.gateway.parallax.v1.CreateTraceResponse}
|
|
1653
|
-
*/
|
|
1654
|
-
proto.gateway.parallax.v1.CreateTraceResponse.deserializeBinary = function(bytes) {
|
|
1655
|
-
var reader = new jspb.BinaryReader(bytes);
|
|
1656
|
-
var msg = new proto.gateway.parallax.v1.CreateTraceResponse;
|
|
1657
|
-
return proto.gateway.parallax.v1.CreateTraceResponse.deserializeBinaryFromReader(msg, reader);
|
|
1658
|
-
};
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
/**
|
|
1662
|
-
* Deserializes binary data (in protobuf wire format) from the
|
|
1663
|
-
* given reader into the given message object.
|
|
1664
|
-
* @param {!proto.gateway.parallax.v1.CreateTraceResponse} msg The message object to deserialize into.
|
|
1665
|
-
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
1666
|
-
* @return {!proto.gateway.parallax.v1.CreateTraceResponse}
|
|
1667
|
-
*/
|
|
1668
|
-
proto.gateway.parallax.v1.CreateTraceResponse.deserializeBinaryFromReader = function(msg, reader) {
|
|
1669
|
-
while (reader.nextField()) {
|
|
1670
|
-
if (reader.isEndGroup()) {
|
|
1671
|
-
break;
|
|
1672
|
-
}
|
|
1673
|
-
var field = reader.getFieldNumber();
|
|
1674
|
-
switch (field) {
|
|
1675
|
-
case 1:
|
|
1676
|
-
var value = new proto_common_v1_status_pb.ResponseStatus;
|
|
1677
|
-
reader.readMessage(value,proto_common_v1_status_pb.ResponseStatus.deserializeBinaryFromReader);
|
|
1678
|
-
msg.setStatus(value);
|
|
1679
|
-
break;
|
|
1680
|
-
case 2:
|
|
1681
|
-
var value = /** @type {string} */ (reader.readString());
|
|
1682
|
-
msg.setTraceId(value);
|
|
1683
|
-
break;
|
|
1684
|
-
default:
|
|
1685
|
-
reader.skipField();
|
|
1686
|
-
break;
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1689
|
-
return msg;
|
|
1690
|
-
};
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
/**
|
|
1694
|
-
* Serializes the message to binary data (in protobuf wire format).
|
|
1695
|
-
* @return {!Uint8Array}
|
|
1696
|
-
*/
|
|
1697
|
-
proto.gateway.parallax.v1.CreateTraceResponse.prototype.serializeBinary = function() {
|
|
1698
|
-
var writer = new jspb.BinaryWriter();
|
|
1699
|
-
proto.gateway.parallax.v1.CreateTraceResponse.serializeBinaryToWriter(this, writer);
|
|
1700
|
-
return writer.getResultBuffer();
|
|
1701
|
-
};
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
/**
|
|
1705
|
-
* Serializes the given message to binary data (in protobuf wire
|
|
1706
|
-
* format), writing to the given BinaryWriter.
|
|
1707
|
-
* @param {!proto.gateway.parallax.v1.CreateTraceResponse} message
|
|
1708
|
-
* @param {!jspb.BinaryWriter} writer
|
|
1709
|
-
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
1710
|
-
*/
|
|
1711
|
-
proto.gateway.parallax.v1.CreateTraceResponse.serializeBinaryToWriter = function(message, writer) {
|
|
1712
|
-
var f = undefined;
|
|
1713
|
-
f = message.getStatus();
|
|
1714
|
-
if (f != null) {
|
|
1715
|
-
writer.writeMessage(
|
|
1716
|
-
1,
|
|
1717
|
-
f,
|
|
1718
|
-
proto_common_v1_status_pb.ResponseStatus.serializeBinaryToWriter
|
|
1719
|
-
);
|
|
1720
|
-
}
|
|
1721
|
-
f = message.getTraceId();
|
|
1722
|
-
if (f.length > 0) {
|
|
1723
|
-
writer.writeString(
|
|
1724
|
-
2,
|
|
1725
|
-
f
|
|
1726
|
-
);
|
|
1727
|
-
}
|
|
1728
|
-
};
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
/**
|
|
1732
|
-
* optional common.v1.ResponseStatus status = 1;
|
|
1733
|
-
* @return {?proto.common.v1.ResponseStatus}
|
|
1734
|
-
*/
|
|
1735
|
-
proto.gateway.parallax.v1.CreateTraceResponse.prototype.getStatus = function() {
|
|
1736
|
-
return /** @type{?proto.common.v1.ResponseStatus} */ (
|
|
1737
|
-
jspb.Message.getWrapperField(this, proto_common_v1_status_pb.ResponseStatus, 1));
|
|
1738
|
-
};
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
/**
|
|
1742
|
-
* @param {?proto.common.v1.ResponseStatus|undefined} value
|
|
1743
|
-
* @return {!proto.gateway.parallax.v1.CreateTraceResponse} returns this
|
|
1744
|
-
*/
|
|
1745
|
-
proto.gateway.parallax.v1.CreateTraceResponse.prototype.setStatus = function(value) {
|
|
1746
|
-
return jspb.Message.setWrapperField(this, 1, value);
|
|
1747
|
-
};
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
/**
|
|
1751
|
-
* Clears the message field making it undefined.
|
|
1752
|
-
* @return {!proto.gateway.parallax.v1.CreateTraceResponse} returns this
|
|
1753
|
-
*/
|
|
1754
|
-
proto.gateway.parallax.v1.CreateTraceResponse.prototype.clearStatus = function() {
|
|
1755
|
-
return this.setStatus(undefined);
|
|
1756
|
-
};
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
/**
|
|
1760
|
-
* Returns whether this field is set.
|
|
1761
|
-
* @return {boolean}
|
|
1762
|
-
*/
|
|
1763
|
-
proto.gateway.parallax.v1.CreateTraceResponse.prototype.hasStatus = function() {
|
|
1764
|
-
return jspb.Message.getField(this, 1) != null;
|
|
1765
|
-
};
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
/**
|
|
1769
|
-
* optional string trace_id = 2;
|
|
1770
|
-
* @return {string}
|
|
1771
|
-
*/
|
|
1772
|
-
proto.gateway.parallax.v1.CreateTraceResponse.prototype.getTraceId = function() {
|
|
1773
|
-
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
1774
|
-
};
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
/**
|
|
1778
|
-
* @param {string} value
|
|
1779
|
-
* @return {!proto.gateway.parallax.v1.CreateTraceResponse} returns this
|
|
1780
|
-
*/
|
|
1781
|
-
proto.gateway.parallax.v1.CreateTraceResponse.prototype.setTraceId = function(value) {
|
|
1782
|
-
return jspb.Message.setProto3StringField(this, 2, value);
|
|
1783
|
-
};
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
goog.object.extend(exports$1, proto.gateway.parallax.v1);
|
|
1787
|
-
} (parallax_gateway_pb));
|
|
1788
|
-
return parallax_gateway_pb;
|
|
1789
|
-
}
|
|
1790
|
-
|
|
1791
|
-
var parallax_gateway_pbExports = requireParallax_gateway_pb();
|
|
1792
|
-
|
|
1793
|
-
var grpcWeb = {};
|
|
1794
|
-
|
|
1795
|
-
/*
|
|
1796
|
-
|
|
1797
|
-
Copyright The Closure Library Authors.
|
|
1798
|
-
SPDX-License-Identifier: Apache-2.0
|
|
1799
|
-
*/
|
|
1800
|
-
|
|
1801
|
-
var hasRequiredGrpcWeb;
|
|
1802
|
-
|
|
1803
|
-
function requireGrpcWeb () {
|
|
1804
|
-
if (hasRequiredGrpcWeb) return grpcWeb;
|
|
1805
|
-
hasRequiredGrpcWeb = 1;
|
|
1806
|
-
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)}
|
|
1807
|
-
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)}
|
|
1808
|
-
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]);
|
|
1809
|
-
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}}
|
|
1810
|
-
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";
|
|
1811
|
-
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"});
|
|
1812
|
-
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||
|
|
1813
|
-
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);};
|
|
1814
|
-
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--));}}
|
|
1815
|
-
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);}
|
|
1816
|
-
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.");}}
|
|
1817
|
-
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));}
|
|
1818
|
-
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}
|
|
1819
|
-
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);};
|
|
1820
|
-
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;}
|
|
1821
|
-
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;}
|
|
1822
|
-
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}
|
|
1823
|
-
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"];
|
|
1824
|
-
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
|
|
1825
|
-
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: "+
|
|
1826
|
-
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"));}
|
|
1827
|
-
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);};
|
|
1828
|
-
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,
|
|
1829
|
-
-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);}}}
|
|
1830
|
-
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}};
|
|
1831
|
-
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}}
|
|
1832
|
-
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}
|
|
1833
|
-
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));}}
|
|
1834
|
-
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);}
|
|
1835
|
-
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",
|
|
1836
|
-
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]);
|
|
1837
|
-
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)||
|
|
1838
|
-
(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,
|
|
1839
|
-
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)}
|
|
1840
|
-
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);});}
|
|
1841
|
-
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")),
|
|
1842
|
-
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+
|
|
1843
|
-
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++]=
|
|
1844
|
-
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}
|
|
1845
|
-
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())}
|
|
1846
|
-
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);
|
|
1847
|
-
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"};
|
|
1848
|
-
rb=typeof globalThis!=="undefined"&&globalThis||self;
|
|
1849
|
-
return grpcWeb;
|
|
1850
|
-
}
|
|
1851
|
-
|
|
1852
|
-
var grpcWebExports = requireGrpcWeb();
|
|
1864
|
+
var parallax_gateway_pbExports = requireParallax_gateway_pb();
|
|
1853
1865
|
|
|
1854
1866
|
/**
|
|
1855
1867
|
* @fileoverview gRPC-Web generated client stub for gateway.parallax.v1
|
|
@@ -1917,210 +1929,171 @@ class ParallaxGatewayServiceClient {
|
|
|
1917
1929
|
}
|
|
1918
1930
|
}
|
|
1919
1931
|
|
|
1932
|
+
var status_pbExports = requireStatus_pb();
|
|
1933
|
+
|
|
1920
1934
|
var timestamp_pbExports = requireTimestamp_pb();
|
|
1921
1935
|
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
value: apiKey
|
|
1935
|
-
});
|
|
1936
|
-
Object.defineProperty(this, "apiUrl", {
|
|
1937
|
-
enumerable: true,
|
|
1938
|
-
configurable: true,
|
|
1939
|
-
writable: true,
|
|
1940
|
-
value: GRPC_GATEWAY_API_URL
|
|
1941
|
-
});
|
|
1942
|
-
Object.defineProperty(this, "client", {
|
|
1943
|
-
enumerable: true,
|
|
1944
|
-
configurable: true,
|
|
1945
|
-
writable: true,
|
|
1946
|
-
value: void 0
|
|
1947
|
-
});
|
|
1948
|
-
if (apiUrl) {
|
|
1949
|
-
this.apiUrl = apiUrl;
|
|
1950
|
-
}
|
|
1951
|
-
// Create credentials object with API key if provided
|
|
1952
|
-
const credentials = apiKey ? { 'x-parallax-api-key': apiKey } : undefined;
|
|
1953
|
-
// Initialize the gRPC-Web client
|
|
1954
|
-
this.client = new ParallaxGatewayServiceClient(this.apiUrl, credentials);
|
|
1936
|
+
/**
|
|
1937
|
+
* Browser metadata collection utilities
|
|
1938
|
+
*/
|
|
1939
|
+
/**
|
|
1940
|
+
* Detect browser name and version from user agent
|
|
1941
|
+
*/
|
|
1942
|
+
function detectBrowser(ua) {
|
|
1943
|
+
if (ua.includes('Edg/')) {
|
|
1944
|
+
return {
|
|
1945
|
+
name: 'Edge',
|
|
1946
|
+
version: ua.match(/Edg\/(\d+(\.\d+)?)/)?.[1] || 'unknown',
|
|
1947
|
+
};
|
|
1955
1948
|
}
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
*/
|
|
1962
|
-
async getClientMetadata() {
|
|
1963
|
-
const metadata = {};
|
|
1964
|
-
// Browser info
|
|
1965
|
-
metadata.userAgent = navigator.userAgent;
|
|
1966
|
-
metadata.platform = navigator.platform;
|
|
1967
|
-
metadata.language = navigator.language;
|
|
1968
|
-
// Screen info
|
|
1969
|
-
metadata.screenWidth = window.screen.width.toString();
|
|
1970
|
-
metadata.screenHeight = window.screen.height.toString();
|
|
1971
|
-
metadata.viewportWidth = window.innerWidth.toString();
|
|
1972
|
-
metadata.viewportHeight = window.innerHeight.toString();
|
|
1973
|
-
// Try to get IP address (non-blocking)
|
|
1974
|
-
// Note: This may be blocked by Content Security Policy (CSP)
|
|
1975
|
-
// If blocked, the backend should capture IP from request headers instead
|
|
1976
|
-
try {
|
|
1977
|
-
// Use ipify API (simple and fast JSON response)
|
|
1978
|
-
const ipResponse = await fetch('https://api.ipify.org?format=json');
|
|
1979
|
-
if (ipResponse && ipResponse.ok) {
|
|
1980
|
-
const data = await ipResponse.json();
|
|
1981
|
-
if (data && data.ip) {
|
|
1982
|
-
metadata.ip = data.ip;
|
|
1983
|
-
}
|
|
1984
|
-
else {
|
|
1985
|
-
metadata.ip = 'client_unavailable';
|
|
1986
|
-
}
|
|
1987
|
-
}
|
|
1988
|
-
else {
|
|
1989
|
-
metadata.ip = 'client_unavailable';
|
|
1990
|
-
}
|
|
1991
|
-
}
|
|
1992
|
-
catch (error) {
|
|
1993
|
-
// IP lookup failed (CSP block, timeout, or network error)
|
|
1994
|
-
// This is expected if CSP blocks external requests
|
|
1995
|
-
// Backend should capture IP from request headers instead
|
|
1996
|
-
if (error instanceof Error && error.message.includes('Content Security Policy')) {
|
|
1997
|
-
console.debug('IP fetch blocked by CSP - backend will capture from headers');
|
|
1998
|
-
}
|
|
1999
|
-
else {
|
|
2000
|
-
console.debug('Could not fetch IP address');
|
|
2001
|
-
}
|
|
2002
|
-
metadata.ip = 'client_unavailable';
|
|
2003
|
-
}
|
|
2004
|
-
// Browser details (parse from user agent)
|
|
2005
|
-
const ua = navigator.userAgent;
|
|
2006
|
-
if (ua.includes('Chrome')) {
|
|
2007
|
-
metadata.browser = 'Chrome';
|
|
2008
|
-
}
|
|
2009
|
-
else if (ua.includes('Firefox')) {
|
|
2010
|
-
metadata.browser = 'Firefox';
|
|
2011
|
-
}
|
|
2012
|
-
else if (ua.includes('Safari')) {
|
|
2013
|
-
metadata.browser = 'Safari';
|
|
2014
|
-
}
|
|
2015
|
-
else if (ua.includes('Edge')) {
|
|
2016
|
-
metadata.browser = 'Edge';
|
|
2017
|
-
}
|
|
2018
|
-
else {
|
|
2019
|
-
metadata.browser = 'Unknown';
|
|
2020
|
-
}
|
|
2021
|
-
// OS detection
|
|
2022
|
-
if (ua.includes('Windows')) {
|
|
2023
|
-
metadata.os = 'Windows';
|
|
2024
|
-
}
|
|
2025
|
-
else if (ua.includes('Mac')) {
|
|
2026
|
-
metadata.os = 'macOS';
|
|
2027
|
-
}
|
|
2028
|
-
else if (ua.includes('Linux')) {
|
|
2029
|
-
metadata.os = 'Linux';
|
|
2030
|
-
}
|
|
2031
|
-
else if (ua.includes('Android')) {
|
|
2032
|
-
metadata.os = 'Android';
|
|
2033
|
-
}
|
|
2034
|
-
else if (ua.includes('iOS')) {
|
|
2035
|
-
metadata.os = 'iOS';
|
|
2036
|
-
}
|
|
2037
|
-
else {
|
|
2038
|
-
metadata.os = 'Unknown';
|
|
2039
|
-
}
|
|
2040
|
-
// Timezone
|
|
2041
|
-
metadata.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
2042
|
-
metadata.timezoneOffset = new Date().getTimezoneOffset().toString();
|
|
2043
|
-
// Page info
|
|
2044
|
-
metadata.url = window.location.href;
|
|
2045
|
-
metadata.referrer = document.referrer || 'direct';
|
|
2046
|
-
return metadata;
|
|
1949
|
+
if (ua.includes('Chrome/')) {
|
|
1950
|
+
return {
|
|
1951
|
+
name: 'Chrome',
|
|
1952
|
+
version: ua.match(/Chrome\/(\d+(\.\d+)?)/)?.[1] || 'unknown',
|
|
1953
|
+
};
|
|
2047
1954
|
}
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
* @param includeClientMeta optional flag to include client metadata (ip, browser, os, etc)
|
|
2054
|
-
* @returns a CreateTraceRequest object to be used for the createTrace request
|
|
2055
|
-
*/
|
|
2056
|
-
async createTraceRequest({ name, tags, attr, includeClientMeta = false }) {
|
|
2057
|
-
const createTraceReq = new parallax_gateway_pbExports.CreateTraceRequest();
|
|
2058
|
-
createTraceReq.setName(name);
|
|
2059
|
-
if (tags) {
|
|
2060
|
-
createTraceReq.setTagsList(tags);
|
|
2061
|
-
}
|
|
2062
|
-
const traceAttrs = createTraceReq.getAttributesMap();
|
|
2063
|
-
if (attr) {
|
|
2064
|
-
Object.entries(attr).forEach(([key, value]) => {
|
|
2065
|
-
if (key.includes('client.')) {
|
|
2066
|
-
console.warn(`Attribute key "${key}" is reserved for client metadata. It will be prefixed with "custom."`);
|
|
2067
|
-
}
|
|
2068
|
-
else {
|
|
2069
|
-
traceAttrs.set(key, typeof value === 'object' ? JSON.stringify(value) : String(value));
|
|
2070
|
-
}
|
|
2071
|
-
});
|
|
2072
|
-
}
|
|
2073
|
-
if (includeClientMeta) {
|
|
2074
|
-
const clientMetadata = await this.getClientMetadata();
|
|
2075
|
-
Object.entries(clientMetadata).forEach(([key, value]) => {
|
|
2076
|
-
traceAttrs.set(`client.${key}`, value);
|
|
2077
|
-
});
|
|
2078
|
-
}
|
|
2079
|
-
return createTraceReq;
|
|
1955
|
+
if (ua.includes('Firefox/')) {
|
|
1956
|
+
return {
|
|
1957
|
+
name: 'Firefox',
|
|
1958
|
+
version: ua.match(/Firefox\/(\d+(\.\d+)?)/)?.[1] || 'unknown',
|
|
1959
|
+
};
|
|
2080
1960
|
}
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
1961
|
+
if (ua.includes('Safari/') && !ua.includes('Chrome')) {
|
|
1962
|
+
return {
|
|
1963
|
+
name: 'Safari',
|
|
1964
|
+
version: ua.match(/Version\/(\d+(\.\d+)?)/)?.[1] || 'unknown',
|
|
1965
|
+
};
|
|
1966
|
+
}
|
|
1967
|
+
return { name: 'Unknown', version: 'unknown' };
|
|
1968
|
+
}
|
|
1969
|
+
/**
|
|
1970
|
+
* Detect operating system name and version from user agent
|
|
1971
|
+
*/
|
|
1972
|
+
function detectOS(ua) {
|
|
1973
|
+
if (ua.includes('Windows NT')) {
|
|
1974
|
+
const ntVersion = ua.match(/Windows NT (\d+\.\d+)/)?.[1];
|
|
1975
|
+
return {
|
|
1976
|
+
name: 'Windows',
|
|
1977
|
+
version: ntVersion === '10.0' ? '10/11' : ntVersion || 'unknown',
|
|
1978
|
+
};
|
|
1979
|
+
}
|
|
1980
|
+
if (ua.includes('Mac OS X')) {
|
|
1981
|
+
return {
|
|
1982
|
+
name: 'macOS',
|
|
1983
|
+
version: ua.match(/Mac OS X (\d+[._]\d+)/)?.[1]?.replace('_', '.') || 'unknown',
|
|
1984
|
+
};
|
|
1985
|
+
}
|
|
1986
|
+
if (ua.includes('Android')) {
|
|
1987
|
+
return {
|
|
1988
|
+
name: 'Android',
|
|
1989
|
+
version: ua.match(/Android (\d+(\.\d+)?)/)?.[1] || 'unknown',
|
|
1990
|
+
};
|
|
1991
|
+
}
|
|
1992
|
+
if (ua.includes('iPhone') || ua.includes('iPad')) {
|
|
1993
|
+
return {
|
|
1994
|
+
name: 'iOS',
|
|
1995
|
+
version: ua.match(/OS (\d+[._]\d+)/)?.[1]?.replace('_', '.') || 'unknown',
|
|
1996
|
+
};
|
|
1997
|
+
}
|
|
1998
|
+
if (ua.includes('Linux')) {
|
|
1999
|
+
return { name: 'Linux', version: 'unknown' };
|
|
2000
|
+
}
|
|
2001
|
+
return { name: 'Unknown', version: 'unknown' };
|
|
2002
|
+
}
|
|
2003
|
+
/**
|
|
2004
|
+
* Detect device type from user agent
|
|
2005
|
+
*/
|
|
2006
|
+
function detectDeviceType(ua) {
|
|
2007
|
+
if (/Mobile|Android|iPhone|iPad|iPod/i.test(ua)) {
|
|
2008
|
+
return /iPad|Tablet/i.test(ua) ? 'tablet' : 'mobile';
|
|
2009
|
+
}
|
|
2010
|
+
return 'desktop';
|
|
2011
|
+
}
|
|
2012
|
+
/**
|
|
2013
|
+
* Gather client metadata from the browser environment
|
|
2014
|
+
* Note: IP address is captured by the backend from request headers
|
|
2015
|
+
*/
|
|
2016
|
+
function getClientMetadata() {
|
|
2017
|
+
const metadata = {};
|
|
2018
|
+
const ua = navigator.userAgent;
|
|
2019
|
+
// Browser detection
|
|
2020
|
+
const browser = detectBrowser(ua);
|
|
2021
|
+
metadata.browser = browser.name;
|
|
2022
|
+
metadata.browserVersion = browser.version;
|
|
2023
|
+
// OS detection
|
|
2024
|
+
const os = detectOS(ua);
|
|
2025
|
+
metadata.os = os.name;
|
|
2026
|
+
metadata.osVersion = os.version;
|
|
2027
|
+
// Device type
|
|
2028
|
+
metadata.deviceType = detectDeviceType(ua);
|
|
2029
|
+
// Core browser info
|
|
2030
|
+
metadata.userAgent = ua;
|
|
2031
|
+
metadata.language = navigator.language;
|
|
2032
|
+
metadata.languages = navigator.languages?.join(',') || navigator.language;
|
|
2033
|
+
// Screen and display
|
|
2034
|
+
metadata.screenWidth = window.screen.width.toString();
|
|
2035
|
+
metadata.screenHeight = window.screen.height.toString();
|
|
2036
|
+
metadata.viewportWidth = window.innerWidth.toString();
|
|
2037
|
+
metadata.viewportHeight = window.innerHeight.toString();
|
|
2038
|
+
metadata.colorDepth = window.screen.colorDepth.toString();
|
|
2039
|
+
metadata.pixelRatio = window.devicePixelRatio?.toString() || '1';
|
|
2040
|
+
// Hardware capabilities
|
|
2041
|
+
metadata.cpuCores = navigator.hardwareConcurrency?.toString() || 'unknown';
|
|
2042
|
+
const nav = navigator;
|
|
2043
|
+
if (nav.deviceMemory) {
|
|
2044
|
+
metadata.deviceMemory = nav.deviceMemory.toString();
|
|
2045
|
+
}
|
|
2046
|
+
// Touch support
|
|
2047
|
+
metadata.touchSupport = ('ontouchstart' in window || navigator.maxTouchPoints > 0).toString();
|
|
2048
|
+
metadata.maxTouchPoints = navigator.maxTouchPoints?.toString() || '0';
|
|
2049
|
+
// Connection info (Network Information API - non-standard)
|
|
2050
|
+
const connection = navigator.connection;
|
|
2051
|
+
if (connection) {
|
|
2052
|
+
metadata.connectionType = connection.effectiveType || 'unknown';
|
|
2053
|
+
if (connection.downlink) {
|
|
2054
|
+
metadata.connectionSpeed = connection.downlink.toString();
|
|
2089
2055
|
}
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
throw _error;
|
|
2056
|
+
if (connection.saveData !== undefined) {
|
|
2057
|
+
metadata.dataSaver = connection.saveData.toString();
|
|
2093
2058
|
}
|
|
2094
2059
|
}
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
* @param name The name of the trace
|
|
2111
|
-
* @param includeClientMeta Optional flag to automatically include client metadata
|
|
2112
|
-
* @returns A ParallaxTrace builder instance
|
|
2113
|
-
*/
|
|
2114
|
-
trace(name, includeClientMeta = false) {
|
|
2115
|
-
return new ParallaxTrace(this, name, includeClientMeta);
|
|
2116
|
-
}
|
|
2060
|
+
// Browser state
|
|
2061
|
+
metadata.cookiesEnabled = navigator.cookieEnabled.toString();
|
|
2062
|
+
metadata.online = navigator.onLine.toString();
|
|
2063
|
+
metadata.doNotTrack = navigator.doNotTrack || 'unspecified';
|
|
2064
|
+
// Timezone
|
|
2065
|
+
metadata.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
2066
|
+
metadata.timezoneOffset = new Date().getTimezoneOffset().toString();
|
|
2067
|
+
// Page context
|
|
2068
|
+
metadata.url = window.location.href;
|
|
2069
|
+
metadata.origin = window.location.origin;
|
|
2070
|
+
metadata.pathname = window.location.pathname;
|
|
2071
|
+
metadata.referrer = document.referrer || 'direct';
|
|
2072
|
+
// Document state
|
|
2073
|
+
metadata.documentVisibility = document.visibilityState;
|
|
2074
|
+
return metadata;
|
|
2117
2075
|
}
|
|
2076
|
+
|
|
2077
|
+
/**
|
|
2078
|
+
* ParallaxTrace builder class for constructing traces with method chaining
|
|
2079
|
+
*/
|
|
2080
|
+
/**
|
|
2081
|
+
* Maps chain names to proto Chain enum values
|
|
2082
|
+
*/
|
|
2083
|
+
const CHAIN_MAP = {
|
|
2084
|
+
ethereum: parallax_gateway_pbExports.Chain.CHAIN_ETHEREUM,
|
|
2085
|
+
polygon: parallax_gateway_pbExports.Chain.CHAIN_POLYGON,
|
|
2086
|
+
arbitrum: parallax_gateway_pbExports.Chain.CHAIN_ARBITRUM,
|
|
2087
|
+
base: parallax_gateway_pbExports.Chain.CHAIN_BASE,
|
|
2088
|
+
optimism: parallax_gateway_pbExports.Chain.CHAIN_OPTIMISM,
|
|
2089
|
+
bsc: parallax_gateway_pbExports.Chain.CHAIN_BSC,
|
|
2090
|
+
};
|
|
2118
2091
|
/**
|
|
2119
2092
|
* Builder class for constructing traces with method chaining
|
|
2120
2093
|
* Automatically handles web-specific features like client metadata
|
|
2121
2094
|
*/
|
|
2122
2095
|
class ParallaxTrace {
|
|
2123
|
-
constructor(client, name, includeClientMeta =
|
|
2096
|
+
constructor(client, name = '', includeClientMeta = true) {
|
|
2124
2097
|
Object.defineProperty(this, "name", {
|
|
2125
2098
|
enumerable: true,
|
|
2126
2099
|
configurable: true,
|
|
@@ -2170,21 +2143,27 @@ class ParallaxTrace {
|
|
|
2170
2143
|
/**
|
|
2171
2144
|
* Add an attribute to the trace
|
|
2172
2145
|
* @param key Attribute key
|
|
2173
|
-
* @param value Attribute value (
|
|
2146
|
+
* @param value Attribute value (objects are stringified, primitives converted to string)
|
|
2174
2147
|
* @returns This trace builder for chaining
|
|
2175
2148
|
*/
|
|
2176
2149
|
addAttribute(key, value) {
|
|
2177
|
-
this.attributes[key] =
|
|
2150
|
+
this.attributes[key] =
|
|
2151
|
+
typeof value === 'object' && value !== null
|
|
2152
|
+
? JSON.stringify(value)
|
|
2153
|
+
: String(value);
|
|
2178
2154
|
return this;
|
|
2179
2155
|
}
|
|
2180
2156
|
/**
|
|
2181
2157
|
* Add multiple attributes to the trace
|
|
2182
|
-
* @param attributes Object containing key-value pairs
|
|
2158
|
+
* @param attributes Object containing key-value pairs (objects are stringified)
|
|
2183
2159
|
* @returns This trace builder for chaining
|
|
2184
2160
|
*/
|
|
2185
2161
|
addAttributes(attributes) {
|
|
2186
2162
|
for (const [key, value] of Object.entries(attributes)) {
|
|
2187
|
-
this.attributes[key] =
|
|
2163
|
+
this.attributes[key] =
|
|
2164
|
+
typeof value === 'object' && value !== null
|
|
2165
|
+
? JSON.stringify(value)
|
|
2166
|
+
: String(value);
|
|
2188
2167
|
}
|
|
2189
2168
|
return this;
|
|
2190
2169
|
}
|
|
@@ -2225,30 +2204,26 @@ class ParallaxTrace {
|
|
|
2225
2204
|
return this;
|
|
2226
2205
|
}
|
|
2227
2206
|
/**
|
|
2228
|
-
* Set
|
|
2207
|
+
* Set the transaction hash hint for blockchain correlation
|
|
2229
2208
|
* @param txHash Transaction hash
|
|
2230
|
-
* @param
|
|
2209
|
+
* @param chain Chain name (e.g., "ethereum", "polygon", "base")
|
|
2231
2210
|
* @param details Optional details about the transaction
|
|
2232
|
-
* @param timestamp Optional timestamp (defaults to current time)
|
|
2233
2211
|
* @returns This trace builder for chaining
|
|
2234
2212
|
*/
|
|
2235
|
-
|
|
2213
|
+
setTxHint(txHash, chain, details) {
|
|
2236
2214
|
this.txHashHint = {
|
|
2237
2215
|
txHash,
|
|
2238
|
-
|
|
2216
|
+
chain,
|
|
2239
2217
|
details,
|
|
2240
|
-
timestamp:
|
|
2218
|
+
timestamp: new Date(),
|
|
2241
2219
|
};
|
|
2242
2220
|
return this;
|
|
2243
2221
|
}
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
details,
|
|
2250
|
-
timestamp: new Date(),
|
|
2251
|
-
} : this.txHashHint;
|
|
2222
|
+
/**
|
|
2223
|
+
* Create and submit the trace to the gateway
|
|
2224
|
+
* @returns The trace ID if successful, undefined if failed
|
|
2225
|
+
*/
|
|
2226
|
+
async create() {
|
|
2252
2227
|
// Build the CreateTraceRequest
|
|
2253
2228
|
const request = new parallax_gateway_pbExports.CreateTraceRequest();
|
|
2254
2229
|
request.setName(this.name);
|
|
@@ -2260,7 +2235,7 @@ class ParallaxTrace {
|
|
|
2260
2235
|
}
|
|
2261
2236
|
// Add client metadata if requested
|
|
2262
2237
|
if (this.includeClientMeta) {
|
|
2263
|
-
const clientMetadata =
|
|
2238
|
+
const clientMetadata = getClientMetadata();
|
|
2264
2239
|
for (const [key, value] of Object.entries(clientMetadata)) {
|
|
2265
2240
|
attrsMap.set(`client.${key}`, value);
|
|
2266
2241
|
}
|
|
@@ -2268,8 +2243,8 @@ class ParallaxTrace {
|
|
|
2268
2243
|
// Add events
|
|
2269
2244
|
const eventsList = [];
|
|
2270
2245
|
for (const event of this.events) {
|
|
2271
|
-
const eventMsg = new parallax_gateway_pbExports.
|
|
2272
|
-
eventMsg.
|
|
2246
|
+
const eventMsg = new parallax_gateway_pbExports.Event();
|
|
2247
|
+
eventMsg.setName(event.eventName);
|
|
2273
2248
|
if (event.details) {
|
|
2274
2249
|
eventMsg.setDetails(event.details);
|
|
2275
2250
|
}
|
|
@@ -2280,368 +2255,104 @@ class ParallaxTrace {
|
|
|
2280
2255
|
}
|
|
2281
2256
|
request.setEventsList(eventsList);
|
|
2282
2257
|
// Add transaction hash hint if present
|
|
2283
|
-
if (
|
|
2284
|
-
const txHint = new parallax_gateway_pbExports.
|
|
2285
|
-
txHint.setTxHash(
|
|
2286
|
-
txHint.
|
|
2287
|
-
if (
|
|
2288
|
-
txHint.setDetails(
|
|
2258
|
+
if (this.txHashHint) {
|
|
2259
|
+
const txHint = new parallax_gateway_pbExports.TxHashHint();
|
|
2260
|
+
txHint.setTxHash(this.txHashHint.txHash);
|
|
2261
|
+
txHint.setChain(CHAIN_MAP[this.txHashHint.chain]);
|
|
2262
|
+
if (this.txHashHint.details) {
|
|
2263
|
+
txHint.setDetails(this.txHashHint.details);
|
|
2289
2264
|
}
|
|
2290
2265
|
const timestamp = new timestamp_pbExports.Timestamp();
|
|
2291
|
-
timestamp.fromDate(
|
|
2266
|
+
timestamp.fromDate(this.txHashHint.timestamp);
|
|
2292
2267
|
txHint.setTimestamp(timestamp);
|
|
2293
2268
|
request.setTxHashHint(txHint);
|
|
2294
2269
|
}
|
|
2295
|
-
return this.client.createTrace(request);
|
|
2296
|
-
}
|
|
2297
|
-
}
|
|
2298
|
-
|
|
2299
|
-
class GrpcWebRpc {
|
|
2300
|
-
constructor(url, apiKey) {
|
|
2301
|
-
Object.defineProperty(this, "url", {
|
|
2302
|
-
enumerable: true,
|
|
2303
|
-
configurable: true,
|
|
2304
|
-
writable: true,
|
|
2305
|
-
value: void 0
|
|
2306
|
-
});
|
|
2307
|
-
Object.defineProperty(this, "apiKey", {
|
|
2308
|
-
enumerable: true,
|
|
2309
|
-
configurable: true,
|
|
2310
|
-
writable: true,
|
|
2311
|
-
value: void 0
|
|
2312
|
-
});
|
|
2313
|
-
this.url = url;
|
|
2314
|
-
this.apiKey = apiKey;
|
|
2315
|
-
}
|
|
2316
|
-
async request(service, method, data, metadata) {
|
|
2317
|
-
console.log(`[gRPC-Web] Making request to ${this.url}/${service}/${method}`);
|
|
2318
|
-
const headers = {
|
|
2319
|
-
'Content-Type': 'application/grpc-web+proto',
|
|
2320
|
-
'X-Grpc-Web': '1',
|
|
2321
|
-
};
|
|
2322
|
-
// Add API key to headers if provided
|
|
2323
|
-
if (this.apiKey) {
|
|
2324
|
-
headers['x-parallax-api-key'] = this.apiKey;
|
|
2325
|
-
}
|
|
2326
|
-
// Add custom metadata
|
|
2327
|
-
if (metadata) {
|
|
2328
|
-
Object.entries(metadata).forEach(([key, value]) => {
|
|
2329
|
-
headers[key] = value;
|
|
2330
|
-
});
|
|
2331
|
-
}
|
|
2332
2270
|
try {
|
|
2333
|
-
const response = await
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
if (!response.ok) {
|
|
2339
|
-
const errorText = await response.text();
|
|
2340
|
-
throw new Error(`gRPC-Web error: ${response.status} ${response.statusText} - ${errorText}`);
|
|
2271
|
+
const response = await this.client._sendTrace(request);
|
|
2272
|
+
const responseStatus = response.getStatus();
|
|
2273
|
+
if (responseStatus?.getCode() !== status_pbExports.ResponseStatus.StatusCode.STATUS_CODE_SUCCESS) {
|
|
2274
|
+
console.log('[ParallaxTrace] Error:', responseStatus?.getErrorMessage() || 'Unknown error');
|
|
2275
|
+
return undefined;
|
|
2341
2276
|
}
|
|
2342
|
-
|
|
2343
|
-
console.log(`[gRPC-Web] Success from ${this.url}/${service}/${method}`);
|
|
2344
|
-
return new Uint8Array(arrayBuffer);
|
|
2277
|
+
return response.getTraceId();
|
|
2345
2278
|
}
|
|
2346
2279
|
catch (error) {
|
|
2347
|
-
console.
|
|
2348
|
-
|
|
2280
|
+
console.log('[ParallaxTrace] Error creating trace:', error);
|
|
2281
|
+
return undefined;
|
|
2349
2282
|
}
|
|
2350
2283
|
}
|
|
2351
|
-
clientStreamingRequest() {
|
|
2352
|
-
throw new Error("Client streaming not yet implemented for gRPC-Web");
|
|
2353
|
-
}
|
|
2354
|
-
serverStreamingRequest(service, method, data) {
|
|
2355
|
-
return new Observable((subscriber) => {
|
|
2356
|
-
const headers = {
|
|
2357
|
-
'Content-Type': 'application/grpc-web+proto',
|
|
2358
|
-
'X-Grpc-Web': '1',
|
|
2359
|
-
};
|
|
2360
|
-
// Add API key to headers if provided
|
|
2361
|
-
if (this.apiKey) {
|
|
2362
|
-
headers['x-parallax-api-key'] = this.apiKey;
|
|
2363
|
-
}
|
|
2364
|
-
fetch(`${this.url}/${service}/${method}`, {
|
|
2365
|
-
method: 'POST',
|
|
2366
|
-
headers,
|
|
2367
|
-
body: data.buffer,
|
|
2368
|
-
})
|
|
2369
|
-
.then(async (response) => {
|
|
2370
|
-
if (!response.ok) {
|
|
2371
|
-
throw new Error(`gRPC-Web error: ${response.status} ${response.statusText}`);
|
|
2372
|
-
}
|
|
2373
|
-
if (!response.body) {
|
|
2374
|
-
throw new Error('Response body is null');
|
|
2375
|
-
}
|
|
2376
|
-
const reader = response.body.getReader();
|
|
2377
|
-
try {
|
|
2378
|
-
while (true) {
|
|
2379
|
-
const { done, value } = await reader.read();
|
|
2380
|
-
if (done) {
|
|
2381
|
-
subscriber.complete();
|
|
2382
|
-
break;
|
|
2383
|
-
}
|
|
2384
|
-
if (value) {
|
|
2385
|
-
subscriber.next(value);
|
|
2386
|
-
}
|
|
2387
|
-
}
|
|
2388
|
-
}
|
|
2389
|
-
catch (error) {
|
|
2390
|
-
subscriber.error(error);
|
|
2391
|
-
}
|
|
2392
|
-
})
|
|
2393
|
-
.catch((error) => {
|
|
2394
|
-
subscriber.error(error);
|
|
2395
|
-
});
|
|
2396
|
-
return () => {
|
|
2397
|
-
// Cleanup logic if needed
|
|
2398
|
-
};
|
|
2399
|
-
});
|
|
2400
|
-
}
|
|
2401
|
-
bidirectionalStreamingRequest() {
|
|
2402
|
-
throw new Error("Bidirectional streaming not yet implemented for gRPC-Web");
|
|
2403
|
-
}
|
|
2404
2284
|
}
|
|
2405
2285
|
|
|
2286
|
+
const DEFAULT_API_URL = 'https://parallax-gateway.dev.mirador.org:443';
|
|
2406
2287
|
/**
|
|
2407
|
-
*
|
|
2408
|
-
* Creates individual traces for each transaction and tracks them through their lifecycle
|
|
2409
|
-
*
|
|
2410
|
-
* This service provides a simplified interface for tracking transactions with automatic
|
|
2411
|
-
* client metadata collection and lifecycle management.
|
|
2288
|
+
* Main client for interacting with the Parallax Gateway API
|
|
2412
2289
|
*/
|
|
2413
|
-
class
|
|
2414
|
-
|
|
2415
|
-
|
|
2290
|
+
class ParallaxClient {
|
|
2291
|
+
/**
|
|
2292
|
+
* Create a new ParallaxClient instance
|
|
2293
|
+
* @param apiKey Required API key for authentication (sent as x-parallax-api-key header)
|
|
2294
|
+
* @param apiUrl Optional gateway URL (defaults to parallax-gateway.dev.mirador.org:443)
|
|
2295
|
+
*/
|
|
2296
|
+
constructor(apiKey, apiUrl) {
|
|
2297
|
+
Object.defineProperty(this, "apiUrl", {
|
|
2416
2298
|
enumerable: true,
|
|
2417
2299
|
configurable: true,
|
|
2418
2300
|
writable: true,
|
|
2419
|
-
value:
|
|
2301
|
+
value: void 0
|
|
2420
2302
|
});
|
|
2421
|
-
Object.defineProperty(this, "
|
|
2303
|
+
Object.defineProperty(this, "apiKey", {
|
|
2422
2304
|
enumerable: true,
|
|
2423
2305
|
configurable: true,
|
|
2424
2306
|
writable: true,
|
|
2425
|
-
value:
|
|
2307
|
+
value: void 0
|
|
2426
2308
|
});
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
* @param gatewayUrl - Optional custom gateway URL
|
|
2433
|
-
*/
|
|
2434
|
-
_ensureClient(apiKey, gatewayUrl) {
|
|
2435
|
-
if (this.client)
|
|
2436
|
-
return;
|
|
2437
|
-
// Determine gateway URL based on environment if not provided
|
|
2438
|
-
let url = gatewayUrl;
|
|
2439
|
-
if (!url && typeof window !== 'undefined') {
|
|
2440
|
-
const isDevelopment = window.location.hostname === 'localhost' ||
|
|
2441
|
-
window.location.hostname === '127.0.0.1';
|
|
2442
|
-
url = isDevelopment
|
|
2443
|
-
? `${window.location.protocol}//${window.location.host}/parallax-gateway`
|
|
2444
|
-
: 'https://gateway-parallax-dev.mirador.org';
|
|
2445
|
-
}
|
|
2446
|
-
this.client = new ParallaxClient(apiKey || '', url);
|
|
2447
|
-
console.log('[ParallaxService] Client initialized with URL:', url);
|
|
2448
|
-
}
|
|
2449
|
-
/**
|
|
2450
|
-
* Start a new transaction trace
|
|
2451
|
-
* Called when user initiates a transaction
|
|
2452
|
-
*
|
|
2453
|
-
* Uses the builder pattern to create a trace with events
|
|
2454
|
-
*
|
|
2455
|
-
* @param txData - Transaction data
|
|
2456
|
-
* @param name - Name for the trace (e.g., 'SendingTrace', 'SwappingTrace')
|
|
2457
|
-
* @param options - Optional configuration (apiKey, gatewayUrl, includeClientMeta)
|
|
2458
|
-
* @returns Promise with traceId, rootSpanId, and txId
|
|
2459
|
-
*/
|
|
2460
|
-
async startTransactionTrace(txData, name = 'WalletTransaction', options) {
|
|
2461
|
-
this._ensureClient(options?.apiKey, options?.gatewayUrl);
|
|
2462
|
-
if (!this.client) {
|
|
2463
|
-
throw new Error('Failed to initialize Parallax client');
|
|
2464
|
-
}
|
|
2465
|
-
try {
|
|
2466
|
-
const txId = `tx_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
2467
|
-
const timestamp = new Date();
|
|
2468
|
-
// Build the trace using the builder pattern
|
|
2469
|
-
const builder = this.client
|
|
2470
|
-
.trace(name, options?.includeClientMeta ?? true)
|
|
2471
|
-
.addAttribute('transactionId', txId)
|
|
2472
|
-
.addAttribute('walletAddress', txData.walletAddress || txData.from)
|
|
2473
|
-
.addAttribute('network', txData.network || 'Unknown')
|
|
2474
|
-
.addAttribute('transactionStart', timestamp.toISOString())
|
|
2475
|
-
.addAttribute('from', txData.from)
|
|
2476
|
-
.addAttribute('to', txData.to)
|
|
2477
|
-
.addAttribute('value', txData.value)
|
|
2478
|
-
.addTags(['transaction', 'wallet', txData.network || 'unknown'])
|
|
2479
|
-
.addEvent('transaction_initiated', {
|
|
2480
|
-
from: txData.from,
|
|
2481
|
-
to: txData.to,
|
|
2482
|
-
value: txData.value,
|
|
2483
|
-
timestamp: timestamp.toISOString(),
|
|
2484
|
-
});
|
|
2485
|
-
// Add any additional transaction data as attributes
|
|
2486
|
-
if (txData.additionalData) {
|
|
2487
|
-
Object.entries(txData.additionalData).forEach(([key, value]) => {
|
|
2488
|
-
builder.addAttribute(key, typeof value === 'object' ? JSON.stringify(value) : String(value));
|
|
2489
|
-
});
|
|
2490
|
-
}
|
|
2491
|
-
// Submit the trace
|
|
2492
|
-
const traceResponse = await builder.submit();
|
|
2493
|
-
const traceId = traceResponse.getTraceId();
|
|
2494
|
-
// Store transaction info
|
|
2495
|
-
this.activeTransactions.set(txId, {
|
|
2496
|
-
traceId,
|
|
2497
|
-
timestamp: timestamp.toISOString(),
|
|
2498
|
-
txHash: null,
|
|
2499
|
-
from: txData.from,
|
|
2500
|
-
to: txData.to,
|
|
2501
|
-
network: txData.network,
|
|
2502
|
-
});
|
|
2503
|
-
console.log('[ParallaxService] Transaction trace started:', {
|
|
2504
|
-
txId,
|
|
2505
|
-
traceId,
|
|
2506
|
-
from: txData.from,
|
|
2507
|
-
to: txData.to,
|
|
2508
|
-
});
|
|
2509
|
-
return { traceId, rootSpanId: traceId, txId };
|
|
2510
|
-
}
|
|
2511
|
-
catch (error) {
|
|
2512
|
-
console.error('[ParallaxService] Failed to start transaction trace:', error);
|
|
2513
|
-
throw error;
|
|
2514
|
-
}
|
|
2515
|
-
}
|
|
2516
|
-
/**
|
|
2517
|
-
* Associate a transaction hash with an existing trace
|
|
2518
|
-
* Called when the transaction hash is available after signing/sending
|
|
2519
|
-
*
|
|
2520
|
-
* NOTE: This method is deprecated as the new API does not support adding hints to existing traces.
|
|
2521
|
-
* Transaction hashes should be provided at trace creation time via the builder's submit(txHash, chainId) method.
|
|
2522
|
-
*
|
|
2523
|
-
* @param txId - Transaction identifier returned from startTransactionTrace
|
|
2524
|
-
* @param txHash - Blockchain transaction hash
|
|
2525
|
-
* @param chainId - Chain ID
|
|
2526
|
-
* @deprecated Use submit(txHash, chainId) when creating the trace instead
|
|
2527
|
-
*/
|
|
2528
|
-
async associateTransactionHash(txId, txHash, chainId) {
|
|
2529
|
-
const txInfo = this.activeTransactions.get(txId);
|
|
2530
|
-
if (!txInfo) {
|
|
2531
|
-
console.warn(`[ParallaxService] Transaction ${txId} not found in active transactions`);
|
|
2532
|
-
return;
|
|
2533
|
-
}
|
|
2534
|
-
// Update stored tx info
|
|
2535
|
-
txInfo.txHash = txHash;
|
|
2536
|
-
this.activeTransactions.set(txId, txInfo);
|
|
2537
|
-
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).');
|
|
2538
|
-
console.log('[ParallaxService] Transaction hash updated in local cache:', {
|
|
2539
|
-
txId,
|
|
2540
|
-
txHash,
|
|
2541
|
-
traceId: txInfo.traceId,
|
|
2309
|
+
Object.defineProperty(this, "client", {
|
|
2310
|
+
enumerable: true,
|
|
2311
|
+
configurable: true,
|
|
2312
|
+
writable: true,
|
|
2313
|
+
value: void 0
|
|
2542
2314
|
});
|
|
2315
|
+
this.apiKey = apiKey;
|
|
2316
|
+
this.apiUrl = apiUrl || DEFAULT_API_URL;
|
|
2317
|
+
// API key is required - always include in credentials
|
|
2318
|
+
const credentials = { 'x-parallax-api-key': apiKey };
|
|
2319
|
+
// Initialize the gRPC-Web client
|
|
2320
|
+
this.client = new ParallaxGatewayServiceClient(this.apiUrl, credentials);
|
|
2543
2321
|
}
|
|
2544
2322
|
/**
|
|
2545
|
-
*
|
|
2546
|
-
*
|
|
2547
|
-
* NOTE: This method is deprecated as the new API does not support adding events to existing traces.
|
|
2548
|
-
* Events should be added to the trace builder before calling submit().
|
|
2549
|
-
*
|
|
2550
|
-
* @param txId - Transaction identifier
|
|
2551
|
-
* @param eventName - Event name
|
|
2552
|
-
* @param attributes - Event attributes
|
|
2553
|
-
* @deprecated Use the trace builder's addEvent() method before calling submit() instead
|
|
2554
|
-
*/
|
|
2555
|
-
async addTransactionEvent(txId, eventName, attributes = {}) {
|
|
2556
|
-
const txInfo = this.activeTransactions.get(txId);
|
|
2557
|
-
if (!txInfo) {
|
|
2558
|
-
console.warn(`[ParallaxService] Transaction ${txId} not found. Cannot add event '${eventName}'`);
|
|
2559
|
-
return;
|
|
2560
|
-
}
|
|
2561
|
-
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().');
|
|
2562
|
-
}
|
|
2563
|
-
/**
|
|
2564
|
-
* Add an error to a transaction trace
|
|
2565
|
-
*
|
|
2566
|
-
* NOTE: This method is deprecated as the new API does not support adding errors to existing traces.
|
|
2567
|
-
* Errors should be added as events to the trace builder before calling submit().
|
|
2568
|
-
*
|
|
2569
|
-
* @param txId - Transaction identifier
|
|
2570
|
-
* @param error - Error object or message
|
|
2571
|
-
* @param errorType - Type/category of error (e.g., 'TransactionError', 'NetworkError', 'UserRejection')
|
|
2572
|
-
* @deprecated Use the trace builder's addEvent() method to add error events before calling submit() instead
|
|
2573
|
-
*/
|
|
2574
|
-
async addTransactionError(txId, error, errorType = 'TransactionError') {
|
|
2575
|
-
const txInfo = this.activeTransactions.get(txId);
|
|
2576
|
-
if (!txInfo) {
|
|
2577
|
-
console.warn(`[ParallaxService] Transaction ${txId} not found. Cannot add error.`);
|
|
2578
|
-
return;
|
|
2579
|
-
}
|
|
2580
|
-
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().');
|
|
2581
|
-
}
|
|
2582
|
-
/**
|
|
2583
|
-
* Finish a transaction trace
|
|
2584
|
-
*
|
|
2585
|
-
* NOTE: This method is deprecated as the new API does not support span lifecycle management.
|
|
2586
|
-
* Traces are completed when submit() is called on the builder.
|
|
2587
|
-
*
|
|
2588
|
-
* @param txId - Transaction identifier
|
|
2589
|
-
* @param options - Finish options (success, error message)
|
|
2590
|
-
* @deprecated Traces are automatically completed when submit() is called
|
|
2323
|
+
* Internal method to send trace to gateway
|
|
2324
|
+
* @internal
|
|
2591
2325
|
*/
|
|
2592
|
-
async
|
|
2593
|
-
const
|
|
2594
|
-
|
|
2595
|
-
console.warn(`[ParallaxService] Transaction ${txId} not found. Cannot finish.`);
|
|
2596
|
-
return;
|
|
2597
|
-
}
|
|
2598
|
-
console.warn('[ParallaxService] finishTransactionTrace is deprecated. The new API does not support span lifecycle. Traces are completed when submit() is called.');
|
|
2599
|
-
console.log('[ParallaxService] Transaction trace marked as finished (local only):', {
|
|
2600
|
-
txId,
|
|
2601
|
-
traceId: txInfo.traceId,
|
|
2602
|
-
success: options.success,
|
|
2603
|
-
txHash: txInfo.txHash,
|
|
2604
|
-
});
|
|
2605
|
-
// Remove from active transactions
|
|
2606
|
-
this.activeTransactions.delete(txId);
|
|
2326
|
+
async _sendTrace(request) {
|
|
2327
|
+
const metadata = { 'x-parallax-api-key': this.apiKey };
|
|
2328
|
+
return await this.client.createTrace(request, metadata);
|
|
2607
2329
|
}
|
|
2608
2330
|
/**
|
|
2609
|
-
*
|
|
2331
|
+
* Create a new trace builder
|
|
2610
2332
|
*
|
|
2611
|
-
*
|
|
2612
|
-
*
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
*
|
|
2333
|
+
* Example usage:
|
|
2334
|
+
* ```typescript
|
|
2335
|
+
* const response = await client.trace("swap_execution")
|
|
2336
|
+
* .addAttribute("user", "0xabc...")
|
|
2337
|
+
* .addAttribute("slippage_bps", 25)
|
|
2338
|
+
* .addTag("dex")
|
|
2339
|
+
* .addTag("swap")
|
|
2340
|
+
* .addEvent("wallet_connected", { wallet: "MetaMask" })
|
|
2341
|
+
* .addEvent("quote_received")
|
|
2342
|
+
* .setTxHint("0x123...", "ethereum")
|
|
2343
|
+
* .create();
|
|
2344
|
+
* ```
|
|
2619
2345
|
*
|
|
2620
|
-
* @
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
return Array.from(this.activeTransactions.entries()).map(([txId, info]) => ({
|
|
2624
|
-
txId,
|
|
2625
|
-
...info,
|
|
2626
|
-
}));
|
|
2627
|
-
}
|
|
2628
|
-
/**
|
|
2629
|
-
* Get the ParallaxClient instance for advanced usage
|
|
2630
|
-
* @param apiKey - Optional API key
|
|
2631
|
-
* @param gatewayUrl - Optional gateway URL
|
|
2346
|
+
* @param name Optional name of the trace (defaults to empty string)
|
|
2347
|
+
* @param includeClientMeta Optional flag to automatically include client metadata
|
|
2348
|
+
* @returns A ParallaxTrace builder instance
|
|
2632
2349
|
*/
|
|
2633
|
-
|
|
2634
|
-
this
|
|
2635
|
-
if (!this.client) {
|
|
2636
|
-
throw new Error('Failed to initialize Parallax client');
|
|
2637
|
-
}
|
|
2638
|
-
return this.client;
|
|
2350
|
+
trace(name = '', includeClientMeta = true) {
|
|
2351
|
+
return new ParallaxTrace(this, name, includeClientMeta);
|
|
2639
2352
|
}
|
|
2640
2353
|
}
|
|
2641
|
-
// Export singleton instance
|
|
2642
|
-
const parallaxService = new ParallaxService();
|
|
2643
2354
|
|
|
2644
2355
|
var CreateTraceRequest = parallax_gateway_pbExports.CreateTraceRequest;
|
|
2645
2356
|
var CreateTraceResponse = parallax_gateway_pbExports.CreateTraceResponse;
|
|
2646
|
-
export { CreateTraceRequest, CreateTraceResponse,
|
|
2357
|
+
export { CreateTraceRequest, CreateTraceResponse, ParallaxClient, ParallaxTrace };
|
|
2647
2358
|
//# sourceMappingURL=index.esm.js.map
|