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

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.5
@@ -1 +1 @@
1
- export * from './grpc.node';
1
+ export declare function createClient(..._args: any): void;
@@ -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.5",
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
  });
@@ -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;