@depthhq/maker-sdk 0.1.6 → 0.1.8

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.
@@ -11,6 +11,7 @@ export type MakerOptions = ConnectionOptions & {
11
11
  appId?: PublicKey | string;
12
12
  cursorDirectory?: string;
13
13
  privateViews?: "memory" | "device";
14
+ viewAuthorization?: "session" | "wallet";
14
15
  settlement?: "keeper" | "wallet";
15
16
  };
16
17
  export type ResolvedMakerOptions = ResolvedConnection & Omit<MakerOptions, keyof ConnectionOptions | "maker" | "appId"> & {
package/dist/index.js CHANGED
@@ -27627,6 +27627,8 @@ class MakerClient {
27627
27627
  appId: this.options.appId,
27628
27628
  environment: this.options.environment,
27629
27629
  privateViews: this.options.privateViews,
27630
+ viewAuthorization: this.options.viewAuthorization,
27631
+ serviceUrl: this.options.serviceUrl,
27630
27632
  settlement: this.options.settlement
27631
27633
  });
27632
27634
  return this.ownerClient;
@@ -28049,6 +28051,10 @@ class MakerClient {
28049
28051
  });
28050
28052
  }
28051
28053
  async requestView(kind, view, viewNonce, accounts2) {
28054
+ if (this.options.wallet.publicKey.equals(this.options.maker) && (this.options.viewAuthorization === "session" || this.options.viewAuthorization !== "wallet" && this.options.privateViews === "device" && this.options.serviceUrl)) {
28055
+ const client = await this.owned();
28056
+ return client.views.request(kind, accounts2.marketAccount ?? accounts2.order ?? accounts2.quote);
28057
+ }
28052
28058
  const mxePublicKey = await getMXEPublicKey(this.provider, DEPTH_PROGRAM_ID4);
28053
28059
  if (!mxePublicKey)
28054
28060
  throw new Error("MXE public key is unavailable");
@@ -26148,6 +26148,8 @@ class MakerClient {
26148
26148
  appId: this.options.appId,
26149
26149
  environment: this.options.environment,
26150
26150
  privateViews: this.options.privateViews,
26151
+ viewAuthorization: this.options.viewAuthorization,
26152
+ serviceUrl: this.options.serviceUrl,
26151
26153
  settlement: this.options.settlement
26152
26154
  });
26153
26155
  return this.ownerClient;
@@ -26570,6 +26572,10 @@ class MakerClient {
26570
26572
  });
26571
26573
  }
26572
26574
  async requestView(kind, view, viewNonce, accounts2) {
26575
+ if (this.options.wallet.publicKey.equals(this.options.maker) && (this.options.viewAuthorization === "session" || this.options.viewAuthorization !== "wallet" && this.options.privateViews === "device" && this.options.serviceUrl)) {
26576
+ const client = await this.owned();
26577
+ return client.views.request(kind, accounts2.marketAccount ?? accounts2.order ?? accounts2.quote);
26578
+ }
26573
26579
  const mxePublicKey = await getMXEPublicKey(this.provider, DEPTH_PROGRAM_ID4);
26574
26580
  if (!mxePublicKey)
26575
26581
  throw new Error("MXE public key is unavailable");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depthhq/maker-sdk",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -29,8 +29,8 @@
29
29
  "@solana/web3.js": "1.99.0",
30
30
  "buffer": "6.0.3",
31
31
  "viem": "2.38.0",
32
- "@depthhq/bindings": "0.1.1",
33
- "@depthhq/sdk": "0.1.3"
32
+ "@depthhq/sdk": "0.1.5",
33
+ "@depthhq/bindings": "0.1.2"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "node ../../scripts/build-package.mjs maker-sdk",