Allow custom URL format relayers
should be convenient to test locally
This commit is contained in:
parent
c155649719
commit
82aeabd739
7
dist/index.js
vendored
7
dist/index.js
vendored
@ -2611,10 +2611,15 @@ class RelayerClient {
|
|||||||
askRelayerStatus(_0) {
|
askRelayerStatus(_0) {
|
||||||
return __async$9(this, arguments, function* ({
|
return __async$9(this, arguments, function* ({
|
||||||
hostname,
|
hostname,
|
||||||
|
url,
|
||||||
relayerAddress
|
relayerAddress
|
||||||
}) {
|
}) {
|
||||||
var _a, _b;
|
var _a, _b;
|
||||||
const url = `https://${!hostname.endsWith("/") ? hostname + "/" : hostname}`;
|
if (!url) {
|
||||||
|
url = `https://${!hostname.endsWith("/") ? hostname + "/" : hostname}`;
|
||||||
|
} else if (!url.endsWith("/")) {
|
||||||
|
url += "/";
|
||||||
|
}
|
||||||
const rawStatus = yield fetchData(`${url}status`, __spreadProps$1(__spreadValues$1({}, this.fetchDataOptions), {
|
const rawStatus = yield fetchData(`${url}status`, __spreadProps$1(__spreadValues$1({}, this.fetchDataOptions), {
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json, application/x-www-form-urlencoded"
|
"Content-Type": "application/json, application/x-www-form-urlencoded"
|
||||||
|
7
dist/index.mjs
vendored
7
dist/index.mjs
vendored
@ -2590,10 +2590,15 @@ class RelayerClient {
|
|||||||
askRelayerStatus(_0) {
|
askRelayerStatus(_0) {
|
||||||
return __async$9(this, arguments, function* ({
|
return __async$9(this, arguments, function* ({
|
||||||
hostname,
|
hostname,
|
||||||
|
url,
|
||||||
relayerAddress
|
relayerAddress
|
||||||
}) {
|
}) {
|
||||||
var _a, _b;
|
var _a, _b;
|
||||||
const url = `https://${!hostname.endsWith("/") ? hostname + "/" : hostname}`;
|
if (!url) {
|
||||||
|
url = `https://${!hostname.endsWith("/") ? hostname + "/" : hostname}`;
|
||||||
|
} else if (!url.endsWith("/")) {
|
||||||
|
url += "/";
|
||||||
|
}
|
||||||
const rawStatus = yield fetchData(`${url}status`, __spreadProps$1(__spreadValues$1({}, this.fetchDataOptions), {
|
const rawStatus = yield fetchData(`${url}status`, __spreadProps$1(__spreadValues$1({}, this.fetchDataOptions), {
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json, application/x-www-form-urlencoded"
|
"Content-Type": "application/json, application/x-www-form-urlencoded"
|
||||||
|
3
dist/relayerClient.d.ts
vendored
3
dist/relayerClient.d.ts
vendored
@ -131,8 +131,9 @@ export declare class RelayerClient {
|
|||||||
selectedRelayer?: RelayerInfo;
|
selectedRelayer?: RelayerInfo;
|
||||||
fetchDataOptions?: fetchDataOptions;
|
fetchDataOptions?: fetchDataOptions;
|
||||||
constructor({ netId, config, fetchDataOptions }: RelayerClientConstructor);
|
constructor({ netId, config, fetchDataOptions }: RelayerClientConstructor);
|
||||||
askRelayerStatus({ hostname, relayerAddress, }: {
|
askRelayerStatus({ hostname, url, relayerAddress, }: {
|
||||||
hostname: string;
|
hostname: string;
|
||||||
|
url?: string;
|
||||||
relayerAddress?: string;
|
relayerAddress?: string;
|
||||||
}): Promise<RelayerStatus>;
|
}): Promise<RelayerStatus>;
|
||||||
filterRelayer(relayer: CachedRelayerInfo): Promise<RelayerInfo | RelayerError | undefined>;
|
filterRelayer(relayer: CachedRelayerInfo): Promise<RelayerInfo | RelayerError | undefined>;
|
||||||
|
7
dist/tornado.umd.js
vendored
7
dist/tornado.umd.js
vendored
@ -71566,10 +71566,15 @@ class RelayerClient {
|
|||||||
askRelayerStatus(_0) {
|
askRelayerStatus(_0) {
|
||||||
return __async(this, arguments, function* ({
|
return __async(this, arguments, function* ({
|
||||||
hostname,
|
hostname,
|
||||||
|
url,
|
||||||
relayerAddress
|
relayerAddress
|
||||||
}) {
|
}) {
|
||||||
var _a, _b;
|
var _a, _b;
|
||||||
const url = `https://${!hostname.endsWith("/") ? hostname + "/" : hostname}`;
|
if (!url) {
|
||||||
|
url = `https://${!hostname.endsWith("/") ? hostname + "/" : hostname}`;
|
||||||
|
} else if (!url.endsWith("/")) {
|
||||||
|
url += "/";
|
||||||
|
}
|
||||||
const rawStatus = yield (0,_providers__WEBPACK_IMPORTED_MODULE_2__/* .fetchData */ .Fd)(`${url}status`, __spreadProps(__spreadValues({}, this.fetchDataOptions), {
|
const rawStatus = yield (0,_providers__WEBPACK_IMPORTED_MODULE_2__/* .fetchData */ .Fd)(`${url}status`, __spreadProps(__spreadValues({}, this.fetchDataOptions), {
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json, application/x-www-form-urlencoded"
|
"Content-Type": "application/json, application/x-www-form-urlencoded"
|
||||||
|
2
dist/tornado.umd.min.js
vendored
2
dist/tornado.umd.min.js
vendored
File diff suppressed because one or more lines are too long
@ -199,12 +199,20 @@ export class RelayerClient {
|
|||||||
|
|
||||||
async askRelayerStatus({
|
async askRelayerStatus({
|
||||||
hostname,
|
hostname,
|
||||||
|
url,
|
||||||
relayerAddress,
|
relayerAddress,
|
||||||
}: {
|
}: {
|
||||||
hostname: string;
|
hostname: string;
|
||||||
|
// optional url if entered manually
|
||||||
|
url?: string;
|
||||||
|
// relayerAddress from registry contract to prevent cheating
|
||||||
relayerAddress?: string;
|
relayerAddress?: string;
|
||||||
}): Promise<RelayerStatus> {
|
}): Promise<RelayerStatus> {
|
||||||
const url = `https://${!hostname.endsWith('/') ? hostname + '/' : hostname}`;
|
if (!url) {
|
||||||
|
url = `https://${!hostname.endsWith('/') ? hostname + '/' : hostname}`;
|
||||||
|
} else if (!url.endsWith('/')) {
|
||||||
|
url += '/';
|
||||||
|
}
|
||||||
|
|
||||||
const rawStatus = (await fetchData(`${url}status`, {
|
const rawStatus = (await fetchData(`${url}status`, {
|
||||||
...this.fetchDataOptions,
|
...this.fetchDataOptions,
|
||||||
|
Loading…
Reference in New Issue
Block a user