@depthhq/maker-sdk 0.1.4 → 0.1.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.
@@ -10,6 +10,8 @@ export type MakerOptions = ConnectionOptions & {
10
10
  makerOwner?: PublicKey;
11
11
  appId?: PublicKey | string;
12
12
  cursorDirectory?: string;
13
+ privateViews?: "memory" | "device";
14
+ settlement?: "keeper" | "wallet";
13
15
  };
14
16
  export type ResolvedMakerOptions = ResolvedConnection & Omit<MakerOptions, keyof ConnectionOptions | "maker" | "appId"> & {
15
17
  maker: PublicKey;
package/dist/index.js CHANGED
@@ -27303,7 +27303,7 @@ class QuoteHandle {
27303
27303
  const snapshot = await view.wait({ timeoutMs: 60000 });
27304
27304
  if (snapshot.status === "pending")
27305
27305
  throw new Error(`Quote balance view ${view.id.toBase58()} is still pending`);
27306
- await view.close();
27306
+ await view.deferClose();
27307
27307
  this.balanceView = undefined;
27308
27308
  if (snapshot.status === "ready" && "remainingCapacity" in snapshot && snapshot.remainingCapacity !== undefined)
27309
27309
  return snapshot.remainingCapacity;
@@ -27624,7 +27624,10 @@ class MakerClient {
27624
27624
  deployment: this.options.deployment,
27625
27625
  connection: this.options.connection,
27626
27626
  wallet: this.options.wallet,
27627
- appId: this.options.appId
27627
+ appId: this.options.appId,
27628
+ environment: this.options.environment,
27629
+ privateViews: this.options.privateViews,
27630
+ settlement: this.options.settlement
27628
27631
  });
27629
27632
  return this.ownerClient;
27630
27633
  }
@@ -28072,10 +28075,12 @@ class MakerClient {
28072
28075
  addMargin: async (amount3, clientNonce) => (await this.owned()).position.addMargin(amount3, clientNonce),
28073
28076
  removeMargin: async (amount3, clientNonce) => (await this.owned()).position.removeMargin(amount3, clientNonce),
28074
28077
  summary: async (options = { timeoutMs: 30000 }) => {
28078
+ if (this.options.wallet.publicKey.equals(this.options.maker))
28079
+ return (await this.owned()).position.summary(options);
28075
28080
  const view = await this.requestMarketView();
28076
28081
  const result = await view.wait(options);
28077
28082
  if (result.status !== "pending")
28078
- await view.close();
28083
+ await view.deferClose();
28079
28084
  return result;
28080
28085
  }
28081
28086
  };
@@ -28105,7 +28110,7 @@ class MakerClient {
28105
28110
  const view = await this.requestFillView(order2);
28106
28111
  const result = await view.wait(options);
28107
28112
  if (result.status !== "pending")
28108
- await view.close();
28113
+ await view.deferClose();
28109
28114
  return result;
28110
28115
  }
28111
28116
  };
@@ -25822,7 +25822,7 @@ class QuoteHandle {
25822
25822
  const snapshot = await view.wait({ timeoutMs: 60000 });
25823
25823
  if (snapshot.status === "pending")
25824
25824
  throw new Error(`Quote balance view ${view.id.toBase58()} is still pending`);
25825
- await view.close();
25825
+ await view.deferClose();
25826
25826
  this.balanceView = undefined;
25827
25827
  if (snapshot.status === "ready" && "remainingCapacity" in snapshot && snapshot.remainingCapacity !== undefined)
25828
25828
  return snapshot.remainingCapacity;
@@ -26145,7 +26145,10 @@ class MakerClient {
26145
26145
  deployment: this.options.deployment,
26146
26146
  connection: this.options.connection,
26147
26147
  wallet: this.options.wallet,
26148
- appId: this.options.appId
26148
+ appId: this.options.appId,
26149
+ environment: this.options.environment,
26150
+ privateViews: this.options.privateViews,
26151
+ settlement: this.options.settlement
26149
26152
  });
26150
26153
  return this.ownerClient;
26151
26154
  }
@@ -26593,10 +26596,12 @@ class MakerClient {
26593
26596
  addMargin: async (amount3, clientNonce) => (await this.owned()).position.addMargin(amount3, clientNonce),
26594
26597
  removeMargin: async (amount3, clientNonce) => (await this.owned()).position.removeMargin(amount3, clientNonce),
26595
26598
  summary: async (options = { timeoutMs: 30000 }) => {
26599
+ if (this.options.wallet.publicKey.equals(this.options.maker))
26600
+ return (await this.owned()).position.summary(options);
26596
26601
  const view = await this.requestMarketView();
26597
26602
  const result = await view.wait(options);
26598
26603
  if (result.status !== "pending")
26599
- await view.close();
26604
+ await view.deferClose();
26600
26605
  return result;
26601
26606
  }
26602
26607
  };
@@ -26626,7 +26631,7 @@ class MakerClient {
26626
26631
  const view = await this.requestFillView(order2);
26627
26632
  const result = await view.wait(options);
26628
26633
  if (result.status !== "pending")
26629
- await view.close();
26634
+ await view.deferClose();
26630
26635
  return result;
26631
26636
  }
26632
26637
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depthhq/maker-sdk",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
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/sdk": "0.1.2",
33
- "@depthhq/bindings": "0.1.1"
32
+ "@depthhq/bindings": "0.1.1",
33
+ "@depthhq/sdk": "0.1.3"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "node ../../scripts/build-package.mjs maker-sdk",