import { AERODROME_PROTOCOLS, ALGEBRA_INTEGRAL_PROTOCOLS, ALGEBRA_INTEGRAL_V_2_0_PROTOCOLS, ALGEBRA_PROTOCOLS, DIRECTIONAL_ALGEBRA_PROTOCOLS, getProtocolTypeByBeacon, isShadowProtocol, POOLSHARK_PROTOCOLS, Protocol } from "@steerprotocol/sdk"; export class ProtocolDetector { isAlgebraVault(beaconName: string): boolean { const protocol: Protocol | null = getProtocolTypeByBeacon(beaconName); if (!protocol) { throw new Error("Protocol not found"); } else { return ALGEBRA_PROTOCOLS.indexOf(protocol) > -1; } } isAlgebraIntegralVault(beaconName: string): boolean { const protocol: Protocol | null = getProtocolTypeByBeacon(beaconName); if (!protocol) { throw new Error("Protocol not found"); } else { return ALGEBRA_INTEGRAL_PROTOCOLS.indexOf(protocol) > -1; } } isMachineXV3Vault(beaconName: string): boolean { const protocol: Protocol | null = getProtocolTypeByBeacon(beaconName); if (!protocol) { throw new Error("Protocol not found"); } else { return protocol === Protocol.MachineX; } } isAlgebraIntegral19Vault(beaconName: string): boolean { const protocol: Protocol | null = getProtocolTypeByBeacon(beaconName); if (!protocol) { throw new Error("Protocol not found"); } else { return ALGEBRA_INTEGRAL_V_2_0_PROTOCOLS.indexOf(protocol) > -1; } } isPoolSharkVault(beaconName: string): boolean { const protocol: Protocol | null = getProtocolTypeByBeacon(beaconName); if (!protocol) { throw new Error("Protocol not found"); } else { return POOLSHARK_PROTOCOLS.indexOf(protocol) > -1; } } isBlackholeVault(beaconName: string): boolean { const protocol: Protocol | null = getProtocolTypeByBeacon(beaconName); if (!protocol) { throw new Error("Protocol not found"); } else { return protocol === Protocol.Blackhole; } } isThickV2Vault(beaconName: string): boolean { const protocol: Protocol | null = getProtocolTypeByBeacon(beaconName); if (!protocol) { throw new Error("Protocol not found"); } else { return protocol === Protocol.ThickV2; } } isShadowVault(beaconName: string): boolean { const protocol: Protocol | null = getProtocolTypeByBeacon(beaconName); if (!protocol) { throw new Error("Protocol not found"); } return isShadowProtocol(protocol); } isAerodromeVault(beaconName: string): boolean { const protocol: Protocol | null = getProtocolTypeByBeacon(beaconName); if (!protocol) { throw new Error("Protocol not found"); } else { return AERODROME_PROTOCOLS.includes(protocol); } } isAlgebraUniDirectionalVault(beaconName: string): boolean { const protocol: Protocol | null = getProtocolTypeByBeacon(beaconName); if (!protocol) { throw new Error("Protocol not found"); } else { return DIRECTIONAL_ALGEBRA_PROTOCOLS.indexOf(protocol) > -1; } } getProtocol(beaconName: string): Protocol | null { return getProtocolTypeByBeacon(beaconName); } }