sdk: Rootstock readonly (#3235)
This commit is contained in:
parent
86e905e1e8
commit
1cabbe8a2d
|
@ -59,6 +59,7 @@ export const getOriginalAsset = async (
|
||||||
case "oasis":
|
case "oasis":
|
||||||
case "optimism":
|
case "optimism":
|
||||||
case "polygon":
|
case "polygon":
|
||||||
|
// case "rootstock":
|
||||||
case "sepolia": {
|
case "sepolia": {
|
||||||
const provider = getProviderForChain(chainName, network, { rpc });
|
const provider = getProviderForChain(chainName, network, { rpc });
|
||||||
return getOriginalAssetEth(
|
return getOriginalAssetEth(
|
||||||
|
|
|
@ -69,6 +69,7 @@ export const getWrappedAssetAddress = async (
|
||||||
case "oasis":
|
case "oasis":
|
||||||
case "optimism":
|
case "optimism":
|
||||||
case "polygon":
|
case "polygon":
|
||||||
|
// case "rootstock":
|
||||||
case "sepolia": {
|
case "sepolia": {
|
||||||
const provider = getProviderForChain(chainName, network, { rpc });
|
const provider = getProviderForChain(chainName, network, { rpc });
|
||||||
return getForeignAssetEth(
|
return getForeignAssetEth(
|
||||||
|
|
|
@ -96,6 +96,7 @@ export const getProviderForChain = <T extends ChainId | ChainName>(
|
||||||
case "oasis":
|
case "oasis":
|
||||||
case "optimism":
|
case "optimism":
|
||||||
case "polygon":
|
case "polygon":
|
||||||
|
// case "rootstock":
|
||||||
case "sepolia":
|
case "sepolia":
|
||||||
return new ethers.providers.JsonRpcProvider(rpc) as ChainProvider<T>;
|
return new ethers.providers.JsonRpcProvider(rpc) as ChainProvider<T>;
|
||||||
case "terra":
|
case "terra":
|
||||||
|
|
|
@ -168,6 +168,11 @@ const MAINNET = {
|
||||||
rpc: undefined,
|
rpc: undefined,
|
||||||
key: undefined,
|
key: undefined,
|
||||||
},
|
},
|
||||||
|
rootstock: {
|
||||||
|
rpc: "https://public-node.rsk.co",
|
||||||
|
key: getEnvVar("ETH_KEY"),
|
||||||
|
chain_id: 30,
|
||||||
|
},
|
||||||
sepolia: {
|
sepolia: {
|
||||||
rpc: undefined,
|
rpc: undefined,
|
||||||
key: undefined,
|
key: undefined,
|
||||||
|
@ -333,6 +338,11 @@ const TESTNET = {
|
||||||
key: getEnvVar("ETH_KEY_TESTNET"),
|
key: getEnvVar("ETH_KEY_TESTNET"),
|
||||||
chain_id: 84531,
|
chain_id: 84531,
|
||||||
},
|
},
|
||||||
|
rootstock: {
|
||||||
|
rpc: "https://public-node.testnet.rsk.co",
|
||||||
|
key: getEnvVar("ETH_KEY_TESTNET"),
|
||||||
|
chain_id: 31,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const DEVNET = {
|
const DEVNET = {
|
||||||
|
@ -474,6 +484,10 @@ const DEVNET = {
|
||||||
rpc: undefined,
|
rpc: undefined,
|
||||||
key: undefined,
|
key: undefined,
|
||||||
},
|
},
|
||||||
|
rootstock: {
|
||||||
|
rpc: undefined,
|
||||||
|
key: undefined,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
# Rootstock mainnet read only env
|
||||||
|
# Rename to .env to use with truffle migrations
|
||||||
|
|
||||||
|
# Wormhole Core Migrations
|
||||||
|
INIT_SIGNERS=["0x58CC3AE5C097b213cE3c81979e1B9f9570746AA5"]
|
||||||
|
INIT_CHAIN_ID=33
|
||||||
|
INIT_GOV_CHAIN_ID=0x1
|
||||||
|
INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004
|
||||||
|
INIT_EVM_CHAIN_ID=30
|
|
@ -0,0 +1,9 @@
|
||||||
|
# Rootstock testnet read only env
|
||||||
|
# Rename to .env to use with truffle migrations
|
||||||
|
|
||||||
|
# Wormhole Core Migrations
|
||||||
|
INIT_SIGNERS=["0x13947Bd48b18E53fdAeEe77F3473391aC727C638"]
|
||||||
|
INIT_CHAIN_ID=33
|
||||||
|
INIT_GOV_CHAIN_ID=0x1
|
||||||
|
INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004
|
||||||
|
INIT_EVM_CHAIN_ID=31
|
|
@ -366,6 +366,24 @@ module.exports = {
|
||||||
},
|
},
|
||||||
network_id: 84531,
|
network_id: 84531,
|
||||||
},
|
},
|
||||||
|
rootstock: {
|
||||||
|
provider: () => {
|
||||||
|
return new HDWalletProvider(
|
||||||
|
process.env.MNEMONIC,
|
||||||
|
"https://public-node.rsk.co"
|
||||||
|
);
|
||||||
|
},
|
||||||
|
network_id: 30,
|
||||||
|
},
|
||||||
|
rootstock_testnet: {
|
||||||
|
provider: () => {
|
||||||
|
return new HDWalletProvider(
|
||||||
|
process.env.MNEMONIC,
|
||||||
|
"https://public-node.testnet.rsk.co"
|
||||||
|
);
|
||||||
|
},
|
||||||
|
network_id: 31,
|
||||||
|
},
|
||||||
sepolia_testnet: {
|
sepolia_testnet: {
|
||||||
provider: () => {
|
provider: () => {
|
||||||
return new HDWalletProvider(
|
return new HDWalletProvider(
|
||||||
|
|
|
@ -190,6 +190,7 @@ export const RPCS_BY_CHAIN: {
|
||||||
arbitrum: "https://goerli-rollup.arbitrum.io/rpc",
|
arbitrum: "https://goerli-rollup.arbitrum.io/rpc",
|
||||||
optimism: "https://goerli.optimism.io",
|
optimism: "https://goerli.optimism.io",
|
||||||
gnosis: "https://sokol.poa.network/",
|
gnosis: "https://sokol.poa.network/",
|
||||||
|
rootstock: "https://public-node.rsk.co",
|
||||||
},
|
},
|
||||||
DEVNET: {
|
DEVNET: {
|
||||||
ethereum: "http://localhost:8545",
|
ethereum: "http://localhost:8545",
|
||||||
|
|
|
@ -30,6 +30,7 @@ export const CHAINS = {
|
||||||
btc: 29,
|
btc: 29,
|
||||||
base: 30,
|
base: 30,
|
||||||
sei: 32,
|
sei: 32,
|
||||||
|
rootstock: 33,
|
||||||
wormchain: 3104,
|
wormchain: 3104,
|
||||||
sepolia: 10002,
|
sepolia: 10002,
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -59,6 +60,7 @@ export const EVMChainNames = [
|
||||||
"optimism",
|
"optimism",
|
||||||
"gnosis",
|
"gnosis",
|
||||||
"base",
|
"base",
|
||||||
|
"rootstock",
|
||||||
"sepolia",
|
"sepolia",
|
||||||
] as const;
|
] as const;
|
||||||
export type EVMChainName = typeof EVMChainNames[number];
|
export type EVMChainName = typeof EVMChainNames[number];
|
||||||
|
@ -257,6 +259,11 @@ const MAINNET = {
|
||||||
"sei1smzlm9t79kur392nu9egl8p8je9j92q4gzguewj56a05kyxxra0qy0nuf3",
|
"sei1smzlm9t79kur392nu9egl8p8je9j92q4gzguewj56a05kyxxra0qy0nuf3",
|
||||||
nft_bridge: undefined,
|
nft_bridge: undefined,
|
||||||
},
|
},
|
||||||
|
rootstock: {
|
||||||
|
core: "0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6",
|
||||||
|
token_bridge: undefined,
|
||||||
|
nft_bridge: undefined,
|
||||||
|
},
|
||||||
wormchain: {
|
wormchain: {
|
||||||
core: "wormhole1ufs3tlq4umljk0qfe8k5ya0x6hpavn897u2cnf9k0en9jr7qarqqaqfk2j",
|
core: "wormhole1ufs3tlq4umljk0qfe8k5ya0x6hpavn897u2cnf9k0en9jr7qarqqaqfk2j",
|
||||||
token_bridge:
|
token_bridge:
|
||||||
|
@ -432,6 +439,11 @@ const TESTNET = {
|
||||||
"sei1jv5xw094mclanxt5emammy875qelf3v62u4tl4lp5nhte3w3s9ts9w9az2",
|
"sei1jv5xw094mclanxt5emammy875qelf3v62u4tl4lp5nhte3w3s9ts9w9az2",
|
||||||
nft_bridge: undefined,
|
nft_bridge: undefined,
|
||||||
},
|
},
|
||||||
|
rootstock: {
|
||||||
|
core: "0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6",
|
||||||
|
token_bridge: undefined,
|
||||||
|
nft_bridge: undefined,
|
||||||
|
},
|
||||||
wormchain: {
|
wormchain: {
|
||||||
core: undefined,
|
core: undefined,
|
||||||
token_bridge: undefined,
|
token_bridge: undefined,
|
||||||
|
@ -604,6 +616,11 @@ const DEVNET = {
|
||||||
token_bridge: undefined,
|
token_bridge: undefined,
|
||||||
nft_bridge: undefined,
|
nft_bridge: undefined,
|
||||||
},
|
},
|
||||||
|
rootstock: {
|
||||||
|
core: undefined,
|
||||||
|
token_bridge: undefined,
|
||||||
|
nft_bridge: undefined,
|
||||||
|
},
|
||||||
wormchain: {
|
wormchain: {
|
||||||
core: "wormhole17p9rzwnnfxcjp32un9ug7yhhzgtkhvl9jfksztgw5uh69wac2pgshdnj3k",
|
core: "wormhole17p9rzwnnfxcjp32un9ug7yhhzgtkhvl9jfksztgw5uh69wac2pgshdnj3k",
|
||||||
token_bridge:
|
token_bridge:
|
||||||
|
@ -686,6 +703,7 @@ export const CHAIN_ID_XPLA = CHAINS["xpla"];
|
||||||
export const CHAIN_ID_BTC = CHAINS["btc"];
|
export const CHAIN_ID_BTC = CHAINS["btc"];
|
||||||
export const CHAIN_ID_BASE = CHAINS["base"];
|
export const CHAIN_ID_BASE = CHAINS["base"];
|
||||||
export const CHAIN_ID_SEI = CHAINS["sei"];
|
export const CHAIN_ID_SEI = CHAINS["sei"];
|
||||||
|
export const CHAIN_ID_ROOTSTOCK = CHAINS["rootstock"];
|
||||||
export const CHAIN_ID_WORMCHAIN = CHAINS["wormchain"];
|
export const CHAIN_ID_WORMCHAIN = CHAINS["wormchain"];
|
||||||
export const CHAIN_ID_SEPOLIA = CHAINS["sepolia"];
|
export const CHAIN_ID_SEPOLIA = CHAINS["sepolia"];
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ pub enum Chain {
|
||||||
Btc,
|
Btc,
|
||||||
Base,
|
Base,
|
||||||
Sei,
|
Sei,
|
||||||
|
Rootstock,
|
||||||
Wormchain,
|
Wormchain,
|
||||||
Sepolia,
|
Sepolia,
|
||||||
|
|
||||||
|
@ -83,6 +84,7 @@ impl From<u16> for Chain {
|
||||||
29 => Chain::Btc,
|
29 => Chain::Btc,
|
||||||
30 => Chain::Base,
|
30 => Chain::Base,
|
||||||
32 => Chain::Sei,
|
32 => Chain::Sei,
|
||||||
|
33 => Chain::Rootstock,
|
||||||
3104 => Chain::Wormchain,
|
3104 => Chain::Wormchain,
|
||||||
10002 => Chain::Sepolia,
|
10002 => Chain::Sepolia,
|
||||||
c => Chain::Unknown(c),
|
c => Chain::Unknown(c),
|
||||||
|
@ -124,6 +126,7 @@ impl From<Chain> for u16 {
|
||||||
Chain::Btc => 29,
|
Chain::Btc => 29,
|
||||||
Chain::Base => 30,
|
Chain::Base => 30,
|
||||||
Chain::Sei => 32,
|
Chain::Sei => 32,
|
||||||
|
Chain::Rootstock => 33,
|
||||||
Chain::Wormchain => 3104,
|
Chain::Wormchain => 3104,
|
||||||
Chain::Sepolia => 10002,
|
Chain::Sepolia => 10002,
|
||||||
Chain::Unknown(c) => c,
|
Chain::Unknown(c) => c,
|
||||||
|
@ -165,6 +168,7 @@ impl fmt::Display for Chain {
|
||||||
Self::Btc => f.write_str("Btc"),
|
Self::Btc => f.write_str("Btc"),
|
||||||
Self::Base => f.write_str("Base"),
|
Self::Base => f.write_str("Base"),
|
||||||
Self::Sei => f.write_str("Sei"),
|
Self::Sei => f.write_str("Sei"),
|
||||||
|
Self::Rootstock => f.write_str("Rootstock"),
|
||||||
Self::Sepolia => f.write_str("Sepolia"),
|
Self::Sepolia => f.write_str("Sepolia"),
|
||||||
Self::Wormchain => f.write_str("Wormchain"),
|
Self::Wormchain => f.write_str("Wormchain"),
|
||||||
Self::Unknown(v) => write!(f, "Unknown({v})"),
|
Self::Unknown(v) => write!(f, "Unknown({v})"),
|
||||||
|
@ -212,6 +216,7 @@ impl FromStr for Chain {
|
||||||
"Btc" | "btc" | "BTC" => Ok(Chain::Btc),
|
"Btc" | "btc" | "BTC" => Ok(Chain::Btc),
|
||||||
"Base" | "base" | "BASE" => Ok(Chain::Base),
|
"Base" | "base" | "BASE" => Ok(Chain::Base),
|
||||||
"Sei" | "sei" | "SEI" => Ok(Chain::Sei),
|
"Sei" | "sei" | "SEI" => Ok(Chain::Sei),
|
||||||
|
"Rootstock" | "rootstock" | "ROOTSTOCK" => Ok(Chain::Rootstock),
|
||||||
"Sepolia" | "sepolia" | "SEPOLIA" => Ok(Chain::Sepolia),
|
"Sepolia" | "sepolia" | "SEPOLIA" => Ok(Chain::Sepolia),
|
||||||
"Wormchain" | "wormchain" | "WORMCHAIN" => Ok(Chain::Wormchain),
|
"Wormchain" | "wormchain" | "WORMCHAIN" => Ok(Chain::Wormchain),
|
||||||
_ => {
|
_ => {
|
||||||
|
|
Loading…
Reference in New Issue