@drift-labs/sdk 2.104.0-beta.2 → 2.104.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/README.md CHANGED
@@ -273,4 +273,3 @@ Unless you explicitly state otherwise, any contribution intentionally submitted
273
273
  for inclusion in Drift SDK by you, as defined in the Apache-2.0 license, shall be
274
274
  licensed as above, without any additional terms or conditions.
275
275
 
276
-
package/VERSION CHANGED
@@ -1 +1 @@
1
- 2.104.0-beta.2
1
+ 2.104.0-beta.4
package/bun.lockb CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.104.0-beta.2",
3
+ "version": "2.104.0-beta.4",
4
4
  "main": "lib/node/index.js",
5
5
  "types": "lib/node/index.d.ts",
6
6
  "browser": "./lib/browser/index.js",
@@ -13,6 +13,7 @@
13
13
  "scripts": {
14
14
  "lint": "eslint './**/*.{ts,tsx}' --quiet",
15
15
  "build": "yarn clean && tsc -p tsconfig.json && tsc -p tsconfig.browser.json && node scripts/postbuild.js",
16
+ "build:browser": "yarn clean && tsc -p tsconfig.json && tsc -p tsconfig.browser.json && node scripts/postbuild.js --force-env browser",
16
17
  "clean": "rm -rf lib",
17
18
  "test": "mocha -r ts-node/register tests/**/*.ts",
18
19
  "test:inspect": "mocha --inspect-brk -r ts-node/register tests/**/*.ts",
@@ -47,7 +48,7 @@
47
48
  "@solana/spl-token": "0.3.7",
48
49
  "@solana/web3.js": "1.92.3",
49
50
  "@switchboard-xyz/on-demand": "1.2.42",
50
- "@triton-one/yellowstone-grpc": "0.6.0",
51
+ "@triton-one/yellowstone-grpc": "1.3.0",
51
52
  "anchor-bankrun": "^0.3.0",
52
53
  "node-cache": "^5.1.2",
53
54
  "rpc-websockets": "7.5.1",
@@ -55,6 +56,7 @@
55
56
  "strict-event-emitter-types": "^2.0.0",
56
57
  "tweetnacl": "1.0.3",
57
58
  "uuid": "^8.3.2",
59
+ "yargs": "^17.7.2",
58
60
  "zstddec": "^0.1.0"
59
61
  },
60
62
  "devDependencies": {
@@ -81,7 +83,7 @@
81
83
  },
82
84
  "description": "SDK for Drift Protocol",
83
85
  "engines": {
84
- "node": ">=18"
86
+ "node": ">=20.18.0"
85
87
  },
86
88
  "resolutions": {
87
89
  "@solana/errors": "2.0.0-preview.4",
@@ -1,9 +1,18 @@
1
1
  // scripts/postbuild.js
2
2
  const fs = require('fs');
3
3
  const path = require('path');
4
+ const yargs = require('yargs/yargs');
5
+ const { hideBin } = require('yargs/helpers');
4
6
 
5
- const isomorphicPackages = ['grpc'];
7
+ const forceEnv = yargs(hideBin(process.argv))
8
+ .option('force-env', {
9
+ type: 'string',
10
+ description: 'Specify environment to force (node or browser)',
11
+ choices: ['node', 'browser']
12
+ })
13
+ .argv?.forceEnv;
6
14
 
15
+ const isomorphicPackages = ['grpc'];
7
16
  const environments = ['node', 'browser'];
8
17
 
9
18
  environments.forEach((environment) => {
@@ -20,13 +29,15 @@ environments.forEach((environment) => {
20
29
  package + '.js'
21
30
  );
22
31
 
32
+ const targetEnv = forceEnv ? forceEnv : environment;
33
+
23
34
  const targetPath = path.join(
24
35
  __dirname,
25
36
  '..',
26
37
  'lib',
27
38
  environment,
28
39
  'isomorphic',
29
- `${package}.${environment}.js`
40
+ `${package}.${targetEnv}.js`
30
41
  );
31
42
 
32
43
  try {