Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadusmanuet committed Dec 16, 2024
2 parents 48ae0da + 2f47866 commit ee8cbba
Show file tree
Hide file tree
Showing 6 changed files with 305 additions and 31 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
"@ton/core": "=0.56.3",
"@ton/crypto": "=3.2.0",
"@ton/ton": "=13.11.1",
"@vechain/connex-driver": "^2.0.8",
"@vechain/connex-framework": "^2.0.8",
"@vechain/web3-providers-connex": "^1.1.2",
"@tzkt/sdk-api": "^2.2.1",
"@xp/cosmos-client": "git+https://github.com/XP-NETWORK/cosmos-client#bleeding-edge",
"aptos": "^1.21.0",
Expand Down
26 changes: 23 additions & 3 deletions src/factory/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { Principal } from "@dfinity/principal";
import { ProxyNetworkProvider } from "@multiversx/sdk-network-providers/out";
import { TezosToolkit } from "@taquito/taquito";
import { TonClient } from "@ton/ton";
import { JsonRpcProvider, ethers } from "ethers";
import { Driver, SimpleNet } from "@vechain/connex-driver";
import { Framework } from "@vechain/connex-framework";
import * as thor from "@vechain/web3-providers-connex";
import { BrowserProvider, JsonRpcProvider, ethers } from "ethers";
import { SecretNetworkClient } from "secretjs";
import { BridgeStorage__factory } from "../contractsTypes/evm";
import type { TAptosParams } from "../handlers/aptos/types";
Expand Down Expand Up @@ -39,17 +42,22 @@ export interface TChainParams {
fantomParams: TEvmParams;
avaxParams: TEvmParams;
casperParams: TCasperParams;
vechainParams: TEvmParams;
}

export namespace ChainFactoryConfigs {
export function TestNet() {
export async function TestNet() {
const skale = new JsonRpcProvider(
"https://testnet.skalenodes.com/v1/juicy-low-small-testnet",
);
const storage = BridgeStorage__factory.connect(
"0x8184bCDC0a4C24D1cB8e054E389660B5b7160186",
skale,
);
const net = new SimpleNet("https://sync-testnet.veblocks.net");
const driver = await Driver.connect(net);
const connexObj = new Framework(driver);

return {
bscParams: {
identifier: Chain.BSC,
Expand Down Expand Up @@ -156,6 +164,18 @@ export namespace ChainFactoryConfigs {
storage,
proxy_url: "https://sheltered-crag-76748.herokuapp.com/",
},
vechainParams: {
identifier: Chain.VECHAIN,
provider: new BrowserProvider(
new thor.Provider({
connex: connexObj,
net,
}),
),
bridge: ethers.getAddress("0x7111eb5f8d9dA472e9608f2ab3De275C040D60B2"),
royaltySalePrice: 10000,
storage,
},
} satisfies Partial<TChainParams>;
}

Expand Down Expand Up @@ -272,7 +292,7 @@ export namespace ChainFactoryConfigs {
"hash-284d7eeee5d0ece8b0d56cc7162a3cf72e6fabc62946e3a9abae219c646d56c3",
identifier: Chain.CASPER,
network: "casper",
rpc: "https://rpc.mainnet.casperlabs.io/rpc",
rpc: "http://37.27.69.30:7777/rpc",
storage,
proxy_url: "https://sheltered-crag-76748.herokuapp.com/",
},
Expand Down
5 changes: 5 additions & 0 deletions src/factory/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export namespace Chain {
export const FANTOM = "FANTOM";
export const AVALANCHE = "AVALANCHE";
export const CASPER = "CASPER";
export const VECHAIN = "VECHAIN";
}

function mapNonceToParams(chainParams: Partial<TChainParams>): TParamMap {
Expand All @@ -64,6 +65,7 @@ function mapNonceToParams(chainParams: Partial<TChainParams>): TParamMap {
cToP.set(Chain.FANTOM, chainParams.fantomParams);
cToP.set(Chain.AVALANCHE, chainParams.avaxParams);
cToP.set(Chain.CASPER, chainParams.casperParams);
cToP.set(Chain.VECHAIN, chainParams.vechainParams);
return cToP;
}

Expand Down Expand Up @@ -255,3 +257,6 @@ CHAIN_INFO.set(Chain.AVALANCHE, {
CHAIN_INFO.set(Chain.CASPER, {
constructor: casperHandler,
});
CHAIN_INFO.set(Chain.VECHAIN, {
constructor: evmHandler,
});
1 change: 1 addition & 0 deletions src/factory/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ export type MetaMap = {
FANTOM: TEvmMeta;
AVALANCHE: TEvmMeta;
CASPER: TCasperMeta;
VECHAIN: TEvmMeta;
};
3 changes: 2 additions & 1 deletion src/handlers/evm/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type {
BrowserProvider,
ContractTransactionResponse,
JsonRpcProvider,
Overrides,
Expand Down Expand Up @@ -53,7 +54,7 @@ export type TEvmHandler = TNftChain<

export type TEvmParams = {
identifier: string;
provider: JsonRpcProvider;
provider: JsonRpcProvider | BrowserProvider;
bridge: string;
royaltySalePrice: number;
storage: BridgeStorage;
Expand Down
Loading

0 comments on commit ee8cbba

Please sign in to comment.