Skip to content

Commit

Permalink
chore: oracle transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
shane-moore committed Aug 9, 2024
1 parent dfe1158 commit 4209a26
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions layer/transformer/oracle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { OracleType, OracleTypeMap } from '@injectivelabs/sdk-ts'

export class UiOracleTransformer {
static grpcOracleTypeToUiOracleType(grpcOracleType: string): OracleType {
switch (grpcOracleType.toLowerCase()) {
case 'coinbase':
return OracleTypeMap.Coinbase
case 'bandibc':
return OracleTypeMap.BandIBC
case 'pricefeed':
return OracleTypeMap.PriceFeed
case 'band':
return OracleTypeMap.Band
case 'api3':
return OracleTypeMap.API3
case 'razor':
return OracleTypeMap.Razor
case 'dia':
return OracleTypeMap.Dia
case 'uma':
return OracleTypeMap.Uma
case 'chainlink':
return OracleTypeMap.Chainlink
case 'pyth':
return OracleTypeMap.Pyth
case 'provider':
return OracleTypeMap.Provider
default:
return OracleTypeMap.Coinbase
}
}
}

0 comments on commit 4209a26

Please sign in to comment.