@taphubhq/sdk-core 0.24.3 → 0.25.1

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
@@ -1873,7 +1873,9 @@ function normaliseUserPnL(node) {
1873
1873
  totalWagered: node.total_wagered,
1874
1874
  totalPayout: node.total_payout,
1875
1875
  totalBids: node.total_bids,
1876
- totalWins: node.total_wins
1876
+ totalWins: node.total_wins,
1877
+ pnlRank: node.pnlRank,
1878
+ volRank: node.volRank
1877
1879
  };
1878
1880
  }
1879
1881
 
@@ -1886,7 +1888,7 @@ var LIST_ENABLED_CURRENCIES_QUERY = `query ListEnabledCurrencies($input: ListEna
1886
1888
  var MY_WALLET_BY_CURRENCY_QUERY = "query MyWalletByCurrency($currency: String!) { myWalletByCurrency(currency: $currency) { id amount currency isEnable } }";
1887
1889
  var USER_PNL_QUERY = `query UserPnL($period: String) {
1888
1890
  userPnL(period: $period) {
1889
- gain total_wagered total_payout total_bids total_wins
1891
+ gain total_wagered total_payout total_bids total_wins pnlRank volRank
1890
1892
  }
1891
1893
  }`;
1892
1894
 
@@ -1904,12 +1906,12 @@ var UserModule = class {
1904
1906
  return normaliseMeResponse(body);
1905
1907
  }
1906
1908
  /**
1907
- * Fetch the authenticated user's realized PnL (grid-api).
1908
- * `period` defaults to 'all_time' ('weekly' also accepted). Agency scope is
1909
+ * Fetch the authenticated user's realized PnL + rank (grid-api).
1910
+ * `period` defaults to '30d' ('weekly' also accepted). Agency scope is
1909
1911
  * resolved server-side from the JWT — never passed from the client.
1910
1912
  */
1911
1913
  async pnl(args) {
1912
- const period = args?.period ?? "all_time";
1914
+ const period = args?.period ?? "30d";
1913
1915
  const body = await this.#graphql.request(
1914
1916
  USER_PNL_QUERY,
1915
1917
  { period },
package/dist/index.d.mts CHANGED
@@ -656,6 +656,8 @@ interface MqttWireAcceptedBid {
656
656
  gameUuid: string;
657
657
  /** Pair id, e.g. "grid-ETH-USD". */
658
658
  pairId?: string;
659
+ /** Display pair, e.g. "ETH/USD"; frozen at placement. */
660
+ pairName?: string;
659
661
  currency: string;
660
662
  amount: string;
661
663
  coefficient: number;
@@ -821,6 +823,8 @@ interface MqttAcceptedBid {
821
823
  gameUuid: string;
822
824
  /** Pair id, e.g. "grid-ETH-USD". */
823
825
  pairId?: string;
826
+ /** Display pair, e.g. "ETH/USD". Frozen at placement; used to label live trades. */
827
+ pairName?: string;
824
828
  currency: string;
825
829
  amount: string;
826
830
  coefficient: number;
@@ -1080,7 +1084,7 @@ interface Wallet {
1080
1084
  currency: string;
1081
1085
  isEnable: boolean;
1082
1086
  }
1083
- type UserPnLPeriod = 'weekly' | 'all_time';
1087
+ type UserPnLPeriod = 'weekly' | '30d';
1084
1088
  /**
1085
1089
  * Public, normalised PnL shape (camelCase). The wire shape is the codegen'd
1086
1090
  * `UserPnL` from `@/types/gql/grid`; `normaliseUserPnL` maps wire → this.
@@ -1092,6 +1096,10 @@ interface UserPnL {
1092
1096
  totalPayout: string;
1093
1097
  totalBids: number;
1094
1098
  totalWins: number;
1099
+ /** Competition rank by PnL in the agency pool for the period (0 = unranked). */
1100
+ pnlRank: number;
1101
+ /** Competition rank by Vol (wagered volume) in the agency pool for the period (0 = unranked). */
1102
+ volRank: number;
1095
1103
  }
1096
1104
 
1097
1105
  interface UserModuleDeps {
@@ -1106,8 +1114,8 @@ declare class UserModule {
1106
1114
  constructor(deps: UserModuleDeps);
1107
1115
  me(): Promise<Me>;
1108
1116
  /**
1109
- * Fetch the authenticated user's realized PnL (grid-api).
1110
- * `period` defaults to 'all_time' ('weekly' also accepted). Agency scope is
1117
+ * Fetch the authenticated user's realized PnL + rank (grid-api).
1118
+ * `period` defaults to '30d' ('weekly' also accepted). Agency scope is
1111
1119
  * resolved server-side from the JWT — never passed from the client.
1112
1120
  */
1113
1121
  pnl(args?: {
package/dist/index.d.ts CHANGED
@@ -656,6 +656,8 @@ interface MqttWireAcceptedBid {
656
656
  gameUuid: string;
657
657
  /** Pair id, e.g. "grid-ETH-USD". */
658
658
  pairId?: string;
659
+ /** Display pair, e.g. "ETH/USD"; frozen at placement. */
660
+ pairName?: string;
659
661
  currency: string;
660
662
  amount: string;
661
663
  coefficient: number;
@@ -821,6 +823,8 @@ interface MqttAcceptedBid {
821
823
  gameUuid: string;
822
824
  /** Pair id, e.g. "grid-ETH-USD". */
823
825
  pairId?: string;
826
+ /** Display pair, e.g. "ETH/USD". Frozen at placement; used to label live trades. */
827
+ pairName?: string;
824
828
  currency: string;
825
829
  amount: string;
826
830
  coefficient: number;
@@ -1080,7 +1084,7 @@ interface Wallet {
1080
1084
  currency: string;
1081
1085
  isEnable: boolean;
1082
1086
  }
1083
- type UserPnLPeriod = 'weekly' | 'all_time';
1087
+ type UserPnLPeriod = 'weekly' | '30d';
1084
1088
  /**
1085
1089
  * Public, normalised PnL shape (camelCase). The wire shape is the codegen'd
1086
1090
  * `UserPnL` from `@/types/gql/grid`; `normaliseUserPnL` maps wire → this.
@@ -1092,6 +1096,10 @@ interface UserPnL {
1092
1096
  totalPayout: string;
1093
1097
  totalBids: number;
1094
1098
  totalWins: number;
1099
+ /** Competition rank by PnL in the agency pool for the period (0 = unranked). */
1100
+ pnlRank: number;
1101
+ /** Competition rank by Vol (wagered volume) in the agency pool for the period (0 = unranked). */
1102
+ volRank: number;
1095
1103
  }
1096
1104
 
1097
1105
  interface UserModuleDeps {
@@ -1106,8 +1114,8 @@ declare class UserModule {
1106
1114
  constructor(deps: UserModuleDeps);
1107
1115
  me(): Promise<Me>;
1108
1116
  /**
1109
- * Fetch the authenticated user's realized PnL (grid-api).
1110
- * `period` defaults to 'all_time' ('weekly' also accepted). Agency scope is
1117
+ * Fetch the authenticated user's realized PnL + rank (grid-api).
1118
+ * `period` defaults to '30d' ('weekly' also accepted). Agency scope is
1111
1119
  * resolved server-side from the JWT — never passed from the client.
1112
1120
  */
1113
1121
  pnl(args?: {
package/dist/index.js CHANGED
@@ -1807,7 +1807,9 @@ function normaliseUserPnL(node) {
1807
1807
  totalWagered: node.total_wagered,
1808
1808
  totalPayout: node.total_payout,
1809
1809
  totalBids: node.total_bids,
1810
- totalWins: node.total_wins
1810
+ totalWins: node.total_wins,
1811
+ pnlRank: node.pnlRank,
1812
+ volRank: node.volRank
1811
1813
  };
1812
1814
  }
1813
1815
 
@@ -1820,7 +1822,7 @@ var LIST_ENABLED_CURRENCIES_QUERY = `query ListEnabledCurrencies($input: ListEna
1820
1822
  var MY_WALLET_BY_CURRENCY_QUERY = "query MyWalletByCurrency($currency: String!) { myWalletByCurrency(currency: $currency) { id amount currency isEnable } }";
1821
1823
  var USER_PNL_QUERY = `query UserPnL($period: String) {
1822
1824
  userPnL(period: $period) {
1823
- gain total_wagered total_payout total_bids total_wins
1825
+ gain total_wagered total_payout total_bids total_wins pnlRank volRank
1824
1826
  }
1825
1827
  }`;
1826
1828
 
@@ -1838,12 +1840,12 @@ var UserModule = class {
1838
1840
  return normaliseMeResponse(body);
1839
1841
  }
1840
1842
  /**
1841
- * Fetch the authenticated user's realized PnL (grid-api).
1842
- * `period` defaults to 'all_time' ('weekly' also accepted). Agency scope is
1843
+ * Fetch the authenticated user's realized PnL + rank (grid-api).
1844
+ * `period` defaults to '30d' ('weekly' also accepted). Agency scope is
1843
1845
  * resolved server-side from the JWT — never passed from the client.
1844
1846
  */
1845
1847
  async pnl(args) {
1846
- const period = args?.period ?? "all_time";
1848
+ const period = args?.period ?? "30d";
1847
1849
  const body = await this.#graphql.request(
1848
1850
  USER_PNL_QUERY,
1849
1851
  { period },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taphubhq/sdk-core",
3
- "version": "0.24.3",
3
+ "version": "0.25.1",
4
4
  "description": "Core SDK for building on the TabHub platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.cjs",