@drift-labs/sdk-browser 2.155.0-beta.2 → 2.155.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VERSION +1 -1
- package/lib/browser/accounts/grpcAccountSubscriber.d.ts +0 -1
- package/lib/browser/accounts/grpcMultiAccountSubscriber.d.ts +0 -1
- package/lib/browser/accounts/grpcProgramAccountSubscriber.d.ts +0 -1
- package/lib/browser/accounts/laserProgramAccountSubscriber.d.ts +0 -1
- package/lib/browser/accounts/webSocketAccountSubscriber.d.ts +0 -1
- package/lib/browser/accounts/webSocketDriftClientAccountSubscriber.d.ts +0 -1
- package/lib/browser/accounts/webSocketProgramAccountSubscriber.d.ts +0 -1
- package/lib/browser/driftClient.d.ts +1 -2
- package/lib/browser/driftClient.js +5 -6
- package/lib/browser/oracles/pythPullClient.d.ts +2 -2
- package/lib/browser/oracles/pythPullClient.js +5 -2
- package/lib/browser/pyth/constants.d.ts +3 -0
- package/lib/browser/pyth/constants.js +6 -0
- package/lib/browser/pyth/index.d.ts +3 -0
- package/lib/browser/pyth/index.js +10 -0
- package/lib/browser/pyth/types.d.ts +2226 -0
- package/lib/browser/pyth/types.js +2224 -0
- package/lib/browser/pyth/utils.d.ts +2 -0
- package/lib/browser/pyth/utils.js +10 -0
- package/lib/browser/swap/UnifiedSwapClient.js +1 -10
- package/lib/browser/titan/titanClient.d.ts +4 -5
- package/lib/browser/titan/titanClient.js +2 -16
- package/lib/node/accounts/grpcAccountSubscriber.d.ts +0 -1
- package/lib/node/accounts/grpcAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/grpcMultiAccountSubscriber.d.ts +0 -1
- package/lib/node/accounts/grpcMultiAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/grpcProgramAccountSubscriber.d.ts +0 -1
- package/lib/node/accounts/grpcProgramAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/laserProgramAccountSubscriber.d.ts +0 -1
- package/lib/node/accounts/laserProgramAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/webSocketAccountSubscriber.d.ts +0 -1
- package/lib/node/accounts/webSocketAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/webSocketDriftClientAccountSubscriber.d.ts +0 -1
- package/lib/node/accounts/webSocketDriftClientAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/webSocketProgramAccountSubscriber.d.ts +0 -1
- package/lib/node/accounts/webSocketProgramAccountSubscriber.d.ts.map +1 -1
- package/lib/node/driftClient.d.ts +1 -2
- package/lib/node/driftClient.d.ts.map +1 -1
- package/lib/node/driftClient.js +5 -6
- package/lib/node/oracles/pythPullClient.d.ts +2 -2
- package/lib/node/oracles/pythPullClient.d.ts.map +1 -1
- package/lib/node/oracles/pythPullClient.js +5 -2
- package/lib/node/pyth/constants.d.ts +4 -0
- package/lib/node/pyth/constants.d.ts.map +1 -0
- package/lib/node/pyth/constants.js +6 -0
- package/lib/node/pyth/index.d.ts +4 -0
- package/lib/node/pyth/index.d.ts.map +1 -0
- package/lib/node/pyth/index.js +10 -0
- package/lib/node/pyth/types.d.ts +2227 -0
- package/lib/node/pyth/types.d.ts.map +1 -0
- package/lib/node/pyth/types.js +2224 -0
- package/lib/node/pyth/utils.d.ts +3 -0
- package/lib/node/pyth/utils.d.ts.map +1 -0
- package/lib/node/pyth/utils.js +10 -0
- package/lib/node/swap/UnifiedSwapClient.d.ts.map +1 -1
- package/lib/node/swap/UnifiedSwapClient.js +1 -10
- package/lib/node/titan/titanClient.d.ts +4 -5
- package/lib/node/titan/titanClient.d.ts.map +1 -1
- package/lib/node/titan/titanClient.js +2 -16
- package/package.json +3 -4
- package/src/driftClient.ts +9 -11
- package/src/oracles/pythPullClient.ts +4 -5
- package/src/pyth/constants.ts +9 -0
- package/src/pyth/index.ts +11 -0
- package/src/pyth/types.ts +4453 -0
- package/src/pyth/utils.ts +13 -0
- package/src/swap/UnifiedSwapClient.ts +2 -13
- package/src/titan/titanClient.ts +4 -28
- package/tests/decode/test.ts +2 -1
- package/tests/dlob/helpers.ts +0 -1
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.convertPythPrice = exports.PythPullClient = void 0;
|
|
4
7
|
const web3_js_1 = require("@solana/web3.js");
|
|
5
8
|
const anchor_1 = require("@coral-xyz/anchor");
|
|
6
9
|
const numericConstants_1 = require("../constants/numericConstants");
|
|
7
|
-
const
|
|
10
|
+
const pyth_solana_receiver_json_1 = __importDefault(require("../idl/pyth_solana_receiver.json"));
|
|
8
11
|
const config_1 = require("../config");
|
|
9
12
|
const wallet_1 = require("../wallet");
|
|
10
13
|
class PythPullClient {
|
|
@@ -17,7 +20,7 @@ class PythPullClient {
|
|
|
17
20
|
new wallet_1.Wallet(new web3_js_1.Keypair()), {
|
|
18
21
|
commitment: connection.commitment,
|
|
19
22
|
});
|
|
20
|
-
this.receiver = new anchor_1.Program(
|
|
23
|
+
this.receiver = new anchor_1.Program(pyth_solana_receiver_json_1.default, config_1.DRIFT_ORACLE_RECEIVER_ID, provider);
|
|
21
24
|
this.decodeFunc =
|
|
22
25
|
this.receiver.account.priceUpdateV2.coder.accounts.decodeUnchecked.bind(this.receiver.account.priceUpdateV2.coder.accounts);
|
|
23
26
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/pyth/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,eAAO,MAAM,2BAA2B,WAEvC,CAAC;AAEF,eAAO,MAAM,2BAA2B,WAEvC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_RECEIVER_PROGRAM_ID = exports.DEFAULT_WORMHOLE_PROGRAM_ID = void 0;
|
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
5
|
+
exports.DEFAULT_WORMHOLE_PROGRAM_ID = new web3_js_1.PublicKey('HDwcJBJXjL9FpJ7UBsYBtaDjsBUhuLCUYoz3zr8SWWaQ');
|
|
6
|
+
exports.DEFAULT_RECEIVER_PROGRAM_ID = new web3_js_1.PublicKey('rec5EKMGg6MxZYaMdyBfgwp4d5rB9T1VQH5pJv5LtFJ');
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { WormholeCoreBridgeSolana, WORMHOLE_CORE_BRIDGE_SOLANA_IDL, PythSolanaReceiver, PriceUpdateAccount, } from './types';
|
|
2
|
+
export { DEFAULT_WORMHOLE_PROGRAM_ID, DEFAULT_RECEIVER_PROGRAM_ID, } from './constants';
|
|
3
|
+
export { getGuardianSetPda } from './utils';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pyth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,wBAAwB,EACxB,+BAA+B,EAC/B,kBAAkB,EAClB,kBAAkB,GAClB,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,2BAA2B,EAC3B,2BAA2B,GAC3B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getGuardianSetPda = exports.DEFAULT_RECEIVER_PROGRAM_ID = exports.DEFAULT_WORMHOLE_PROGRAM_ID = exports.WORMHOLE_CORE_BRIDGE_SOLANA_IDL = void 0;
|
|
4
|
+
var types_1 = require("./types");
|
|
5
|
+
Object.defineProperty(exports, "WORMHOLE_CORE_BRIDGE_SOLANA_IDL", { enumerable: true, get: function () { return types_1.WORMHOLE_CORE_BRIDGE_SOLANA_IDL; } });
|
|
6
|
+
var constants_1 = require("./constants");
|
|
7
|
+
Object.defineProperty(exports, "DEFAULT_WORMHOLE_PROGRAM_ID", { enumerable: true, get: function () { return constants_1.DEFAULT_WORMHOLE_PROGRAM_ID; } });
|
|
8
|
+
Object.defineProperty(exports, "DEFAULT_RECEIVER_PROGRAM_ID", { enumerable: true, get: function () { return constants_1.DEFAULT_RECEIVER_PROGRAM_ID; } });
|
|
9
|
+
var utils_1 = require("./utils");
|
|
10
|
+
Object.defineProperty(exports, "getGuardianSetPda", { enumerable: true, get: function () { return utils_1.getGuardianSetPda; } });
|