feat: add ABI validation helpers for Ponder (#29)
resolves https://codeberg.org/johba/harb/issues/23 Co-authored-by: openhands <openhands@all-hands.dev> Reviewed-on: https://codeberg.org/johba/harb/pulls/29
This commit is contained in:
parent
0eaf91be13
commit
76d84341de
17 changed files with 2105 additions and 49 deletions
|
|
@ -10,8 +10,7 @@ import {
|
|||
type WaitForTransactionReceiptParameters,
|
||||
getChainId
|
||||
} from "@wagmi/core";
|
||||
// import { HarbContract } from "@/contracts/harb";
|
||||
import HarbJson from "@/assets/contracts/harb.json";
|
||||
import { KraikenAbi } from "kraiken-lib";
|
||||
import { type Abi, type Address } from "viem";
|
||||
import { StakeContract } from "@/contracts/stake";
|
||||
import {getChain} from "@/config"
|
||||
|
|
@ -36,13 +35,13 @@ export let HarbContract = getHarbJson();
|
|||
|
||||
function getHarbJson(){
|
||||
console.log("getHarbJson");
|
||||
|
||||
|
||||
const chainId = getChainId(config as any);
|
||||
console.log("chainId", chainId);
|
||||
|
||||
|
||||
const chain = getChain(chainId)
|
||||
|
||||
return {abi: HarbJson, contractAddress: chain?.harb} as Contract;
|
||||
|
||||
return {abi: KraikenAbi as Abi, contractAddress: chain?.harb} as Contract;
|
||||
}
|
||||
|
||||
export function setHarbContract(){
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { ref } from "vue";
|
||||
import { config } from "@/wagmi";
|
||||
import { readContract, writeContract, getChainId } from "@wagmi/core";
|
||||
import StakeJson from "@/assets/contracts/stake.json";
|
||||
import { StakeAbi } from "kraiken-lib";
|
||||
import { type Abi, type Address } from "viem";
|
||||
import {getChain} from "@/config"
|
||||
import logger from "@/utils/logger";
|
||||
|
|
@ -25,8 +25,8 @@ function getStakeJson(){
|
|||
console.log("chainId", chainId);
|
||||
|
||||
const chain = getChain(chainId)
|
||||
|
||||
return {abi: StakeJson, contractAddress: chain?.stake} as Contract;
|
||||
|
||||
return {abi: StakeAbi as Abi, contractAddress: chain?.stake} as Contract;
|
||||
}
|
||||
|
||||
export function setStakeContract(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue