@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.
Files changed (71) hide show
  1. package/VERSION +1 -1
  2. package/lib/browser/accounts/grpcAccountSubscriber.d.ts +0 -1
  3. package/lib/browser/accounts/grpcMultiAccountSubscriber.d.ts +0 -1
  4. package/lib/browser/accounts/grpcProgramAccountSubscriber.d.ts +0 -1
  5. package/lib/browser/accounts/laserProgramAccountSubscriber.d.ts +0 -1
  6. package/lib/browser/accounts/webSocketAccountSubscriber.d.ts +0 -1
  7. package/lib/browser/accounts/webSocketDriftClientAccountSubscriber.d.ts +0 -1
  8. package/lib/browser/accounts/webSocketProgramAccountSubscriber.d.ts +0 -1
  9. package/lib/browser/driftClient.d.ts +1 -2
  10. package/lib/browser/driftClient.js +5 -6
  11. package/lib/browser/oracles/pythPullClient.d.ts +2 -2
  12. package/lib/browser/oracles/pythPullClient.js +5 -2
  13. package/lib/browser/pyth/constants.d.ts +3 -0
  14. package/lib/browser/pyth/constants.js +6 -0
  15. package/lib/browser/pyth/index.d.ts +3 -0
  16. package/lib/browser/pyth/index.js +10 -0
  17. package/lib/browser/pyth/types.d.ts +2226 -0
  18. package/lib/browser/pyth/types.js +2224 -0
  19. package/lib/browser/pyth/utils.d.ts +2 -0
  20. package/lib/browser/pyth/utils.js +10 -0
  21. package/lib/browser/swap/UnifiedSwapClient.js +1 -10
  22. package/lib/browser/titan/titanClient.d.ts +4 -5
  23. package/lib/browser/titan/titanClient.js +2 -16
  24. package/lib/node/accounts/grpcAccountSubscriber.d.ts +0 -1
  25. package/lib/node/accounts/grpcAccountSubscriber.d.ts.map +1 -1
  26. package/lib/node/accounts/grpcMultiAccountSubscriber.d.ts +0 -1
  27. package/lib/node/accounts/grpcMultiAccountSubscriber.d.ts.map +1 -1
  28. package/lib/node/accounts/grpcProgramAccountSubscriber.d.ts +0 -1
  29. package/lib/node/accounts/grpcProgramAccountSubscriber.d.ts.map +1 -1
  30. package/lib/node/accounts/laserProgramAccountSubscriber.d.ts +0 -1
  31. package/lib/node/accounts/laserProgramAccountSubscriber.d.ts.map +1 -1
  32. package/lib/node/accounts/webSocketAccountSubscriber.d.ts +0 -1
  33. package/lib/node/accounts/webSocketAccountSubscriber.d.ts.map +1 -1
  34. package/lib/node/accounts/webSocketDriftClientAccountSubscriber.d.ts +0 -1
  35. package/lib/node/accounts/webSocketDriftClientAccountSubscriber.d.ts.map +1 -1
  36. package/lib/node/accounts/webSocketProgramAccountSubscriber.d.ts +0 -1
  37. package/lib/node/accounts/webSocketProgramAccountSubscriber.d.ts.map +1 -1
  38. package/lib/node/driftClient.d.ts +1 -2
  39. package/lib/node/driftClient.d.ts.map +1 -1
  40. package/lib/node/driftClient.js +5 -6
  41. package/lib/node/oracles/pythPullClient.d.ts +2 -2
  42. package/lib/node/oracles/pythPullClient.d.ts.map +1 -1
  43. package/lib/node/oracles/pythPullClient.js +5 -2
  44. package/lib/node/pyth/constants.d.ts +4 -0
  45. package/lib/node/pyth/constants.d.ts.map +1 -0
  46. package/lib/node/pyth/constants.js +6 -0
  47. package/lib/node/pyth/index.d.ts +4 -0
  48. package/lib/node/pyth/index.d.ts.map +1 -0
  49. package/lib/node/pyth/index.js +10 -0
  50. package/lib/node/pyth/types.d.ts +2227 -0
  51. package/lib/node/pyth/types.d.ts.map +1 -0
  52. package/lib/node/pyth/types.js +2224 -0
  53. package/lib/node/pyth/utils.d.ts +3 -0
  54. package/lib/node/pyth/utils.d.ts.map +1 -0
  55. package/lib/node/pyth/utils.js +10 -0
  56. package/lib/node/swap/UnifiedSwapClient.d.ts.map +1 -1
  57. package/lib/node/swap/UnifiedSwapClient.js +1 -10
  58. package/lib/node/titan/titanClient.d.ts +4 -5
  59. package/lib/node/titan/titanClient.d.ts.map +1 -1
  60. package/lib/node/titan/titanClient.js +2 -16
  61. package/package.json +3 -4
  62. package/src/driftClient.ts +9 -11
  63. package/src/oracles/pythPullClient.ts +4 -5
  64. package/src/pyth/constants.ts +9 -0
  65. package/src/pyth/index.ts +11 -0
  66. package/src/pyth/types.ts +4453 -0
  67. package/src/pyth/utils.ts +13 -0
  68. package/src/swap/UnifiedSwapClient.ts +2 -13
  69. package/src/titan/titanClient.ts +4 -28
  70. package/tests/decode/test.ts +2 -1
  71. 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 pyth_solana_receiver_1 = require("@pythnetwork/pyth-solana-receiver");
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(pyth_solana_receiver_1.pythSolanaReceiverIdl, config_1.DRIFT_ORACLE_RECEIVER_ID, provider);
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,4 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+ export declare const DEFAULT_WORMHOLE_PROGRAM_ID: PublicKey;
3
+ export declare const DEFAULT_RECEIVER_PROGRAM_ID: PublicKey;
4
+ //# sourceMappingURL=constants.d.ts.map
@@ -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; } });