Skip to content

Commit 5880dc4

Browse files
authored
chore: implement Networks method (#59)
1 parent 595c4bb commit 5880dc4

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

schema/network/network.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,39 @@ func (n Network) Source() Source {
7676
}
7777
}
7878

79+
func (s Source) Networks() []Network {
80+
switch s {
81+
case ActivityPubSource:
82+
return []Network{Mastodon}
83+
case ArweaveSource:
84+
return []Network{Arweave}
85+
case EthereumSource:
86+
return []Network{
87+
Ethereum,
88+
Polygon,
89+
Optimism,
90+
Arbitrum,
91+
Base,
92+
Crossbell,
93+
Avalanche,
94+
VSL,
95+
SatoshiVM,
96+
BinanceSmartChain,
97+
Gnosis,
98+
Linea,
99+
XLayer,
100+
}
101+
case FarcasterSource:
102+
return []Network{Farcaster}
103+
case NearSource:
104+
return []Network{Near}
105+
case RSSSource:
106+
return []Network{RSS}
107+
default:
108+
return []Network{}
109+
}
110+
}
111+
79112
func HookFunc() mapstructure.DecodeHookFuncType {
80113
return func(
81114
f reflect.Type, // data type

0 commit comments

Comments
 (0)