add gsn for polygon network

This commit is contained in:
yeosiowvic 2023-10-05 12:15:42 +08:00
parent 06db040822
commit 41548556d3

View File

@ -221,7 +221,7 @@ export class Network {
* Returns a new Network for the %%network%% name or chainId.
*/
static from(network?: Networkish): Network {
injectCommonNetworks();
injectCommonNetworks(false);
// Default network
if (network == null) { return Network.from("mainnet"); }
@ -368,7 +368,7 @@ function getPriorityFeePlugin(maxPriorityFeePerGas: bigint) {
// See: https://chainlist.org
let injected = false;
function injectCommonNetworks(): void {
function injectCommonNetworks(gsn: boolean): void {
if (injected) { return; }
injected = true;
@ -427,14 +427,14 @@ function injectCommonNetworks(): void {
registerEth("matic", 137, {
ensNetwork: 1,
plugins: [
getGasStationPlugin("https:/\/gasstation.polygon.technology/v2")
plugins: gsn? [
getGasStationPlugin("https:/\/gasstation.polygon.technology/v2")] : [
]
});
registerEth("matic-mumbai", 80001, {
altNames: [ "maticMumbai", "maticmum" ], // @TODO: Future remove these alts
plugins: [
getGasStationPlugin("https:/\/gasstation-testnet.polygon.technology/v2")
plugins: gsn? [
getGasStationPlugin("https:/\/gasstation-testnet.polygon.technology/v2")] : [
]
});