File tree Expand file tree Collapse file tree 5 files changed +13
-5
lines changed
Expand file tree Collapse file tree 5 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 22
33import "./patch-bigint-buffer-warn.js" ;
44
5+ import { chainMetadata } from "./config/chainMetadata.js" ;
56import { log } from "./logger.js" ;
67import * as solvers from "./solvers/index.js" ;
78import { getMultiProvider } from "./solvers/utils.js" ;
8- import { chainMetadata } from "./config/chainMetadata.js" ;
99
1010const main = async ( ) => {
1111 const multiProvider = await getMultiProvider ( chainMetadata ) . catch (
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const metadata: EcoMetadata = {
44 protocolName : "Eco" ,
55 intentSources : [
66 {
7- address : "0x734a3d5a8D691d9b9,11674E682De5f06517c79ec " ,
7+ address : "0x734a3d5a8D691d9b911674E682De5f06517c79ec " ,
88 chainName : "optimismsepolia" ,
99 } ,
1010 ] ,
Original file line number Diff line number Diff line change 11import z from "zod" ;
22import { chainNames } from "../../config/index.js" ;
3+ import { addressSchema } from "../../config/types.js" ;
34import type { IntentCreatedEventObject } from "../../typechain/eco/contracts/IntentSource.js" ;
45
56export const EcoMetadataSchema = z . object ( {
67 protocolName : z . string ( ) ,
78 intentSources : z . array (
89 z . object ( {
9- address : z . string ( ) ,
10+ address : addressSchema ,
1011 chainName : z . string ( ) . refine ( ( name ) => chainNames . includes ( name ) , {
1112 message : "Invalid chainName" ,
1213 } ) ,
1314 } ) ,
1415 ) ,
1516 adapters : z . array (
1617 z . object ( {
17- address : z . string ( ) ,
18+ address : addressSchema ,
1819 chainName : z . string ( ) . refine ( ( name ) => chainNames . includes ( name ) , {
1920 message : "Invalid chainName" ,
2021 } ) ,
Original file line number Diff line number Diff line change 11import type { BigNumber } from "ethers" ;
22import z from "zod" ;
33import { chainNames } from "../../config/index.js" ;
4+ import { addressSchema } from "../../config/types.js" ;
45import type { OpenEventObject } from "../../typechain/hyperlane7683/contracts/Hyperlane7683.js" ;
56
67export type ExtractStruct < T , K extends object > = T extends ( infer U & K ) [ ]
@@ -44,7 +45,7 @@ export const Hyperlane7683MetadataSchema = z.object({
4445 protocolName : z . string ( ) ,
4546 originSettlers : z . array (
4647 z . object ( {
47- address : z . string ( ) ,
48+ address : addressSchema ,
4849 chainName : z . string ( ) . refine ( ( name ) => chainNames . includes ( name ) , {
4950 message : "Invalid chainName" ,
5051 } ) ,
Original file line number Diff line number Diff line change 1+ import { isValidAddress } from "@hyperlane-xyz/utils" ;
2+ import z from "zod" ;
3+
4+ export const addressSchema = z . string ( ) . refine ( ( address ) => isValidAddress ( address ) , {
5+ message : "Invalid address" ,
6+ } ) ;
You can’t perform that action at this time.
0 commit comments