@taphubhq/sdk-core 0.24.3 → 0.25.0
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 +7 -5
- package/dist/index.d.mts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +7 -5
- package/package.json +1 -1
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 '
|
|
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 ?? "
|
|
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
|
@@ -1080,7 +1080,7 @@ interface Wallet {
|
|
|
1080
1080
|
currency: string;
|
|
1081
1081
|
isEnable: boolean;
|
|
1082
1082
|
}
|
|
1083
|
-
type UserPnLPeriod = 'weekly' | '
|
|
1083
|
+
type UserPnLPeriod = 'weekly' | '30d';
|
|
1084
1084
|
/**
|
|
1085
1085
|
* Public, normalised PnL shape (camelCase). The wire shape is the codegen'd
|
|
1086
1086
|
* `UserPnL` from `@/types/gql/grid`; `normaliseUserPnL` maps wire → this.
|
|
@@ -1092,6 +1092,10 @@ interface UserPnL {
|
|
|
1092
1092
|
totalPayout: string;
|
|
1093
1093
|
totalBids: number;
|
|
1094
1094
|
totalWins: number;
|
|
1095
|
+
/** Competition rank by PnL in the agency pool for the period (0 = unranked). */
|
|
1096
|
+
pnlRank: number;
|
|
1097
|
+
/** Competition rank by Vol (wagered volume) in the agency pool for the period (0 = unranked). */
|
|
1098
|
+
volRank: number;
|
|
1095
1099
|
}
|
|
1096
1100
|
|
|
1097
1101
|
interface UserModuleDeps {
|
|
@@ -1106,8 +1110,8 @@ declare class UserModule {
|
|
|
1106
1110
|
constructor(deps: UserModuleDeps);
|
|
1107
1111
|
me(): Promise<Me>;
|
|
1108
1112
|
/**
|
|
1109
|
-
* Fetch the authenticated user's realized PnL (grid-api).
|
|
1110
|
-
* `period` defaults to '
|
|
1113
|
+
* Fetch the authenticated user's realized PnL + rank (grid-api).
|
|
1114
|
+
* `period` defaults to '30d' ('weekly' also accepted). Agency scope is
|
|
1111
1115
|
* resolved server-side from the JWT — never passed from the client.
|
|
1112
1116
|
*/
|
|
1113
1117
|
pnl(args?: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1080,7 +1080,7 @@ interface Wallet {
|
|
|
1080
1080
|
currency: string;
|
|
1081
1081
|
isEnable: boolean;
|
|
1082
1082
|
}
|
|
1083
|
-
type UserPnLPeriod = 'weekly' | '
|
|
1083
|
+
type UserPnLPeriod = 'weekly' | '30d';
|
|
1084
1084
|
/**
|
|
1085
1085
|
* Public, normalised PnL shape (camelCase). The wire shape is the codegen'd
|
|
1086
1086
|
* `UserPnL` from `@/types/gql/grid`; `normaliseUserPnL` maps wire → this.
|
|
@@ -1092,6 +1092,10 @@ interface UserPnL {
|
|
|
1092
1092
|
totalPayout: string;
|
|
1093
1093
|
totalBids: number;
|
|
1094
1094
|
totalWins: number;
|
|
1095
|
+
/** Competition rank by PnL in the agency pool for the period (0 = unranked). */
|
|
1096
|
+
pnlRank: number;
|
|
1097
|
+
/** Competition rank by Vol (wagered volume) in the agency pool for the period (0 = unranked). */
|
|
1098
|
+
volRank: number;
|
|
1095
1099
|
}
|
|
1096
1100
|
|
|
1097
1101
|
interface UserModuleDeps {
|
|
@@ -1106,8 +1110,8 @@ declare class UserModule {
|
|
|
1106
1110
|
constructor(deps: UserModuleDeps);
|
|
1107
1111
|
me(): Promise<Me>;
|
|
1108
1112
|
/**
|
|
1109
|
-
* Fetch the authenticated user's realized PnL (grid-api).
|
|
1110
|
-
* `period` defaults to '
|
|
1113
|
+
* Fetch the authenticated user's realized PnL + rank (grid-api).
|
|
1114
|
+
* `period` defaults to '30d' ('weekly' also accepted). Agency scope is
|
|
1111
1115
|
* resolved server-side from the JWT — never passed from the client.
|
|
1112
1116
|
*/
|
|
1113
1117
|
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 '
|
|
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 ?? "
|
|
1848
|
+
const period = args?.period ?? "30d";
|
|
1847
1849
|
const body = await this.#graphql.request(
|
|
1848
1850
|
USER_PNL_QUERY,
|
|
1849
1851
|
{ period },
|