separb beta

This commit is contained in:
Tim
2024-07-11 00:50:54 -04:00
parent d38baccd49
commit 68d9a32b5c
11 changed files with 74 additions and 130 deletions

View File

@@ -1,5 +1,6 @@
import {ethers} from "ethers";
import {AbiURLCache} from "../common.js";
import {provider as walletProvider} from "@/blockchain/wallet.js";
export const abiCache = new AbiURLCache('/contract/out/')
@@ -39,6 +40,8 @@ export async function erc20Contract(addr, provider) {
}
export async function vaultContract(addr, provider) {
export async function vaultContract(addr, provider=null) {
if (provider===null)
provider = walletProvider
return await newContract(addr, 'IVault', provider)
}

View File

@@ -167,24 +167,6 @@ export async function switchChain(chainId) {
}
export async function addTestnet() {
const info = {
"chainId": "0x539",
"chainName": "Dexorder Alpha Testnet",
"rpcUrls": ["https://rpc.alpha.dexorder.trade"],
"nativeCurrency": {
"name": "Test Ethereum",
"symbol": "TETH",
"decimals": 18
}
};
await window.ethereum.request({
"method": "wallet_addEthereumChain",
"params": [info]
});
}
function discoverVaults(owner) {
const s = useStore()
console.log('discoverVaults', owner)