@gbozee/ultimate 0.0.2-177 → 0.0.2-178

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/dist/index.cjs CHANGED
@@ -54701,13 +54701,29 @@ class AppDatabase {
54701
54701
  });
54702
54702
  return result;
54703
54703
  }
54704
+ get positionExpand() {
54705
+ return "b_config, account_strategy, p_account, proxy, compound_instance.ref,support";
54706
+ }
54707
+ async fetchCentralPositions(payload) {
54708
+ const { asset: assetName, symbol } = payload;
54709
+ const pb = this.pb;
54710
+ let symbolFilter = assetName ? `symbol ~ "${assetName}"` : `symbol = "${symbol}"`;
54711
+ if (this.email) {
54712
+ symbolFilter = `${symbolFilter} && p_account.user.email="${this.email}"`;
54713
+ }
54714
+ let positionsWithAssetName = await pb.collection("positions_view").getFullList({
54715
+ filter: symbolFilter,
54716
+ expand: this.positionExpand
54717
+ });
54718
+ return positionsWithAssetName;
54719
+ }
54704
54720
  async getPositions(options) {
54705
54721
  const { symbol, as_view = false, account, custom_filter } = options;
54706
54722
  let default_params = as_view ? {
54707
54723
  table: "positions_view",
54708
54724
  params: {
54709
54725
  filter: `symbol:lower="${symbol.toLowerCase()}" && p_account.owner:lower="${account.owner.toLowerCase()}" && p_account.exchange:lower="${account.exchange.toLowerCase()}"`,
54710
- expand: "b_config, account_strategy, p_account, proxy, compound_instance.ref,support"
54726
+ expand: this.positionExpand
54711
54727
  }
54712
54728
  } : {
54713
54729
  table: "positions",
package/dist/index.d.ts CHANGED
@@ -664,6 +664,11 @@ export declare class AppDatabase {
664
664
  proxy: Proxy$1;
665
665
  };
666
666
  }>;
667
+ get positionExpand(): string;
668
+ fetchCentralPositions(payload: {
669
+ asset?: string;
670
+ symbol?: string;
671
+ }): Promise<import("pocketbase").RecordModel[]>;
667
672
  getPositions(options: {
668
673
  account?: ExchangeType;
669
674
  symbol?: string;
package/dist/index.js CHANGED
@@ -54639,13 +54639,29 @@ class AppDatabase {
54639
54639
  });
54640
54640
  return result;
54641
54641
  }
54642
+ get positionExpand() {
54643
+ return "b_config, account_strategy, p_account, proxy, compound_instance.ref,support";
54644
+ }
54645
+ async fetchCentralPositions(payload) {
54646
+ const { asset: assetName, symbol } = payload;
54647
+ const pb = this.pb;
54648
+ let symbolFilter = assetName ? `symbol ~ "${assetName}"` : `symbol = "${symbol}"`;
54649
+ if (this.email) {
54650
+ symbolFilter = `${symbolFilter} && p_account.user.email="${this.email}"`;
54651
+ }
54652
+ let positionsWithAssetName = await pb.collection("positions_view").getFullList({
54653
+ filter: symbolFilter,
54654
+ expand: this.positionExpand
54655
+ });
54656
+ return positionsWithAssetName;
54657
+ }
54642
54658
  async getPositions(options) {
54643
54659
  const { symbol, as_view = false, account, custom_filter } = options;
54644
54660
  let default_params = as_view ? {
54645
54661
  table: "positions_view",
54646
54662
  params: {
54647
54663
  filter: `symbol:lower="${symbol.toLowerCase()}" && p_account.owner:lower="${account.owner.toLowerCase()}" && p_account.exchange:lower="${account.exchange.toLowerCase()}"`,
54648
- expand: "b_config, account_strategy, p_account, proxy, compound_instance.ref,support"
54664
+ expand: this.positionExpand
54649
54665
  }
54650
54666
  } : {
54651
54667
  table: "positions",
@@ -61395,13 +61395,29 @@ class AppDatabase {
61395
61395
  });
61396
61396
  return result;
61397
61397
  }
61398
+ get positionExpand() {
61399
+ return "b_config, account_strategy, p_account, proxy, compound_instance.ref,support";
61400
+ }
61401
+ async fetchCentralPositions(payload) {
61402
+ const { asset: assetName, symbol } = payload;
61403
+ const pb = this.pb;
61404
+ let symbolFilter = assetName ? `symbol ~ "${assetName}"` : `symbol = "${symbol}"`;
61405
+ if (this.email) {
61406
+ symbolFilter = `${symbolFilter} && p_account.user.email="${this.email}"`;
61407
+ }
61408
+ let positionsWithAssetName = await pb.collection("positions_view").getFullList({
61409
+ filter: symbolFilter,
61410
+ expand: this.positionExpand
61411
+ });
61412
+ return positionsWithAssetName;
61413
+ }
61398
61414
  async getPositions(options) {
61399
61415
  const { symbol, as_view = false, account, custom_filter } = options;
61400
61416
  let default_params = as_view ? {
61401
61417
  table: "positions_view",
61402
61418
  params: {
61403
61419
  filter: `symbol:lower="${symbol.toLowerCase()}" && p_account.owner:lower="${account.owner.toLowerCase()}" && p_account.exchange:lower="${account.exchange.toLowerCase()}"`,
61404
- expand: "b_config, account_strategy, p_account, proxy, compound_instance.ref,support"
61420
+ expand: this.positionExpand
61405
61421
  }
61406
61422
  } : {
61407
61423
  table: "positions",
@@ -61368,13 +61368,29 @@ class AppDatabase {
61368
61368
  });
61369
61369
  return result;
61370
61370
  }
61371
+ get positionExpand() {
61372
+ return "b_config, account_strategy, p_account, proxy, compound_instance.ref,support";
61373
+ }
61374
+ async fetchCentralPositions(payload) {
61375
+ const { asset: assetName, symbol } = payload;
61376
+ const pb = this.pb;
61377
+ let symbolFilter = assetName ? `symbol ~ "${assetName}"` : `symbol = "${symbol}"`;
61378
+ if (this.email) {
61379
+ symbolFilter = `${symbolFilter} && p_account.user.email="${this.email}"`;
61380
+ }
61381
+ let positionsWithAssetName = await pb.collection("positions_view").getFullList({
61382
+ filter: symbolFilter,
61383
+ expand: this.positionExpand
61384
+ });
61385
+ return positionsWithAssetName;
61386
+ }
61371
61387
  async getPositions(options) {
61372
61388
  const { symbol, as_view = false, account, custom_filter } = options;
61373
61389
  let default_params = as_view ? {
61374
61390
  table: "positions_view",
61375
61391
  params: {
61376
61392
  filter: `symbol:lower="${symbol.toLowerCase()}" && p_account.owner:lower="${account.owner.toLowerCase()}" && p_account.exchange:lower="${account.exchange.toLowerCase()}"`,
61377
- expand: "b_config, account_strategy, p_account, proxy, compound_instance.ref,support"
61393
+ expand: this.positionExpand
61378
61394
  }
61379
61395
  } : {
61380
61396
  table: "positions",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gbozee/ultimate",
3
3
  "type": "module",
4
- "version": "0.0.2-177",
4
+ "version": "0.0.2-178",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",