Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sdk/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,23 +136,23 @@ export function getMarketsAndOraclesForSubscription(
oracleInfos: OracleInfo[];
} {
const perpMarketsToUse =
perpMarkets?.length > 0 ? perpMarkets : PerpMarkets[env];
(perpMarkets?.length ?? 0) > 0 ? perpMarkets : PerpMarkets[env];
const spotMarketsToUse =
spotMarkets?.length > 0 ? spotMarkets : SpotMarkets[env];
(spotMarkets?.length ?? 0) > 0 ? spotMarkets : SpotMarkets[env];

const perpMarketIndexes = [];
const spotMarketIndexes = [];
const oracleInfos = new Map<string, OracleInfo>();

for (const market of perpMarketsToUse) {
for (const market of perpMarketsToUse ?? []) {
perpMarketIndexes.push(market.marketIndex);
oracleInfos.set(getOracleId(market.oracle, market.oracleSource), {
publicKey: market.oracle,
source: market.oracleSource,
});
}

for (const spotMarket of spotMarketsToUse) {
for (const spotMarket of spotMarketsToUse ?? []) {
spotMarketIndexes.push(spotMarket.marketIndex);
oracleInfos.set(getOracleId(spotMarket.oracle, spotMarket.oracleSource), {
publicKey: spotMarket.oracle,
Expand Down
2 changes: 2 additions & 0 deletions sdk/src/constants/txConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ export const NOT_CONFIRMED_ERROR_CODE = -1001;
export const FUEL_RESET_LOG_ACCOUNT = new PublicKey(
'FuE1gqp2fzw2sDNLrbZqKsqpphJcoSW6HPaSJjGd4RZ4'
);

export const DEFAULT_COMMITMENT_LEVEL = 'confirmed';
Loading
Loading