@@ -11,41 +11,44 @@ export const BSN_TYPE_ROLLUP: BsnType = "ROLLUP";
1111const { chainId : BBN_CHAIN_ID } = getNetworkConfigBBN ( ) ;
1212
1313// BSN Configuration for different types and behaviors
14+ export interface BsnFilterOption {
15+ value : string ;
16+ label : string ;
17+ }
18+
1419export interface BsnConfig {
1520 modalTitle : string ;
16- filterLabels : {
17- primary : string ;
18- secondary : string ;
19- } ;
20- fpFilterBehavior : "active-inactive" | "allowlist-based" ;
21+ filterOptions : BsnFilterOption [ ] ;
22+ fpFilterBehavior : "status-based" | "allowlist-based" ;
2123}
2224
2325export const BSN_CONFIGS : Record < string , BsnConfig > = {
2426 // Babylon Genesis
2527 [ BBN_CHAIN_ID ] : {
2628 modalTitle : "Select Babylon Genesis Finality Provider" ,
27- filterLabels : {
28- primary : "Active" ,
29- secondary : "Inactive" ,
30- } ,
31- fpFilterBehavior : "active-inactive" ,
29+ filterOptions : [
30+ { value : "active" , label : "Active" } ,
31+ { value : "inactive" , label : "Inactive" } ,
32+ { value : "jailed" , label : "Jailed" } ,
33+ { value : "slashed" , label : "Slashed" } ,
34+ ] ,
35+ fpFilterBehavior : "status-based" ,
3236 } ,
33- // Cosmos BSN config
3437 COSMOS : {
3538 modalTitle : "Select Cosmos Finality Provider" ,
36- filterLabels : {
37- primary : "Active" ,
38- secondary : "Inactive" ,
39- } ,
40- fpFilterBehavior : "active-inactive " ,
39+ filterOptions : [
40+ { value : "active" , label : " Active" } ,
41+ { value : "inactive" , label : " Inactive" } ,
42+ ] ,
43+ fpFilterBehavior : "status-based " ,
4144 } ,
4245 // Roll-up BSN config
4346 ROLLUP : {
4447 modalTitle : "Select Roll Up Finality Provider" ,
45- filterLabels : {
46- primary : "Allow listed" ,
47- secondary : "Non-Allow listed" ,
48- } ,
48+ filterOptions : [
49+ { value : "active" , label : "Allowlisted" } ,
50+ { value : "inactive" , label : "Not Allowlisted" } ,
51+ ] ,
4952 fpFilterBehavior : "allowlist-based" ,
5053 } ,
5154} ;
@@ -54,15 +57,15 @@ export const BSN_CONFIGS: Record<string, BsnConfig> = {
5457 * Get BSN configuration based on BSN object
5558 */
5659export const getBsnConfig = ( bsn ?: Bsn ) : BsnConfig => {
57- if ( ! bsn ) return BSN_CONFIGS . COSMOS ;
60+ if ( ! bsn ) return BSN_CONFIGS [ BBN_CHAIN_ID ] ;
5861
5962 // Check if it's Babylon Genesis first
6063 if ( bsn . id === BBN_CHAIN_ID ) {
6164 return BSN_CONFIGS [ BBN_CHAIN_ID ] ;
6265 }
6366
6467 // Use type-based config
65- return BSN_CONFIGS [ bsn . type ] || BSN_CONFIGS . COSMOS ;
68+ return BSN_CONFIGS [ bsn . type ] || BSN_CONFIGS [ BBN_CHAIN_ID ] ;
6669} ;
6770
6871interface BsnAPI {
0 commit comments