@depthhq/maker-sdk 0.1.3 → 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.
@@ -35,6 +35,7 @@ export declare class MakerClient {
35
35
  static create(options: MakerOptions): Promise<MakerClient>;
36
36
  private accountActions;
37
37
  readonly account: (() => {
38
+ state: () => Promise<import("@depthhq/sdk").AccountState>;
38
39
  history: (options?: Parameters<DepthClient["account"]["history"]>[0]) => Promise<import("@depthhq/sdk").PendingPage>;
39
40
  cancelOpen: () => Promise<string>;
40
41
  open: () => Promise<{
@@ -61,6 +62,7 @@ export declare class MakerClient {
61
62
  }, clientNonce?: bigint) => Promise<import("@depthhq/sdk").TransferHandle>;
62
63
  transferHandle: (nonce: bigint) => import("@depthhq/sdk").TransferHandle;
63
64
  }) & {
65
+ state: () => Promise<import("@depthhq/sdk").AccountState>;
64
66
  history: (options?: Parameters<DepthClient["account"]["history"]>[0]) => Promise<import("@depthhq/sdk").PendingPage>;
65
67
  cancelOpen: () => Promise<string>;
66
68
  open: () => Promise<{
@@ -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
  }
@@ -27685,6 +27688,7 @@ class MakerClient {
27685
27688
  }
27686
27689
  accountActions() {
27687
27690
  const actions = {
27691
+ state: async () => (await this.owned()).account.state(),
27688
27692
  history: async (options) => (await this.owned()).account.history(options),
27689
27693
  cancelOpen: () => this.funding.cancelOpenBalance(),
27690
27694
  open: async () => this.funding.openBalance(),
@@ -28071,10 +28075,12 @@ class MakerClient {
28071
28075
  addMargin: async (amount3, clientNonce) => (await this.owned()).position.addMargin(amount3, clientNonce),
28072
28076
  removeMargin: async (amount3, clientNonce) => (await this.owned()).position.removeMargin(amount3, clientNonce),
28073
28077
  summary: async (options = { timeoutMs: 30000 }) => {
28078
+ if (this.options.wallet.publicKey.equals(this.options.maker))
28079
+ return (await this.owned()).position.summary(options);
28074
28080
  const view = await this.requestMarketView();
28075
28081
  const result = await view.wait(options);
28076
28082
  if (result.status !== "pending")
28077
- await view.close();
28083
+ await view.deferClose();
28078
28084
  return result;
28079
28085
  }
28080
28086
  };
@@ -28104,7 +28110,7 @@ class MakerClient {
28104
28110
  const view = await this.requestFillView(order2);
28105
28111
  const result = await view.wait(options);
28106
28112
  if (result.status !== "pending")
28107
- await view.close();
28113
+ await view.deferClose();
28108
28114
  return result;
28109
28115
  }
28110
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
  }
@@ -26206,6 +26209,7 @@ class MakerClient {
26206
26209
  }
26207
26210
  accountActions() {
26208
26211
  const actions = {
26212
+ state: async () => (await this.owned()).account.state(),
26209
26213
  history: async (options) => (await this.owned()).account.history(options),
26210
26214
  cancelOpen: () => this.funding.cancelOpenBalance(),
26211
26215
  open: async () => this.funding.openBalance(),
@@ -26592,10 +26596,12 @@ class MakerClient {
26592
26596
  addMargin: async (amount3, clientNonce) => (await this.owned()).position.addMargin(amount3, clientNonce),
26593
26597
  removeMargin: async (amount3, clientNonce) => (await this.owned()).position.removeMargin(amount3, clientNonce),
26594
26598
  summary: async (options = { timeoutMs: 30000 }) => {
26599
+ if (this.options.wallet.publicKey.equals(this.options.maker))
26600
+ return (await this.owned()).position.summary(options);
26595
26601
  const view = await this.requestMarketView();
26596
26602
  const result = await view.wait(options);
26597
26603
  if (result.status !== "pending")
26598
- await view.close();
26604
+ await view.deferClose();
26599
26605
  return result;
26600
26606
  }
26601
26607
  };
@@ -26625,7 +26631,7 @@ class MakerClient {
26625
26631
  const view = await this.requestFillView(order2);
26626
26632
  const result = await view.wait(options);
26627
26633
  if (result.status !== "pending")
26628
- await view.close();
26634
+ await view.deferClose();
26629
26635
  return result;
26630
26636
  }
26631
26637
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depthhq/maker-sdk",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -30,7 +30,7 @@
30
30
  "buffer": "6.0.3",
31
31
  "viem": "2.38.0",
32
32
  "@depthhq/bindings": "0.1.1",
33
- "@depthhq/sdk": "0.1.1"
33
+ "@depthhq/sdk": "0.1.3"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "node ../../scripts/build-package.mjs maker-sdk",