@drift-labs/sdk 2.104.0-beta.4 → 2.104.0-beta.6

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 CHANGED
@@ -1 +1 @@
1
- 2.104.0-beta.4
1
+ 2.104.0-beta.6
@@ -979,6 +979,17 @@ exports.MainnetPerpMarkets = [
979
979
  oracleSource: __1.OracleSource.PYTH_PULL,
980
980
  pythFeedId: '0x6e3f3fa8253588df9326580180233eb791e03b443a3ba7a1d892e73874e19a54',
981
981
  },
982
+ {
983
+ fullName: 'Magic Eden',
984
+ category: ['DEX'],
985
+ symbol: 'ME-PERP',
986
+ baseAssetSymbol: 'ME',
987
+ marketIndex: 61,
988
+ oracle: new web3_js_1.PublicKey('FLQjrmEPGwbCKRYZ1eYM5FPccHBrCv2cN4GBu3mWfmPH'),
989
+ launchTs: 1733839936000,
990
+ oracleSource: __1.OracleSource.PYTH_PULL,
991
+ pythFeedId: '0x91519e3e48571e1232a85a938e714da19fe5ce05107f3eebb8a870b2e8020169',
992
+ },
982
993
  ];
983
994
  exports.PerpMarkets = {
984
995
  devnet: exports.DevnetPerpMarkets,
@@ -1 +1 @@
1
- export * from './grpc.node';
1
+ export declare function createClient(..._args: any): void;
@@ -979,6 +979,17 @@ exports.MainnetPerpMarkets = [
979
979
  oracleSource: __1.OracleSource.PYTH_PULL,
980
980
  pythFeedId: '0x6e3f3fa8253588df9326580180233eb791e03b443a3ba7a1d892e73874e19a54',
981
981
  },
982
+ {
983
+ fullName: 'Magic Eden',
984
+ category: ['DEX'],
985
+ symbol: 'ME-PERP',
986
+ baseAssetSymbol: 'ME',
987
+ marketIndex: 61,
988
+ oracle: new web3_js_1.PublicKey('FLQjrmEPGwbCKRYZ1eYM5FPccHBrCv2cN4GBu3mWfmPH'),
989
+ launchTs: 1733839936000,
990
+ oracleSource: __1.OracleSource.PYTH_PULL,
991
+ pythFeedId: '0x91519e3e48571e1232a85a938e714da19fe5ce05107f3eebb8a870b2e8020169',
992
+ },
982
993
  ];
983
994
  exports.PerpMarkets = {
984
995
  devnet: exports.DevnetPerpMarkets,
@@ -1 +1,5 @@
1
- export * from './grpc.node';
1
+ import Client from '@triton-one/yellowstone-grpc';
2
+ import { SubscribeRequest, SubscribeUpdate, CommitmentLevel } from '@triton-one/yellowstone-grpc';
3
+ import { ClientDuplexStream, ChannelOptions } from '@grpc/grpc-js';
4
+ export { ClientDuplexStream, ChannelOptions, SubscribeRequest, SubscribeUpdate, CommitmentLevel, Client, };
5
+ export declare function createClient(...args: ConstructorParameters<typeof Client>): Client;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.104.0-beta.4",
3
+ "version": "2.104.0-beta.6",
4
4
  "main": "lib/node/index.js",
5
5
  "types": "lib/node/index.d.ts",
6
6
  "browser": "./lib/browser/index.js",
@@ -20,52 +20,75 @@ environments.forEach((environment) => {
20
20
  console.log(``);
21
21
 
22
22
  isomorphicPackages.forEach((package) => {
23
- const isomorphPath = path.join(
23
+
24
+ // We want to overwrite the base isomorphic files (the "target" files) with the concrete implementation code and definition files (the "source" files).
25
+
26
+ const isomorphicFolderPath = path.join(
24
27
  __dirname,
25
28
  '..',
26
29
  'lib',
27
30
  environment,
28
- 'isomorphic',
29
- package + '.js'
31
+ 'isomorphic'
30
32
  );
31
33
 
32
34
  const targetEnv = forceEnv ? forceEnv : environment;
33
35
 
34
- const targetPath = path.join(
35
- __dirname,
36
- '..',
37
- 'lib',
38
- environment,
39
- 'isomorphic',
40
- `${package}.${targetEnv}.js`
41
- );
36
+ const filesToSwap = [
37
+ {
38
+ source: `${package}.${targetEnv}.js`,
39
+ target: `${package}.js`,
40
+ },
41
+ {
42
+ source: `${package}.${targetEnv}.d.ts`,
43
+ target: `${package}.d.ts`,
44
+ },
45
+ ];
42
46
 
43
- try {
44
- const content = fs.readFileSync(targetPath, 'utf8');
45
- fs.writeFileSync(isomorphPath, content);
46
- } catch (error) {
47
- console.error(
48
- `Error processing isomophic package : ${package} :: ${error.message}`
47
+ for (const file of filesToSwap) {
48
+ const sourcePath = path.join(
49
+ isomorphicFolderPath,
50
+ file.source
49
51
  );
52
+
53
+ const targetPath = path.join(
54
+ isomorphicFolderPath,
55
+ file.target
56
+ );
57
+
58
+ try {
59
+ const sourceContent = fs.readFileSync(sourcePath, 'utf8');
60
+ fs.writeFileSync(targetPath, sourceContent);
61
+ } catch (error) {
62
+ console.error(
63
+ `Error processing isomophic package : ${package} :: ${error.message}`
64
+ );
65
+ }
50
66
  }
51
67
 
52
68
  // Delete other environment files for safety
53
69
  environments.forEach((otherEnvironment) => {
54
- if (otherEnvironment === environment) {
70
+ if (otherEnvironment === targetEnv) {
55
71
  return;
56
72
  }
57
73
 
58
- const otherTargetPath = path.join(
59
- __dirname,
60
- '..',
61
- 'lib',
62
- environment,
63
- 'isomorphic',
64
- `${package}.${otherEnvironment}.js`
65
- );
74
+ const otherTargetFiles = [
75
+ `${package}.${otherEnvironment}.js`,
76
+ `${package}.${otherEnvironment}.d.ts`,
77
+ ];
78
+
79
+ for (const otherTargetFile of otherTargetFiles) {
80
+ const otherTargetPath = path.join(
81
+ __dirname,
82
+ '..',
83
+ 'lib',
84
+ environment,
85
+ 'isomorphic',
86
+ otherTargetFile
87
+ );
66
88
 
67
- if (fs.existsSync(otherTargetPath)) {
68
- fs.unlinkSync(otherTargetPath);
89
+ if (fs.existsSync(otherTargetPath)) {
90
+ fs.unlinkSync(otherTargetPath);
91
+ }
69
92
  }
70
93
  });
71
94
  });
@@ -1064,6 +1064,18 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
1064
1064
  pythFeedId:
1065
1065
  '0x6e3f3fa8253588df9326580180233eb791e03b443a3ba7a1d892e73874e19a54',
1066
1066
  },
1067
+ {
1068
+ fullName: 'Magic Eden',
1069
+ category: ['DEX'],
1070
+ symbol: 'ME-PERP',
1071
+ baseAssetSymbol: 'ME',
1072
+ marketIndex: 61,
1073
+ oracle: new PublicKey('FLQjrmEPGwbCKRYZ1eYM5FPccHBrCv2cN4GBu3mWfmPH'),
1074
+ launchTs: 1733839936000,
1075
+ oracleSource: OracleSource.PYTH_PULL,
1076
+ pythFeedId:
1077
+ '0x91519e3e48571e1232a85a938e714da19fe5ce05107f3eebb8a870b2e8020169',
1078
+ },
1067
1079
  ];
1068
1080
 
1069
1081
  export const PerpMarkets: { [key in DriftEnv]: PerpMarketConfig[] } = {
@@ -1,5 +0,0 @@
1
- import Client from '@triton-one/yellowstone-grpc';
2
- import { SubscribeRequest, SubscribeUpdate, CommitmentLevel } from '@triton-one/yellowstone-grpc';
3
- import { ClientDuplexStream, ChannelOptions } from '@grpc/grpc-js';
4
- export { ClientDuplexStream, ChannelOptions, SubscribeRequest, SubscribeUpdate, CommitmentLevel, Client, };
5
- export declare function createClient(...args: ConstructorParameters<typeof Client>): Client;
@@ -1 +0,0 @@
1
- export declare function createClient(..._args: any): void;