Use relayerEnsSubdomain

Idea by @Theo
This commit is contained in:
Tornado Contrib 2024-04-30 06:56:08 +00:00
parent 767883f1e7
commit 8cc20ded52
Signed by: tornadocontrib
GPG Key ID: 60B4DF1A076C64B1
6 changed files with 46 additions and 46 deletions

22
dist/index.js vendored

@ -5976,7 +5976,7 @@ const defaultConfig = {
gasLimit: 7e5
}
},
ensSubdomainKey: "mainnet-tornado",
relayerEnsSubdomain: "mainnet-tornado",
pollInterval: 15,
constants: {
GOVERNANCE_BLOCK: 11474695,
@ -6044,7 +6044,7 @@ const defaultConfig = {
decimals: 18
}
},
ensSubdomainKey: "bsc-tornado",
relayerEnsSubdomain: "bsc-tornado",
pollInterval: 10,
constants: {
NOTE_ACCOUNT_BLOCK: 8159269,
@ -6102,7 +6102,7 @@ const defaultConfig = {
decimals: 18
}
},
ensSubdomainKey: "polygon-tornado",
relayerEnsSubdomain: "polygon-tornado",
pollInterval: 10,
constants: {
NOTE_ACCOUNT_BLOCK: 16257996,
@ -6168,7 +6168,7 @@ const defaultConfig = {
decimals: 18
}
},
ensSubdomainKey: "optimism-tornado",
relayerEnsSubdomain: "optimism-tornado",
pollInterval: 15,
constants: {
NOTE_ACCOUNT_BLOCK: 2243694,
@ -6233,7 +6233,7 @@ const defaultConfig = {
decimals: 18
}
},
ensSubdomainKey: "arbitrum-tornado",
relayerEnsSubdomain: "arbitrum-tornado",
pollInterval: 15,
constants: {
NOTE_ACCOUNT_BLOCK: 3430605,
@ -6298,7 +6298,7 @@ const defaultConfig = {
decimals: 18
}
},
ensSubdomainKey: "gnosis-tornado",
relayerEnsSubdomain: "gnosis-tornado",
pollInterval: 15,
constants: {
NOTE_ACCOUNT_BLOCK: 17754564,
@ -6353,7 +6353,7 @@ const defaultConfig = {
decimals: 18
}
},
ensSubdomainKey: "avalanche-tornado",
relayerEnsSubdomain: "avalanche-tornado",
pollInterval: 10,
constants: {
NOTE_ACCOUNT_BLOCK: 4429813,
@ -6427,7 +6427,7 @@ const defaultConfig = {
gasLimit: 7e5
}
},
ensSubdomainKey: "sepolia-tornado",
relayerEnsSubdomain: "sepolia-tornado",
pollInterval: 15,
constants: {
GOVERNANCE_BLOCK: 5594395,
@ -6476,7 +6476,7 @@ function getInstanceByAddress({ netId, address }) {
}
function getSubdomains() {
const allConfig = getNetworkConfig();
return enabledChains.map((chain) => allConfig[chain].ensSubdomainKey);
return enabledChains.map((chain) => allConfig[chain].relayerEnsSubdomain);
}
const addressType = { type: "string", pattern: "^0x[a-fA-F0-9]{40}$" };
@ -7485,8 +7485,8 @@ class RelayerClient {
filterRelayer(curr, relayer, subdomains, debugRelayer = false) {
return __async$3(this, null, function* () {
var _a;
const { ensSubdomainKey } = this.config;
const subdomainIndex = subdomains.indexOf(ensSubdomainKey);
const { relayerEnsSubdomain } = this.config;
const subdomainIndex = subdomains.indexOf(relayerEnsSubdomain);
const mainnetSubdomain = curr.records[0];
const hostname = curr.records[subdomainIndex];
const isHostWithProtocol = hostname.includes("http");

22
dist/index.mjs vendored

@ -5955,7 +5955,7 @@ const defaultConfig = {
gasLimit: 7e5
}
},
ensSubdomainKey: "mainnet-tornado",
relayerEnsSubdomain: "mainnet-tornado",
pollInterval: 15,
constants: {
GOVERNANCE_BLOCK: 11474695,
@ -6023,7 +6023,7 @@ const defaultConfig = {
decimals: 18
}
},
ensSubdomainKey: "bsc-tornado",
relayerEnsSubdomain: "bsc-tornado",
pollInterval: 10,
constants: {
NOTE_ACCOUNT_BLOCK: 8159269,
@ -6081,7 +6081,7 @@ const defaultConfig = {
decimals: 18
}
},
ensSubdomainKey: "polygon-tornado",
relayerEnsSubdomain: "polygon-tornado",
pollInterval: 10,
constants: {
NOTE_ACCOUNT_BLOCK: 16257996,
@ -6147,7 +6147,7 @@ const defaultConfig = {
decimals: 18
}
},
ensSubdomainKey: "optimism-tornado",
relayerEnsSubdomain: "optimism-tornado",
pollInterval: 15,
constants: {
NOTE_ACCOUNT_BLOCK: 2243694,
@ -6212,7 +6212,7 @@ const defaultConfig = {
decimals: 18
}
},
ensSubdomainKey: "arbitrum-tornado",
relayerEnsSubdomain: "arbitrum-tornado",
pollInterval: 15,
constants: {
NOTE_ACCOUNT_BLOCK: 3430605,
@ -6277,7 +6277,7 @@ const defaultConfig = {
decimals: 18
}
},
ensSubdomainKey: "gnosis-tornado",
relayerEnsSubdomain: "gnosis-tornado",
pollInterval: 15,
constants: {
NOTE_ACCOUNT_BLOCK: 17754564,
@ -6332,7 +6332,7 @@ const defaultConfig = {
decimals: 18
}
},
ensSubdomainKey: "avalanche-tornado",
relayerEnsSubdomain: "avalanche-tornado",
pollInterval: 10,
constants: {
NOTE_ACCOUNT_BLOCK: 4429813,
@ -6406,7 +6406,7 @@ const defaultConfig = {
gasLimit: 7e5
}
},
ensSubdomainKey: "sepolia-tornado",
relayerEnsSubdomain: "sepolia-tornado",
pollInterval: 15,
constants: {
GOVERNANCE_BLOCK: 5594395,
@ -6455,7 +6455,7 @@ function getInstanceByAddress({ netId, address }) {
}
function getSubdomains() {
const allConfig = getNetworkConfig();
return enabledChains.map((chain) => allConfig[chain].ensSubdomainKey);
return enabledChains.map((chain) => allConfig[chain].relayerEnsSubdomain);
}
const addressType = { type: "string", pattern: "^0x[a-fA-F0-9]{40}$" };
@ -7464,8 +7464,8 @@ class RelayerClient {
filterRelayer(curr, relayer, subdomains, debugRelayer = false) {
return __async$3(this, null, function* () {
var _a;
const { ensSubdomainKey } = this.config;
const subdomainIndex = subdomains.indexOf(ensSubdomainKey);
const { relayerEnsSubdomain } = this.config;
const subdomainIndex = subdomains.indexOf(relayerEnsSubdomain);
const mainnetSubdomain = curr.records[0];
const hostname = curr.records[subdomainIndex];
const isHostWithProtocol = hostname.includes("http");

22
dist/index.umd.js vendored

@ -66859,7 +66859,7 @@ const defaultConfig = {
gasLimit: 7e5
}
},
ensSubdomainKey: "mainnet-tornado",
relayerEnsSubdomain: "mainnet-tornado",
pollInterval: 15,
constants: {
GOVERNANCE_BLOCK: 11474695,
@ -66927,7 +66927,7 @@ const defaultConfig = {
decimals: 18
}
},
ensSubdomainKey: "bsc-tornado",
relayerEnsSubdomain: "bsc-tornado",
pollInterval: 10,
constants: {
NOTE_ACCOUNT_BLOCK: 8159269,
@ -66985,7 +66985,7 @@ const defaultConfig = {
decimals: 18
}
},
ensSubdomainKey: "polygon-tornado",
relayerEnsSubdomain: "polygon-tornado",
pollInterval: 10,
constants: {
NOTE_ACCOUNT_BLOCK: 16257996,
@ -67051,7 +67051,7 @@ const defaultConfig = {
decimals: 18
}
},
ensSubdomainKey: "optimism-tornado",
relayerEnsSubdomain: "optimism-tornado",
pollInterval: 15,
constants: {
NOTE_ACCOUNT_BLOCK: 2243694,
@ -67116,7 +67116,7 @@ const defaultConfig = {
decimals: 18
}
},
ensSubdomainKey: "arbitrum-tornado",
relayerEnsSubdomain: "arbitrum-tornado",
pollInterval: 15,
constants: {
NOTE_ACCOUNT_BLOCK: 3430605,
@ -67181,7 +67181,7 @@ const defaultConfig = {
decimals: 18
}
},
ensSubdomainKey: "gnosis-tornado",
relayerEnsSubdomain: "gnosis-tornado",
pollInterval: 15,
constants: {
NOTE_ACCOUNT_BLOCK: 17754564,
@ -67236,7 +67236,7 @@ const defaultConfig = {
decimals: 18
}
},
ensSubdomainKey: "avalanche-tornado",
relayerEnsSubdomain: "avalanche-tornado",
pollInterval: 10,
constants: {
NOTE_ACCOUNT_BLOCK: 4429813,
@ -67310,7 +67310,7 @@ const defaultConfig = {
gasLimit: 7e5
}
},
ensSubdomainKey: "sepolia-tornado",
relayerEnsSubdomain: "sepolia-tornado",
pollInterval: 15,
constants: {
GOVERNANCE_BLOCK: 5594395,
@ -67359,7 +67359,7 @@ function getInstanceByAddress({ netId, address }) {
}
function getSubdomains() {
const allConfig = getNetworkConfig();
return enabledChains.map((chain) => allConfig[chain].ensSubdomainKey);
return enabledChains.map((chain) => allConfig[chain].relayerEnsSubdomain);
}
@ -76814,8 +76814,8 @@ class RelayerClient {
filterRelayer(curr, relayer, subdomains, debugRelayer = false) {
return __async(this, null, function* () {
var _a;
const { ensSubdomainKey } = this.config;
const subdomainIndex = subdomains.indexOf(ensSubdomainKey);
const { relayerEnsSubdomain } = this.config;
const subdomainIndex = subdomains.indexOf(relayerEnsSubdomain);
const mainnetSubdomain = curr.records[0];
const hostname = curr.records[subdomainIndex];
const isHostWithProtocol = hostname.includes("http");

@ -76,7 +76,7 @@ export type Config = {
subgraphs: SubgraphUrls;
tokens: TokenInstances;
optionalTokens?: string[];
ensSubdomainKey: string;
relayerEnsSubdomain: string;
pollInterval: number;
constants: {
GOVERNANCE_BLOCK?: number;

@ -87,7 +87,7 @@ export type Config = {
subgraphs: SubgraphUrls;
tokens: TokenInstances;
optionalTokens?: string[];
ensSubdomainKey: string;
relayerEnsSubdomain: string;
// Should be in seconds
pollInterval: number;
constants: {
@ -252,7 +252,7 @@ export const defaultConfig: networkConfig = {
gasLimit: 700_000,
},
},
ensSubdomainKey: 'mainnet-tornado',
relayerEnsSubdomain: 'mainnet-tornado',
pollInterval: 15,
constants: {
GOVERNANCE_BLOCK: 11474695,
@ -320,7 +320,7 @@ export const defaultConfig: networkConfig = {
decimals: 18,
},
},
ensSubdomainKey: 'bsc-tornado',
relayerEnsSubdomain: 'bsc-tornado',
pollInterval: 10,
constants: {
NOTE_ACCOUNT_BLOCK: 8159269,
@ -378,7 +378,7 @@ export const defaultConfig: networkConfig = {
decimals: 18,
},
},
ensSubdomainKey: 'polygon-tornado',
relayerEnsSubdomain: 'polygon-tornado',
pollInterval: 10,
constants: {
NOTE_ACCOUNT_BLOCK: 16257996,
@ -444,7 +444,7 @@ export const defaultConfig: networkConfig = {
decimals: 18,
},
},
ensSubdomainKey: 'optimism-tornado',
relayerEnsSubdomain: 'optimism-tornado',
pollInterval: 15,
constants: {
NOTE_ACCOUNT_BLOCK: 2243694,
@ -509,7 +509,7 @@ export const defaultConfig: networkConfig = {
decimals: 18,
},
},
ensSubdomainKey: 'arbitrum-tornado',
relayerEnsSubdomain: 'arbitrum-tornado',
pollInterval: 15,
constants: {
NOTE_ACCOUNT_BLOCK: 3430605,
@ -574,7 +574,7 @@ export const defaultConfig: networkConfig = {
decimals: 18,
},
},
ensSubdomainKey: 'gnosis-tornado',
relayerEnsSubdomain: 'gnosis-tornado',
pollInterval: 15,
constants: {
NOTE_ACCOUNT_BLOCK: 17754564,
@ -629,7 +629,7 @@ export const defaultConfig: networkConfig = {
decimals: 18,
},
},
ensSubdomainKey: 'avalanche-tornado',
relayerEnsSubdomain: 'avalanche-tornado',
pollInterval: 10,
constants: {
NOTE_ACCOUNT_BLOCK: 4429813,
@ -703,7 +703,7 @@ export const defaultConfig: networkConfig = {
gasLimit: 700_000,
},
},
ensSubdomainKey: 'sepolia-tornado',
relayerEnsSubdomain: 'sepolia-tornado',
pollInterval: 15,
constants: {
GOVERNANCE_BLOCK: 5594395,
@ -786,5 +786,5 @@ export function getInstanceByAddress({ netId, address }: { netId: NetIdType; add
export function getSubdomains() {
const allConfig = getNetworkConfig();
return enabledChains.map((chain) => allConfig[chain].ensSubdomainKey);
return enabledChains.map((chain) => allConfig[chain].relayerEnsSubdomain);
}

@ -257,8 +257,8 @@ export class RelayerClient {
subdomains: string[],
debugRelayer: boolean = false,
): Promise<RelayerInfo | RelayerError> {
const { ensSubdomainKey } = this.config;
const subdomainIndex = subdomains.indexOf(ensSubdomainKey);
const { relayerEnsSubdomain } = this.config;
const subdomainIndex = subdomains.indexOf(relayerEnsSubdomain);
const mainnetSubdomain = curr.records[0];
const hostname = curr.records[subdomainIndex];
const isHostWithProtocol = hostname.includes('http');