Skip to content
Merged
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
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
},
"dependencies": {
"@ellipsis-labs/phoenix-sdk": "1.4.2",
"@pythnetwork/pyth-solana-receiver": "0.8.0",
"@switchboard-xyz/common": "3.0.14",
"@switchboard-xyz/on-demand": "2.4.1",
"anchor-bankrun": "0.3.0",
Expand Down
5 changes: 2 additions & 3 deletions sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"@project-serum/serum": "0.13.65",
"@pythnetwork/client": "2.5.3",
"@pythnetwork/price-service-sdk": "1.7.1",
"@pythnetwork/pyth-solana-receiver": "0.7.0",
"@solana/spl-token": "0.4.13",
"@solana/web3.js": "1.98.0",
"@switchboard-xyz/common": "3.0.14",
Expand Down Expand Up @@ -150,9 +149,9 @@
"has-ansi": "<6.0.1"
},
"browser": {
"helius-laserstream": false,
"@triton-one/yellowstone-grpc": false,
"@grpc/grpc-js": false,
"@triton-one/yellowstone-grpc": false,
"helius-laserstream": false,
"zstddec": false
}
}
20 changes: 9 additions & 11 deletions sdk/src/driftClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,7 @@ import {
trimVaaSignatures,
} from './math/oracles';
import { TxHandler } from './tx/txHandler';
import {
DEFAULT_RECEIVER_PROGRAM_ID,
wormholeCoreBridgeIdl,
} from '@pythnetwork/pyth-solana-receiver';
import { parseAccumulatorUpdateData } from '@pythnetwork/price-service-sdk';
import {
DEFAULT_WORMHOLE_PROGRAM_ID,
getGuardianSetPda,
} from '@pythnetwork/pyth-solana-receiver/lib/address';
import { WormholeCoreBridgeSolana } from '@pythnetwork/pyth-solana-receiver/lib/idl/wormhole_core_bridge_solana';
import { PythSolanaReceiver } from '@pythnetwork/pyth-solana-receiver/lib/idl/pyth_solana_receiver';
import { getFeedIdUint8Array, trimFeedId } from './util/pythOracleUtils';
import { createMinimalEd25519VerifyIx } from './util/ed25519Utils';
import {
Expand All @@ -221,6 +211,14 @@ import {
} from './math/builder';
import { TitanClient, SwapMode as TitanSwapMode } from './titan/titanClient';
import { UnifiedSwapClient } from './swap/UnifiedSwapClient';
import {
DEFAULT_RECEIVER_PROGRAM_ID,
WORMHOLE_CORE_BRIDGE_SOLANA_IDL,
DEFAULT_WORMHOLE_PROGRAM_ID,
getGuardianSetPda,
WormholeCoreBridgeSolana,
PythSolanaReceiver,
} from './pyth';

/**
* Union type for swap clients (Titan and Jupiter) - Legacy type
Expand Down Expand Up @@ -11208,7 +11206,7 @@ export class DriftClient {

if (this.wormholeProgram === undefined) {
this.wormholeProgram = new Program(
wormholeCoreBridgeIdl,
WORMHOLE_CORE_BRIDGE_SOLANA_IDL,
DEFAULT_WORMHOLE_PROGRAM_ID,
this.provider
);
Expand Down
9 changes: 4 additions & 5 deletions sdk/src/oracles/pythPullClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import {
QUOTE_PRECISION,
TEN,
} from '../constants/numericConstants';
import {
PythSolanaReceiverProgram,
pythSolanaReceiverIdl,
} from '@pythnetwork/pyth-solana-receiver';
import { PriceUpdateAccount } from '@pythnetwork/pyth-solana-receiver/lib/PythSolanaReceiver';

import pythSolanaReceiverIdl from '../idl/pyth_solana_receiver.json';
import { PythSolanaReceiver as PythSolanaReceiverProgram } from '../pyth';
import { DRIFT_ORACLE_RECEIVER_ID } from '../config';
import { Wallet } from '../wallet';
import { PriceUpdateAccount } from '../pyth';

export class PythPullClient implements OracleClient {
private connection: Connection;
Expand Down
9 changes: 9 additions & 0 deletions sdk/src/pyth/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { PublicKey } from '@solana/web3.js';

export const DEFAULT_WORMHOLE_PROGRAM_ID = new PublicKey(
'HDwcJBJXjL9FpJ7UBsYBtaDjsBUhuLCUYoz3zr8SWWaQ'
);

export const DEFAULT_RECEIVER_PROGRAM_ID = new PublicKey(
'rec5EKMGg6MxZYaMdyBfgwp4d5rB9T1VQH5pJv5LtFJ'
);
11 changes: 11 additions & 0 deletions sdk/src/pyth/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export {
WormholeCoreBridgeSolana,
WORMHOLE_CORE_BRIDGE_SOLANA_IDL,
PythSolanaReceiver,
PriceUpdateAccount,
} from './types';
export {
DEFAULT_WORMHOLE_PROGRAM_ID,
DEFAULT_RECEIVER_PROGRAM_ID,
} from './constants';
export { getGuardianSetPda } from './utils';
Loading
Loading