-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: move functions for delegation and dashboard contracts in separa…
…te file
- Loading branch information
Showing
9 changed files
with
712 additions
and
906 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
import { getContract, createPublicClient, http, Address } from "viem"; | ||
import { getContract, Address } from "viem"; | ||
import { DashboardAbi } from "abi"; | ||
import { getChain, getRpcUrl } from "@configs"; | ||
import { getPublicClient } from "@providers"; | ||
|
||
export const getDashboardContract = (address: Address) => { | ||
const rpcUrl = getRpcUrl(); | ||
|
||
return getContract({ | ||
address: address, | ||
abi: DashboardAbi, | ||
client: createPublicClient({ | ||
chain: getChain(), | ||
transport: http(rpcUrl), | ||
}), | ||
client: getPublicClient(), | ||
}); | ||
}; | ||
|
||
export type DashboardContract = ReturnType<typeof getDashboardContract>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
import { getContract, createPublicClient, http, Address } from "viem"; | ||
import { getContract, Address } from "viem"; | ||
import { DelegationAbi } from "abi"; | ||
import { getChain, getRpcUrl } from "@configs"; | ||
import { getPublicClient } from "@providers"; | ||
|
||
export const getDelegationContract = (address: Address) => { | ||
const rpcUrl = getRpcUrl(); | ||
|
||
return getContract({ | ||
address: address, | ||
abi: DelegationAbi, | ||
client: createPublicClient({ | ||
chain: getChain(), | ||
transport: http(rpcUrl), | ||
}), | ||
client: getPublicClient(), | ||
}); | ||
}; | ||
|
||
export type DelegationContract = ReturnType<typeof getDelegationContract>; |
Oops, something went wrong.