@nadohq/mobile-client 0.28.0 → 0.30.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/{MobileClient-9JSAzblH.cjs → MobileClient-CfDtaEeL.cjs} +21 -1
- package/dist/MobileClient-CfDtaEeL.cjs.map +1 -0
- package/dist/MobileClient.cjs +1 -1
- package/dist/MobileClient.d.cts +21 -9
- package/dist/MobileClient.d.cts.map +1 -1
- package/dist/MobileClient.d.ts +21 -9
- package/dist/MobileClient.d.ts.map +1 -1
- package/dist/MobileClient.js +21 -1
- package/dist/MobileClient.js.map +1 -1
- package/dist/{MobileServerFailureError-DUXjO_3w.d.ts → MobileServerFailureError-B11rr9O5.d.cts} +7 -12
- package/dist/MobileServerFailureError-B11rr9O5.d.cts.map +1 -0
- package/dist/{MobileServerFailureError-BfdqvDBi.d.cts → MobileServerFailureError-DoIvXqYV.d.ts} +7 -12
- package/dist/MobileServerFailureError-DoIvXqYV.d.ts.map +1 -0
- package/dist/{buildSignedMobileRequest-CDRsRNHm.d.ts → buildSignedMobileRequest-B4KJ6T1y.d.ts} +2 -2
- package/dist/{buildSignedMobileRequest-CDRsRNHm.d.ts.map → buildSignedMobileRequest-B4KJ6T1y.d.ts.map} +1 -1
- package/dist/{buildSignedMobileRequest-BsbBkU0K.d.cts → buildSignedMobileRequest-EEnDgZF8.d.cts} +2 -2
- package/dist/{buildSignedMobileRequest-BsbBkU0K.d.cts.map → buildSignedMobileRequest-EEnDgZF8.d.cts.map} +1 -1
- package/dist/{canonicalize-Dm7sXwPg.d.cts → canonicalize-CDdYnhL3.d.cts} +2 -2
- package/dist/canonicalize-CDdYnhL3.d.cts.map +1 -0
- package/dist/{canonicalize-PX6dTIdF.d.ts → canonicalize-Cc7hdZLJ.d.ts} +2 -2
- package/dist/canonicalize-Cc7hdZLJ.d.ts.map +1 -0
- package/dist/{clientTypes-DWW2N66c.d.ts → clientTypes-BsOps_pY.d.ts} +67 -3
- package/dist/clientTypes-BsOps_pY.d.ts.map +1 -0
- package/dist/{clientTypes-Et0PUa2d.d.cts → clientTypes-UFInIAQd.d.cts} +67 -3
- package/dist/clientTypes-UFInIAQd.d.cts.map +1 -0
- package/dist/dataMappers.cjs +33 -0
- package/dist/dataMappers.cjs.map +1 -1
- package/dist/dataMappers.d.cts +8 -3
- package/dist/dataMappers.d.cts.map +1 -1
- package/dist/dataMappers.d.ts +8 -3
- package/dist/dataMappers.d.ts.map +1 -1
- package/dist/dataMappers.js +33 -1
- package/dist/dataMappers.js.map +1 -1
- package/dist/{eip712MethodByType-DJgXal9r.d.ts → eip712MethodByType-B67XiwTu.d.ts} +2 -2
- package/dist/eip712MethodByType-B67XiwTu.d.ts.map +1 -0
- package/dist/{eip712MethodByType-DLh9MRsD.d.cts → eip712MethodByType-DCU415zf.d.cts} +2 -2
- package/dist/eip712MethodByType-DCU415zf.d.cts.map +1 -0
- package/dist/feed-BF5k6Ryu.d.ts +14 -0
- package/dist/feed-BF5k6Ryu.d.ts.map +1 -0
- package/dist/feed-CBIwOhTO.d.cts +14 -0
- package/dist/feed-CBIwOhTO.d.cts.map +1 -0
- package/dist/index.cjs +8 -1
- package/dist/index.d.cts +17 -15
- package/dist/index.d.ts +17 -15
- package/dist/index.js +3 -1
- package/dist/{mobileErrorCodes-QG5XbEY6.d.ts → mobileErrorCodes-Cj84nBnT.d.cts} +7 -5
- package/dist/mobileErrorCodes-Cj84nBnT.d.cts.map +1 -0
- package/dist/{mobileErrorCodes-BeyBKmwh.d.cts → mobileErrorCodes-Czmigq9x.d.ts} +7 -5
- package/dist/mobileErrorCodes-Czmigq9x.d.ts.map +1 -0
- package/dist/{patterns-BbxH3_VA.d.ts → patterns-B5gi7OfV.d.ts} +1 -1
- package/dist/patterns-B5gi7OfV.d.ts.map +1 -0
- package/dist/{patterns-B9J2ldpx.d.cts → patterns-Db6fgz8i.d.cts} +1 -1
- package/dist/patterns-Db6fgz8i.d.cts.map +1 -0
- package/dist/{payloadHash-nj8WuLUP.d.cts → payloadHash-BSoGv3Lz.d.cts} +2 -2
- package/dist/payloadHash-BSoGv3Lz.d.cts.map +1 -0
- package/dist/{payloadHash-Bmhzs78N.d.ts → payloadHash-BVP2v3p9.d.ts} +2 -2
- package/dist/payloadHash-BVP2v3p9.d.ts.map +1 -0
- package/dist/serverBaseTypes-A16onlPN.d.cts +25 -0
- package/dist/serverBaseTypes-A16onlPN.d.cts.map +1 -0
- package/dist/serverBaseTypes-m3zEi0X9.d.ts +25 -0
- package/dist/serverBaseTypes-m3zEi0X9.d.ts.map +1 -0
- package/dist/{serverExecuteTypes-DKYK1V7C.d.cts → serverExecuteTypes-C-bioiuQ.d.cts} +2 -2
- package/dist/serverExecuteTypes-C-bioiuQ.d.cts.map +1 -0
- package/dist/{serverExecuteTypes-CXnMjKnt.d.ts → serverExecuteTypes-DfzWOeIx.d.ts} +2 -2
- package/dist/serverExecuteTypes-DfzWOeIx.d.ts.map +1 -0
- package/dist/serverModelTypes-CPZUvVil.d.cts +143 -0
- package/dist/serverModelTypes-CPZUvVil.d.cts.map +1 -0
- package/dist/serverModelTypes-CqnqHY5F.d.ts +143 -0
- package/dist/serverModelTypes-CqnqHY5F.d.ts.map +1 -0
- package/dist/serverQueryTypes-CJLWWZBs.d.ts +91 -0
- package/dist/serverQueryTypes-CJLWWZBs.d.ts.map +1 -0
- package/dist/serverQueryTypes-C_cCx0Ac.d.cts +91 -0
- package/dist/serverQueryTypes-C_cCx0Ac.d.cts.map +1 -0
- package/dist/serverRequestTypes-DQDy3K9O.d.ts +62 -0
- package/dist/serverRequestTypes-DQDy3K9O.d.ts.map +1 -0
- package/dist/serverRequestTypes-DnU_FfMI.d.cts +62 -0
- package/dist/serverRequestTypes-DnU_FfMI.d.cts.map +1 -0
- package/dist/{serverResponseGuards-DjCNL3CR.d.cts → serverResponseGuards-BlvfJjsa.d.cts} +2 -2
- package/dist/{serverResponseGuards-DjCNL3CR.d.cts.map → serverResponseGuards-BlvfJjsa.d.cts.map} +1 -1
- package/dist/{serverResponseGuards-C_vZIgGl.d.ts → serverResponseGuards-gpHH8SHk.d.ts} +2 -2
- package/dist/{serverResponseGuards-C_vZIgGl.d.ts.map → serverResponseGuards-gpHH8SHk.d.ts.map} +1 -1
- package/dist/signing/buildSignedMobileRequest.cjs +1 -1
- package/dist/signing/buildSignedMobileRequest.d.cts +1 -1
- package/dist/signing/buildSignedMobileRequest.d.ts +1 -1
- package/dist/signing/canonicalize.d.cts +1 -1
- package/dist/signing/canonicalize.d.ts +1 -1
- package/dist/signing/eip712MethodByType.d.cts +1 -1
- package/dist/signing/eip712MethodByType.d.ts +1 -1
- package/dist/signing/index.d.cts +5 -5
- package/dist/signing/index.d.ts +5 -5
- package/dist/signing/payloadHash.cjs +1 -1
- package/dist/signing/payloadHash.d.cts +1 -1
- package/dist/signing/payloadHash.d.ts +1 -1
- package/dist/signing/types.d.cts +1 -1
- package/dist/signing/types.d.ts +1 -1
- package/dist/types/MobileServerFailureError.cjs +5 -7
- package/dist/types/MobileServerFailureError.cjs.map +1 -1
- package/dist/types/MobileServerFailureError.d.cts +1 -1
- package/dist/types/MobileServerFailureError.d.ts +1 -1
- package/dist/types/MobileServerFailureError.js +4 -7
- package/dist/types/MobileServerFailureError.js.map +1 -1
- package/dist/types/clientTypes.d.cts +2 -2
- package/dist/types/clientTypes.d.ts +2 -2
- package/dist/types/index.cjs +4 -0
- package/dist/types/index.d.cts +9 -8
- package/dist/types/index.d.ts +9 -8
- package/dist/types/index.js +2 -1
- package/dist/types/mobileErrorCodes.cjs +9 -5
- package/dist/types/mobileErrorCodes.cjs.map +1 -1
- package/dist/types/mobileErrorCodes.d.cts +1 -1
- package/dist/types/mobileErrorCodes.d.ts +1 -1
- package/dist/types/mobileErrorCodes.js +8 -4
- package/dist/types/mobileErrorCodes.js.map +1 -1
- package/dist/types/serverBaseTypes.d.cts +2 -2
- package/dist/types/serverBaseTypes.d.ts +2 -2
- package/dist/types/serverExecuteTypes.d.cts +1 -1
- package/dist/types/serverExecuteTypes.d.ts +1 -1
- package/dist/types/serverModelTypes.cjs +29 -0
- package/dist/types/serverModelTypes.cjs.map +1 -0
- package/dist/types/serverModelTypes.d.cts +2 -2
- package/dist/types/serverModelTypes.d.ts +2 -2
- package/dist/types/serverModelTypes.js +26 -1
- package/dist/types/serverModelTypes.js.map +1 -0
- package/dist/types/serverQueryTypes.d.cts +2 -2
- package/dist/types/serverQueryTypes.d.ts +2 -2
- package/dist/types/serverRequestTypes.cjs +0 -0
- package/dist/types/serverRequestTypes.d.cts +2 -0
- package/dist/types/serverRequestTypes.d.ts +2 -0
- package/dist/types/serverRequestTypes.js +1 -0
- package/dist/{types-uCD4BNZR.d.cts → types-CzOeSYnW.d.cts} +3 -3
- package/dist/{types-uCD4BNZR.d.cts.map → types-CzOeSYnW.d.cts.map} +1 -1
- package/dist/{types-B76Pn7Sy.d.ts → types-UHjZR-js.d.ts} +3 -3
- package/dist/{types-B76Pn7Sy.d.ts.map → types-UHjZR-js.d.ts.map} +1 -1
- package/dist/utils/feed.cjs +17 -0
- package/dist/utils/feed.cjs.map +1 -0
- package/dist/utils/feed.d.cts +2 -0
- package/dist/utils/feed.d.ts +2 -0
- package/dist/utils/feed.js +15 -0
- package/dist/utils/feed.js.map +1 -0
- package/dist/utils/index.cjs +3 -0
- package/dist/utils/index.d.cts +4 -3
- package/dist/utils/index.d.ts +4 -3
- package/dist/utils/index.js +2 -1
- package/dist/utils/patterns.d.cts +1 -1
- package/dist/utils/patterns.d.ts +1 -1
- package/dist/utils/serverResponseGuards.d.cts +1 -1
- package/dist/utils/serverResponseGuards.d.ts +1 -1
- package/package.json +3 -3
- package/src/MobileClient.ts +49 -27
- package/src/dataMappers.ts +40 -0
- package/src/types/MobileServerFailureError.ts +10 -22
- package/src/types/clientTypes.ts +70 -0
- package/src/types/index.ts +1 -0
- package/src/types/mobileErrorCodes.ts +7 -3
- package/src/types/serverBaseTypes.ts +7 -28
- package/src/types/serverModelTypes.ts +93 -0
- package/src/types/serverQueryTypes.ts +83 -39
- package/src/types/serverRequestTypes.ts +68 -0
- package/src/utils/feed.ts +11 -0
- package/src/utils/index.ts +1 -0
- package/dist/MobileClient-9JSAzblH.cjs.map +0 -1
- package/dist/MobileServerFailureError-BfdqvDBi.d.cts.map +0 -1
- package/dist/MobileServerFailureError-DUXjO_3w.d.ts.map +0 -1
- package/dist/canonicalize-Dm7sXwPg.d.cts.map +0 -1
- package/dist/canonicalize-PX6dTIdF.d.ts.map +0 -1
- package/dist/clientTypes-DWW2N66c.d.ts.map +0 -1
- package/dist/clientTypes-Et0PUa2d.d.cts.map +0 -1
- package/dist/eip712MethodByType-DJgXal9r.d.ts.map +0 -1
- package/dist/eip712MethodByType-DLh9MRsD.d.cts.map +0 -1
- package/dist/mobileErrorCodes-BeyBKmwh.d.cts.map +0 -1
- package/dist/mobileErrorCodes-QG5XbEY6.d.ts.map +0 -1
- package/dist/patterns-B9J2ldpx.d.cts.map +0 -1
- package/dist/patterns-BbxH3_VA.d.ts.map +0 -1
- package/dist/payloadHash-Bmhzs78N.d.ts.map +0 -1
- package/dist/payloadHash-nj8WuLUP.d.cts.map +0 -1
- package/dist/serverBaseTypes-BicXMrZV.d.cts +0 -43
- package/dist/serverBaseTypes-BicXMrZV.d.cts.map +0 -1
- package/dist/serverBaseTypes-ewbo8l4R.d.ts +0 -43
- package/dist/serverBaseTypes-ewbo8l4R.d.ts.map +0 -1
- package/dist/serverExecuteTypes-CXnMjKnt.d.ts.map +0 -1
- package/dist/serverExecuteTypes-DKYK1V7C.d.cts.map +0 -1
- package/dist/serverModelTypes-CQgfqgW3.d.cts +0 -69
- package/dist/serverModelTypes-CQgfqgW3.d.cts.map +0 -1
- package/dist/serverModelTypes-vEPhHIit.d.ts +0 -69
- package/dist/serverModelTypes-vEPhHIit.d.ts.map +0 -1
- package/dist/serverQueryTypes-BI-2TD8F.d.ts +0 -53
- package/dist/serverQueryTypes-BI-2TD8F.d.ts.map +0 -1
- package/dist/serverQueryTypes-D7Yharse.d.cts +0 -53
- package/dist/serverQueryTypes-D7Yharse.d.cts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as MobileFeedTradePosition, c as MobileNotificationCategory, i as MobileFeedMarginMode, l as MobileNotificationPlatform } from "./serverModelTypes-CPZUvVil.cjs";
|
|
2
2
|
import { SignatureParams, Subaccount } from "@nadohq/shared";
|
|
3
3
|
import { Hex } from "viem";
|
|
4
4
|
|
|
@@ -39,6 +39,53 @@ interface MobileUsernameAvailability {
|
|
|
39
39
|
username: string;
|
|
40
40
|
available: boolean;
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Margin of a feed trade. Branch on `mode` — do not infer isolated state from leverage presence:
|
|
44
|
+
* `estimatedLeverage` (a rounded whole-number estimate, not exact submitted leverage) is `undefined` on
|
|
45
|
+
* `cross`, and also `undefined` inside `isolated` when no estimate is available.
|
|
46
|
+
*/
|
|
47
|
+
interface MobileFeedMargin {
|
|
48
|
+
mode: MobileFeedMarginMode;
|
|
49
|
+
estimatedLeverage?: number;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* A single feed trade: one row per order digest, enriched with the trader's current identity at read time
|
|
53
|
+
* (a rename can change an already-fetched trade on the next read). Amounts are display-oriented human-unit
|
|
54
|
+
* numbers — do not use them for accounting, order construction, or exact threshold decisions.
|
|
55
|
+
*/
|
|
56
|
+
interface MobileFeedTrade {
|
|
57
|
+
/** Order digest this trade is keyed by; the stable id for reconciling live pagination. */
|
|
58
|
+
orderDigest: Hex;
|
|
59
|
+
subaccount: Hex;
|
|
60
|
+
username: string;
|
|
61
|
+
displayName: string;
|
|
62
|
+
/** Reserved for a future avatar source; `null` until one is implemented. */
|
|
63
|
+
avatarUrl: string | null;
|
|
64
|
+
productId: number;
|
|
65
|
+
/** Executed quantity in human units. */
|
|
66
|
+
quantity: number;
|
|
67
|
+
/** Trade notional in whole-dollar human units. */
|
|
68
|
+
notional: number;
|
|
69
|
+
/** Average execution price in human units. */
|
|
70
|
+
averagePrice: number;
|
|
71
|
+
margin: MobileFeedMargin;
|
|
72
|
+
/** Resulting position change. `position.direction` is NOT the execution buy/sell side. */
|
|
73
|
+
position: MobileFeedTradePosition;
|
|
74
|
+
/** Realized PnL of the trade in human units; can be negative. */
|
|
75
|
+
realizedPnl: number;
|
|
76
|
+
/** Fill time as a Unix timestamp (milliseconds). */
|
|
77
|
+
filledAt: number;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* A page of feed trades. `nextCursor` is `null` when there was no additional candidate at query time.
|
|
81
|
+
* Pagination is live, not snapshot, so a later fill can move a trade between pages — deduplicate by
|
|
82
|
+
* {@link MobileFeedTrade.orderDigest} and treat the merged list as a short-lived view, not an authoritative
|
|
83
|
+
* cache (removals from Private Mode or blacklists are not signaled).
|
|
84
|
+
*/
|
|
85
|
+
interface MobileFeedPage {
|
|
86
|
+
trades: MobileFeedTrade[];
|
|
87
|
+
nextCursor: string | null;
|
|
88
|
+
}
|
|
42
89
|
/**
|
|
43
90
|
* Scope limiting a notification category preference. Scopes are part of the wire format but rejected by the
|
|
44
91
|
* backend for the MVP — `scopes` must be empty.
|
|
@@ -103,6 +150,23 @@ interface GetMobileUsernameAvailabilityParams {
|
|
|
103
150
|
interface GetMobilePublicProfileParams {
|
|
104
151
|
username: string;
|
|
105
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* Params for {@link MobileClient.getFeed}.
|
|
155
|
+
*/
|
|
156
|
+
interface GetMobileFeedParams {
|
|
157
|
+
/**
|
|
158
|
+
* Minimum notional filter as a whole-dollar safe integer, at least `MOBILE_FEED_MIN_NOTIONAL_FLOOR`
|
|
159
|
+
* ($1,000). Omit for the unfiltered feed.
|
|
160
|
+
*/
|
|
161
|
+
minimumNotional?: number;
|
|
162
|
+
/** Page size, 1–`MOBILE_FEED_MAX_PAGE_SIZE` (50); the backend defaults to 50 when omitted. */
|
|
163
|
+
limit?: number;
|
|
164
|
+
/**
|
|
165
|
+
* Opaque keyset cursor from a prior page's {@link MobileFeedPage.nextCursor}. Send it back unchanged with
|
|
166
|
+
* the exact same `minimumNotional` it was issued for.
|
|
167
|
+
*/
|
|
168
|
+
cursor?: string;
|
|
169
|
+
}
|
|
106
170
|
/**
|
|
107
171
|
* Params for {@link MobileClient.getSelfIdentity}.
|
|
108
172
|
*/
|
|
@@ -164,5 +228,5 @@ type GetMobileNotificationPreferencesParams = MobileSignedRequestParams;
|
|
|
164
228
|
*/
|
|
165
229
|
type GetMobileRegisteredDevicesParams = MobileSignedRequestParams;
|
|
166
230
|
//#endregion
|
|
167
|
-
export {
|
|
168
|
-
//# sourceMappingURL=clientTypes-
|
|
231
|
+
export { MobileUsernameAvailability as C, MobileUpdateUsernameParams as S, MobileRegisteredDevice as _, GetMobileSelfIdentityParams as a, MobileUnregisterExpoTokenParams as b, MobileFeedMargin as c, MobileIdentity as d, MobileNotificationCategoryPreference as f, MobileRegisterExpoTokenParams as g, MobilePublicProfile as h, GetMobileRegisteredDevicesParams as i, MobileFeedPage as l, MobileNotificationPreferences as m, GetMobileNotificationPreferencesParams as n, GetMobileUsernameAvailabilityParams as o, MobileNotificationPreferenceScope as p, GetMobilePublicProfileParams as r, MobileClaimUsernameParams as s, GetMobileFeedParams as t, MobileFeedTrade as u, MobileSetPrivateModeParams as v, MobileUpdateNotificationPreferencesParams as x, MobileSignedRequestParams as y };
|
|
232
|
+
//# sourceMappingURL=clientTypes-UFInIAQd.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientTypes-UFInIAQd.d.cts","names":[],"sources":["../src/types/src/types/clientTypes.ts"],"mappings":";;;;;;;AAiBA;;;;;;UAAiB,cAAA;EACf,UAAA,EAAY,GAAG;EAUf;;AAAW;AAMb;EAXE,QAAA;;;;EAIA,WAAA;EACA,WAAA;AAAA;;AASW;AAMb;UATiB,mBAAA;EACf,UAAA,EAAY,GAAG;EACf,QAAA;EACA,WAAA;AAAA;;;;UAMe,0BAAA;EACf,QAAA;EACA,SAAS;AAAA;AAUQ;AAQnB;;;;AARmB,UAFF,gBAAA;EACf,IAAA,EAAM,oBAAoB;EAC1B,iBAAA;AAAA;;;;;;UAQe,eAAA;EAKf;EAHA,WAAA,EAAa,GAAA;EACb,UAAA,EAAY,GAAA;EACZ,QAAA;EACA,WAAA;EASA;EAPA,SAAA;EACA,SAAA;EASA;EAPA,QAAA;EASA;EAPA,QAAA;EASQ;EAPR,YAAA;EACA,MAAA,EAAQ,gBAAA;EAeqB;EAb7B,QAAA,EAAU,uBAAA;EAca;EAZvB,WAAA;EAYQ;EAVR,QAAA;AAAA;AAWU;AAOZ;;;;;AAPY,UAFK,cAAA;EACf,MAAA,EAAQ,eAAe;EACvB,UAAA;AAAA;;AAS8B;AAKhC;;KAPY,iCAAA;EACN,IAAA;EAAoB,UAAA,EAAY,GAAG;AAAA;EACnC,IAAA;EAAiB,SAAA;AAAA;;AAQoB;AAO3C;UAViB,oCAAA;EACf,QAAA,EAAU,0BAAA;EACV,OAAA;EACA,MAAA,EAAQ,iCAAiC;AAAA;;;AAUO;AAMlD;UATiB,6BAAA;;EAEf,aAAA;EACA,UAAA,EAAY,oCAAoC;AAAA;;;;UAMjC,sBAAA;EAeL;EAbV,QAAA,EAAU,0BAA0B;EAmBrB;EAjBf,MAAA;;EAEA,UAAA;EAgBmC;AAKrC;;;EAhBE,sBAAA;EAiBW;AAMb;;EAnBE,UAAA;AAAA;AAoBQ;AAMV;;AANU,UAdO,yBAAA,SACP,UAAA,EAAY,eAAe;;;;UAKpB,mCAAA;EACf,WAAW;AAAA;;;;UAMI,4BAAA;EACf,QAAQ;AAAA;;;AA8BG;UAxBI,mBAAA;EA8B2B;;;AAC/B;EA1BX,eAAA;EAgC0C;EA9B1C,KAAA;EA8BkD;AACvC;AAMb;;EAhCE,MAAA;AAAA;;;;KAMU,2BAAA,GAA8B,yBAAyB;;;;UAKlD,yBAAA,SAAkC,yBAAyB;EAC1E,WAAW;AAAA;;;AAwCF;UAlCM,0BAAA,SAAmC,yBAAyB;EAC3E,WAAW;AAAA;;;;UAMI,0BAAA,SAAmC,yBAAyB;EAC3E,WAAW;AAAA;AAuCb;;;AAAA,UAjCiB,6BAAA,SAAsC,yBAAyB;EAiCF;AAK9E;;EAlCE,SAAA;EACA,QAAA,EAAU,0BAAA;EAiC4D;;;EA7BtE,MAAA;;;;EAIA,UAAA;AAAA;;;;UAMe,+BAAA,SAAwC,yBAAyB;EAChF,SAAS;AAAA;;;;UAMM,yCAAA,SAAkD,yBAAyB;EAC1F,WAAA,EAAa,6BAAA;AAAA;;;;KAMH,sCAAA,GAAyC,yBAAyB;;;;KAKlE,gCAAA,GAAmC,yBAAyB"}
|
package/dist/dataMappers.cjs
CHANGED
|
@@ -68,6 +68,38 @@ function mapMobileNotificationPreferenceScopeToServer(scope) {
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
|
+
* Maps a server-side feed trade (snake_case) to its client-side (camelCase) representation.
|
|
72
|
+
*/
|
|
73
|
+
function mapMobileFeedTrade(server) {
|
|
74
|
+
return {
|
|
75
|
+
orderDigest: server.order_digest,
|
|
76
|
+
subaccount: server.subaccount,
|
|
77
|
+
username: server.username,
|
|
78
|
+
displayName: server.display_name,
|
|
79
|
+
avatarUrl: server.avatar_url,
|
|
80
|
+
productId: server.product_id,
|
|
81
|
+
quantity: server.quantity,
|
|
82
|
+
notional: server.notional,
|
|
83
|
+
averagePrice: server.average_price,
|
|
84
|
+
margin: {
|
|
85
|
+
mode: server.margin.mode,
|
|
86
|
+
estimatedLeverage: server.margin.estimated_leverage
|
|
87
|
+
},
|
|
88
|
+
position: server.position,
|
|
89
|
+
realizedPnl: server.realized_pnl,
|
|
90
|
+
filledAt: server.filled_at_ms
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Maps a server-side feed response to a client-side {@link MobileFeedPage}.
|
|
95
|
+
*/
|
|
96
|
+
function mapMobileFeedPage(server) {
|
|
97
|
+
return {
|
|
98
|
+
trades: server.trades.map(mapMobileFeedTrade),
|
|
99
|
+
nextCursor: server.next_cursor
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
71
103
|
* Maps a server-side registered device (snake_case) to its client-side (camelCase) representation.
|
|
72
104
|
*/
|
|
73
105
|
function mapMobileRegisteredDevice(server) {
|
|
@@ -80,6 +112,7 @@ function mapMobileRegisteredDevice(server) {
|
|
|
80
112
|
};
|
|
81
113
|
}
|
|
82
114
|
//#endregion
|
|
115
|
+
exports.mapMobileFeedPage = mapMobileFeedPage;
|
|
83
116
|
exports.mapMobileIdentity = mapMobileIdentity;
|
|
84
117
|
exports.mapMobileNotificationPreferences = mapMobileNotificationPreferences;
|
|
85
118
|
exports.mapMobileNotificationPreferencesToServer = mapMobileNotificationPreferencesToServer;
|
package/dist/dataMappers.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataMappers.cjs","names":[],"sources":["../src/dataMappers.ts"],"sourcesContent":["import {\n MobileIdentity,\n MobileNotificationPreferenceScope,\n MobileNotificationPreferences,\n MobilePublicProfile,\n MobileRegisteredDevice,\n} from './types/clientTypes';\nimport {\n MobileServerIdentity,\n MobileServerNotificationPreferenceScope,\n MobileServerNotificationPreferences,\n MobileServerProfile,\n MobileServerRegisteredDevice,\n} from './types/serverModelTypes';\n\n/**\n * Maps a server-side identity (snake_case) to its client-side (camelCase) representation.\n */\nexport function mapMobileIdentity(\n server: MobileServerIdentity,\n): MobileIdentity {\n return {\n subaccount: server.subaccount,\n username: server.username,\n displayName: server.display_name,\n privateMode: server.private_mode,\n };\n}\n\n/**\n * Maps a server-side public profile (snake_case) to its client-side (camelCase) representation.\n */\nexport function mapMobilePublicProfile(\n server: MobileServerProfile,\n): MobilePublicProfile {\n return {\n subaccount: server.subaccount,\n username: server.username,\n displayName: server.display_name,\n };\n}\n\n/**\n * Maps server-side notification preferences (snake_case) to their client-side (camelCase) representation.\n */\nexport function mapMobileNotificationPreferences(\n server: MobileServerNotificationPreferences,\n): MobileNotificationPreferences {\n return {\n schemaVersion: server.schema_version,\n categories: server.categories.map((category) => ({\n category: category.category,\n enabled: category.enabled,\n scopes: category.scopes.map(mapMobileNotificationPreferenceScope),\n })),\n };\n}\n\nfunction mapMobileNotificationPreferenceScope(\n server: MobileServerNotificationPreferenceScope,\n): MobileNotificationPreferenceScope {\n if (server.type === 'subaccount') {\n return { type: 'subaccount', subaccount: server.subaccount };\n }\n return { type: 'product', productId: server.product_id };\n}\n\n/**\n * Maps client-side notification preferences (camelCase) to the server-side (snake_case) wire shape.\n */\nexport function mapMobileNotificationPreferencesToServer(\n preferences: MobileNotificationPreferences,\n): MobileServerNotificationPreferences {\n return {\n schema_version: preferences.schemaVersion,\n categories: preferences.categories.map((category) => ({\n category: category.category,\n enabled: category.enabled,\n scopes: category.scopes.map(mapMobileNotificationPreferenceScopeToServer),\n })),\n };\n}\n\nfunction mapMobileNotificationPreferenceScopeToServer(\n scope: MobileNotificationPreferenceScope,\n): MobileServerNotificationPreferenceScope {\n if (scope.type === 'subaccount') {\n return { type: 'subaccount', subaccount: scope.subaccount };\n }\n return { type: 'product', product_id: scope.productId };\n}\n\n/**\n * Maps a server-side registered device (snake_case) to its client-side (camelCase) representation.\n */\nexport function mapMobileRegisteredDevice(\n server: MobileServerRegisteredDevice,\n): MobileRegisteredDevice {\n return {\n platform: server.platform,\n locale: server.locale,\n appVersion: server.app_version,\n tokenFingerprintPrefix: server.token_fingerprint_prefix,\n lastSeenAt: server.last_seen_at,\n };\n}\n"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"dataMappers.cjs","names":[],"sources":["../src/dataMappers.ts"],"sourcesContent":["import {\n MobileFeedPage,\n MobileFeedTrade,\n MobileIdentity,\n MobileNotificationPreferenceScope,\n MobileNotificationPreferences,\n MobilePublicProfile,\n MobileRegisteredDevice,\n} from './types/clientTypes';\nimport {\n MobileServerFeedTrade,\n MobileServerIdentity,\n MobileServerNotificationPreferenceScope,\n MobileServerNotificationPreferences,\n MobileServerProfile,\n MobileServerRegisteredDevice,\n} from './types/serverModelTypes';\nimport { MobileServerFeedResponse } from './types/serverQueryTypes';\n\n/**\n * Maps a server-side identity (snake_case) to its client-side (camelCase) representation.\n */\nexport function mapMobileIdentity(\n server: MobileServerIdentity,\n): MobileIdentity {\n return {\n subaccount: server.subaccount,\n username: server.username,\n displayName: server.display_name,\n privateMode: server.private_mode,\n };\n}\n\n/**\n * Maps a server-side public profile (snake_case) to its client-side (camelCase) representation.\n */\nexport function mapMobilePublicProfile(\n server: MobileServerProfile,\n): MobilePublicProfile {\n return {\n subaccount: server.subaccount,\n username: server.username,\n displayName: server.display_name,\n };\n}\n\n/**\n * Maps server-side notification preferences (snake_case) to their client-side (camelCase) representation.\n */\nexport function mapMobileNotificationPreferences(\n server: MobileServerNotificationPreferences,\n): MobileNotificationPreferences {\n return {\n schemaVersion: server.schema_version,\n categories: server.categories.map((category) => ({\n category: category.category,\n enabled: category.enabled,\n scopes: category.scopes.map(mapMobileNotificationPreferenceScope),\n })),\n };\n}\n\nfunction mapMobileNotificationPreferenceScope(\n server: MobileServerNotificationPreferenceScope,\n): MobileNotificationPreferenceScope {\n if (server.type === 'subaccount') {\n return { type: 'subaccount', subaccount: server.subaccount };\n }\n return { type: 'product', productId: server.product_id };\n}\n\n/**\n * Maps client-side notification preferences (camelCase) to the server-side (snake_case) wire shape.\n */\nexport function mapMobileNotificationPreferencesToServer(\n preferences: MobileNotificationPreferences,\n): MobileServerNotificationPreferences {\n return {\n schema_version: preferences.schemaVersion,\n categories: preferences.categories.map((category) => ({\n category: category.category,\n enabled: category.enabled,\n scopes: category.scopes.map(mapMobileNotificationPreferenceScopeToServer),\n })),\n };\n}\n\nfunction mapMobileNotificationPreferenceScopeToServer(\n scope: MobileNotificationPreferenceScope,\n): MobileServerNotificationPreferenceScope {\n if (scope.type === 'subaccount') {\n return { type: 'subaccount', subaccount: scope.subaccount };\n }\n return { type: 'product', product_id: scope.productId };\n}\n\n/**\n * Maps a server-side feed trade (snake_case) to its client-side (camelCase) representation.\n */\nfunction mapMobileFeedTrade(server: MobileServerFeedTrade): MobileFeedTrade {\n return {\n orderDigest: server.order_digest,\n subaccount: server.subaccount,\n username: server.username,\n displayName: server.display_name,\n avatarUrl: server.avatar_url,\n productId: server.product_id,\n quantity: server.quantity,\n notional: server.notional,\n averagePrice: server.average_price,\n margin: {\n mode: server.margin.mode,\n estimatedLeverage: server.margin.estimated_leverage,\n },\n position: server.position,\n realizedPnl: server.realized_pnl,\n filledAt: server.filled_at_ms,\n };\n}\n\n/**\n * Maps a server-side feed response to a client-side {@link MobileFeedPage}.\n */\nexport function mapMobileFeedPage(\n server: MobileServerFeedResponse,\n): MobileFeedPage {\n return {\n trades: server.trades.map(mapMobileFeedTrade),\n nextCursor: server.next_cursor,\n };\n}\n\n/**\n * Maps a server-side registered device (snake_case) to its client-side (camelCase) representation.\n */\nexport function mapMobileRegisteredDevice(\n server: MobileServerRegisteredDevice,\n): MobileRegisteredDevice {\n return {\n platform: server.platform,\n locale: server.locale,\n appVersion: server.app_version,\n tokenFingerprintPrefix: server.token_fingerprint_prefix,\n lastSeenAt: server.last_seen_at,\n };\n}\n"],"mappings":";;;;;AAsBA,SAAgB,kBACd,QACgB;CAChB,OAAO;EACL,YAAY,OAAO;EACnB,UAAU,OAAO;EACjB,aAAa,OAAO;EACpB,aAAa,OAAO;CACtB;AACF;;;;AAKA,SAAgB,uBACd,QACqB;CACrB,OAAO;EACL,YAAY,OAAO;EACnB,UAAU,OAAO;EACjB,aAAa,OAAO;CACtB;AACF;;;;AAKA,SAAgB,iCACd,QAC+B;CAC/B,OAAO;EACL,eAAe,OAAO;EACtB,YAAY,OAAO,WAAW,KAAK,cAAc;GAC/C,UAAU,SAAS;GACnB,SAAS,SAAS;GAClB,QAAQ,SAAS,OAAO,IAAI,oCAAoC;EAClE,EAAE;CACJ;AACF;AAEA,SAAS,qCACP,QACmC;CACnC,IAAI,OAAO,SAAS,cAClB,OAAO;EAAE,MAAM;EAAc,YAAY,OAAO;CAAW;CAE7D,OAAO;EAAE,MAAM;EAAW,WAAW,OAAO;CAAW;AACzD;;;;AAKA,SAAgB,yCACd,aACqC;CACrC,OAAO;EACL,gBAAgB,YAAY;EAC5B,YAAY,YAAY,WAAW,KAAK,cAAc;GACpD,UAAU,SAAS;GACnB,SAAS,SAAS;GAClB,QAAQ,SAAS,OAAO,IAAI,4CAA4C;EAC1E,EAAE;CACJ;AACF;AAEA,SAAS,6CACP,OACyC;CACzC,IAAI,MAAM,SAAS,cACjB,OAAO;EAAE,MAAM;EAAc,YAAY,MAAM;CAAW;CAE5D,OAAO;EAAE,MAAM;EAAW,YAAY,MAAM;CAAU;AACxD;;;;AAKA,SAAS,mBAAmB,QAAgD;CAC1E,OAAO;EACL,aAAa,OAAO;EACpB,YAAY,OAAO;EACnB,UAAU,OAAO;EACjB,aAAa,OAAO;EACpB,WAAW,OAAO;EAClB,WAAW,OAAO;EAClB,UAAU,OAAO;EACjB,UAAU,OAAO;EACjB,cAAc,OAAO;EACrB,QAAQ;GACN,MAAM,OAAO,OAAO;GACpB,mBAAmB,OAAO,OAAO;EACnC;EACA,UAAU,OAAO;EACjB,aAAa,OAAO;EACpB,UAAU,OAAO;CACnB;AACF;;;;AAKA,SAAgB,kBACd,QACgB;CAChB,OAAO;EACL,QAAQ,OAAO,OAAO,IAAI,kBAAkB;EAC5C,YAAY,OAAO;CACrB;AACF;;;;AAKA,SAAgB,0BACd,QACwB;CACxB,OAAO;EACL,UAAU,OAAO;EACjB,QAAQ,OAAO;EACf,YAAY,OAAO;EACnB,wBAAwB,OAAO;EAC/B,YAAY,OAAO;CACrB;AACF"}
|
package/dist/dataMappers.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as
|
|
1
|
+
import { _ as MobileServerRegisteredDevice, f as MobileServerIdentity, g as MobileServerProfile, h as MobileServerNotificationPreferences } from "./serverModelTypes-CPZUvVil.cjs";
|
|
2
|
+
import { _ as MobileRegisteredDevice, d as MobileIdentity, h as MobilePublicProfile, l as MobileFeedPage, m as MobileNotificationPreferences } from "./clientTypes-UFInIAQd.cjs";
|
|
3
|
+
import { t as MobileServerFeedResponse } from "./serverQueryTypes-C_cCx0Ac.cjs";
|
|
3
4
|
|
|
4
5
|
//#region src/dataMappers.d.ts
|
|
5
6
|
/**
|
|
@@ -18,10 +19,14 @@ declare function mapMobileNotificationPreferences(server: MobileServerNotificati
|
|
|
18
19
|
* Maps client-side notification preferences (camelCase) to the server-side (snake_case) wire shape.
|
|
19
20
|
*/
|
|
20
21
|
declare function mapMobileNotificationPreferencesToServer(preferences: MobileNotificationPreferences): MobileServerNotificationPreferences;
|
|
22
|
+
/**
|
|
23
|
+
* Maps a server-side feed response to a client-side {@link MobileFeedPage}.
|
|
24
|
+
*/
|
|
25
|
+
declare function mapMobileFeedPage(server: MobileServerFeedResponse): MobileFeedPage;
|
|
21
26
|
/**
|
|
22
27
|
* Maps a server-side registered device (snake_case) to its client-side (camelCase) representation.
|
|
23
28
|
*/
|
|
24
29
|
declare function mapMobileRegisteredDevice(server: MobileServerRegisteredDevice): MobileRegisteredDevice;
|
|
25
30
|
//#endregion
|
|
26
|
-
export { mapMobileIdentity, mapMobileNotificationPreferences, mapMobileNotificationPreferencesToServer, mapMobilePublicProfile, mapMobileRegisteredDevice };
|
|
31
|
+
export { mapMobileFeedPage, mapMobileIdentity, mapMobileNotificationPreferences, mapMobileNotificationPreferencesToServer, mapMobilePublicProfile, mapMobileRegisteredDevice };
|
|
27
32
|
//# sourceMappingURL=dataMappers.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataMappers.d.cts","names":[],"sources":["../src/src/dataMappers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dataMappers.d.cts","names":[],"sources":["../src/src/dataMappers.ts"],"mappings":";;;;;;;AAsBA;iBAAgB,iBAAA,CACd,MAAA,EAAQ,oBAAA,GACP,cAAc;;;;iBAYD,sBAAA,CACd,MAAA,EAAQ,mBAAA,GACP,mBAAmB;;;AAdL;iBAyBD,gCAAA,CACd,MAAA,EAAQ,mCAAA,GACP,6BAA6B;;;;iBAuBhB,wCAAA,CACd,WAAA,EAAa,6BAAA,GACZ,mCAAmC;;;;iBA+CtB,iBAAA,CACd,MAAA,EAAQ,wBAAA,GACP,cAAc;AA5EjB;;;AAAA,iBAsFgB,yBAAA,CACd,MAAA,EAAQ,4BAAA,GACP,sBAAsB"}
|
package/dist/dataMappers.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as
|
|
1
|
+
import { _ as MobileServerRegisteredDevice, f as MobileServerIdentity, g as MobileServerProfile, h as MobileServerNotificationPreferences } from "./serverModelTypes-CqnqHY5F.js";
|
|
2
|
+
import { _ as MobileRegisteredDevice, d as MobileIdentity, h as MobilePublicProfile, l as MobileFeedPage, m as MobileNotificationPreferences } from "./clientTypes-BsOps_pY.js";
|
|
3
|
+
import { t as MobileServerFeedResponse } from "./serverQueryTypes-CJLWWZBs.js";
|
|
3
4
|
|
|
4
5
|
//#region src/dataMappers.d.ts
|
|
5
6
|
/**
|
|
@@ -18,10 +19,14 @@ declare function mapMobileNotificationPreferences(server: MobileServerNotificati
|
|
|
18
19
|
* Maps client-side notification preferences (camelCase) to the server-side (snake_case) wire shape.
|
|
19
20
|
*/
|
|
20
21
|
declare function mapMobileNotificationPreferencesToServer(preferences: MobileNotificationPreferences): MobileServerNotificationPreferences;
|
|
22
|
+
/**
|
|
23
|
+
* Maps a server-side feed response to a client-side {@link MobileFeedPage}.
|
|
24
|
+
*/
|
|
25
|
+
declare function mapMobileFeedPage(server: MobileServerFeedResponse): MobileFeedPage;
|
|
21
26
|
/**
|
|
22
27
|
* Maps a server-side registered device (snake_case) to its client-side (camelCase) representation.
|
|
23
28
|
*/
|
|
24
29
|
declare function mapMobileRegisteredDevice(server: MobileServerRegisteredDevice): MobileRegisteredDevice;
|
|
25
30
|
//#endregion
|
|
26
|
-
export { mapMobileIdentity, mapMobileNotificationPreferences, mapMobileNotificationPreferencesToServer, mapMobilePublicProfile, mapMobileRegisteredDevice };
|
|
31
|
+
export { mapMobileFeedPage, mapMobileIdentity, mapMobileNotificationPreferences, mapMobileNotificationPreferencesToServer, mapMobilePublicProfile, mapMobileRegisteredDevice };
|
|
27
32
|
//# sourceMappingURL=dataMappers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataMappers.d.ts","names":[],"sources":["../src/src/dataMappers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dataMappers.d.ts","names":[],"sources":["../src/src/dataMappers.ts"],"mappings":";;;;;;;AAsBA;iBAAgB,iBAAA,CACd,MAAA,EAAQ,oBAAA,GACP,cAAc;;;;iBAYD,sBAAA,CACd,MAAA,EAAQ,mBAAA,GACP,mBAAmB;;;AAdL;iBAyBD,gCAAA,CACd,MAAA,EAAQ,mCAAA,GACP,6BAA6B;;;;iBAuBhB,wCAAA,CACd,WAAA,EAAa,6BAAA,GACZ,mCAAmC;;;;iBA+CtB,iBAAA,CACd,MAAA,EAAQ,wBAAA,GACP,cAAc;AA5EjB;;;AAAA,iBAsFgB,yBAAA,CACd,MAAA,EAAQ,4BAAA,GACP,sBAAsB"}
|
package/dist/dataMappers.js
CHANGED
|
@@ -67,6 +67,38 @@ function mapMobileNotificationPreferenceScopeToServer(scope) {
|
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
|
+
* Maps a server-side feed trade (snake_case) to its client-side (camelCase) representation.
|
|
71
|
+
*/
|
|
72
|
+
function mapMobileFeedTrade(server) {
|
|
73
|
+
return {
|
|
74
|
+
orderDigest: server.order_digest,
|
|
75
|
+
subaccount: server.subaccount,
|
|
76
|
+
username: server.username,
|
|
77
|
+
displayName: server.display_name,
|
|
78
|
+
avatarUrl: server.avatar_url,
|
|
79
|
+
productId: server.product_id,
|
|
80
|
+
quantity: server.quantity,
|
|
81
|
+
notional: server.notional,
|
|
82
|
+
averagePrice: server.average_price,
|
|
83
|
+
margin: {
|
|
84
|
+
mode: server.margin.mode,
|
|
85
|
+
estimatedLeverage: server.margin.estimated_leverage
|
|
86
|
+
},
|
|
87
|
+
position: server.position,
|
|
88
|
+
realizedPnl: server.realized_pnl,
|
|
89
|
+
filledAt: server.filled_at_ms
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Maps a server-side feed response to a client-side {@link MobileFeedPage}.
|
|
94
|
+
*/
|
|
95
|
+
function mapMobileFeedPage(server) {
|
|
96
|
+
return {
|
|
97
|
+
trades: server.trades.map(mapMobileFeedTrade),
|
|
98
|
+
nextCursor: server.next_cursor
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
70
102
|
* Maps a server-side registered device (snake_case) to its client-side (camelCase) representation.
|
|
71
103
|
*/
|
|
72
104
|
function mapMobileRegisteredDevice(server) {
|
|
@@ -79,6 +111,6 @@ function mapMobileRegisteredDevice(server) {
|
|
|
79
111
|
};
|
|
80
112
|
}
|
|
81
113
|
//#endregion
|
|
82
|
-
export { mapMobileIdentity, mapMobileNotificationPreferences, mapMobileNotificationPreferencesToServer, mapMobilePublicProfile, mapMobileRegisteredDevice };
|
|
114
|
+
export { mapMobileFeedPage, mapMobileIdentity, mapMobileNotificationPreferences, mapMobileNotificationPreferencesToServer, mapMobilePublicProfile, mapMobileRegisteredDevice };
|
|
83
115
|
|
|
84
116
|
//# sourceMappingURL=dataMappers.js.map
|
package/dist/dataMappers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataMappers.js","names":[],"sources":["../src/dataMappers.ts"],"sourcesContent":["import {\n MobileIdentity,\n MobileNotificationPreferenceScope,\n MobileNotificationPreferences,\n MobilePublicProfile,\n MobileRegisteredDevice,\n} from './types/clientTypes';\nimport {\n MobileServerIdentity,\n MobileServerNotificationPreferenceScope,\n MobileServerNotificationPreferences,\n MobileServerProfile,\n MobileServerRegisteredDevice,\n} from './types/serverModelTypes';\n\n/**\n * Maps a server-side identity (snake_case) to its client-side (camelCase) representation.\n */\nexport function mapMobileIdentity(\n server: MobileServerIdentity,\n): MobileIdentity {\n return {\n subaccount: server.subaccount,\n username: server.username,\n displayName: server.display_name,\n privateMode: server.private_mode,\n };\n}\n\n/**\n * Maps a server-side public profile (snake_case) to its client-side (camelCase) representation.\n */\nexport function mapMobilePublicProfile(\n server: MobileServerProfile,\n): MobilePublicProfile {\n return {\n subaccount: server.subaccount,\n username: server.username,\n displayName: server.display_name,\n };\n}\n\n/**\n * Maps server-side notification preferences (snake_case) to their client-side (camelCase) representation.\n */\nexport function mapMobileNotificationPreferences(\n server: MobileServerNotificationPreferences,\n): MobileNotificationPreferences {\n return {\n schemaVersion: server.schema_version,\n categories: server.categories.map((category) => ({\n category: category.category,\n enabled: category.enabled,\n scopes: category.scopes.map(mapMobileNotificationPreferenceScope),\n })),\n };\n}\n\nfunction mapMobileNotificationPreferenceScope(\n server: MobileServerNotificationPreferenceScope,\n): MobileNotificationPreferenceScope {\n if (server.type === 'subaccount') {\n return { type: 'subaccount', subaccount: server.subaccount };\n }\n return { type: 'product', productId: server.product_id };\n}\n\n/**\n * Maps client-side notification preferences (camelCase) to the server-side (snake_case) wire shape.\n */\nexport function mapMobileNotificationPreferencesToServer(\n preferences: MobileNotificationPreferences,\n): MobileServerNotificationPreferences {\n return {\n schema_version: preferences.schemaVersion,\n categories: preferences.categories.map((category) => ({\n category: category.category,\n enabled: category.enabled,\n scopes: category.scopes.map(mapMobileNotificationPreferenceScopeToServer),\n })),\n };\n}\n\nfunction mapMobileNotificationPreferenceScopeToServer(\n scope: MobileNotificationPreferenceScope,\n): MobileServerNotificationPreferenceScope {\n if (scope.type === 'subaccount') {\n return { type: 'subaccount', subaccount: scope.subaccount };\n }\n return { type: 'product', product_id: scope.productId };\n}\n\n/**\n * Maps a server-side registered device (snake_case) to its client-side (camelCase) representation.\n */\nexport function mapMobileRegisteredDevice(\n server: MobileServerRegisteredDevice,\n): MobileRegisteredDevice {\n return {\n platform: server.platform,\n locale: server.locale,\n appVersion: server.app_version,\n tokenFingerprintPrefix: server.token_fingerprint_prefix,\n lastSeenAt: server.last_seen_at,\n };\n}\n"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"dataMappers.js","names":[],"sources":["../src/dataMappers.ts"],"sourcesContent":["import {\n MobileFeedPage,\n MobileFeedTrade,\n MobileIdentity,\n MobileNotificationPreferenceScope,\n MobileNotificationPreferences,\n MobilePublicProfile,\n MobileRegisteredDevice,\n} from './types/clientTypes';\nimport {\n MobileServerFeedTrade,\n MobileServerIdentity,\n MobileServerNotificationPreferenceScope,\n MobileServerNotificationPreferences,\n MobileServerProfile,\n MobileServerRegisteredDevice,\n} from './types/serverModelTypes';\nimport { MobileServerFeedResponse } from './types/serverQueryTypes';\n\n/**\n * Maps a server-side identity (snake_case) to its client-side (camelCase) representation.\n */\nexport function mapMobileIdentity(\n server: MobileServerIdentity,\n): MobileIdentity {\n return {\n subaccount: server.subaccount,\n username: server.username,\n displayName: server.display_name,\n privateMode: server.private_mode,\n };\n}\n\n/**\n * Maps a server-side public profile (snake_case) to its client-side (camelCase) representation.\n */\nexport function mapMobilePublicProfile(\n server: MobileServerProfile,\n): MobilePublicProfile {\n return {\n subaccount: server.subaccount,\n username: server.username,\n displayName: server.display_name,\n };\n}\n\n/**\n * Maps server-side notification preferences (snake_case) to their client-side (camelCase) representation.\n */\nexport function mapMobileNotificationPreferences(\n server: MobileServerNotificationPreferences,\n): MobileNotificationPreferences {\n return {\n schemaVersion: server.schema_version,\n categories: server.categories.map((category) => ({\n category: category.category,\n enabled: category.enabled,\n scopes: category.scopes.map(mapMobileNotificationPreferenceScope),\n })),\n };\n}\n\nfunction mapMobileNotificationPreferenceScope(\n server: MobileServerNotificationPreferenceScope,\n): MobileNotificationPreferenceScope {\n if (server.type === 'subaccount') {\n return { type: 'subaccount', subaccount: server.subaccount };\n }\n return { type: 'product', productId: server.product_id };\n}\n\n/**\n * Maps client-side notification preferences (camelCase) to the server-side (snake_case) wire shape.\n */\nexport function mapMobileNotificationPreferencesToServer(\n preferences: MobileNotificationPreferences,\n): MobileServerNotificationPreferences {\n return {\n schema_version: preferences.schemaVersion,\n categories: preferences.categories.map((category) => ({\n category: category.category,\n enabled: category.enabled,\n scopes: category.scopes.map(mapMobileNotificationPreferenceScopeToServer),\n })),\n };\n}\n\nfunction mapMobileNotificationPreferenceScopeToServer(\n scope: MobileNotificationPreferenceScope,\n): MobileServerNotificationPreferenceScope {\n if (scope.type === 'subaccount') {\n return { type: 'subaccount', subaccount: scope.subaccount };\n }\n return { type: 'product', product_id: scope.productId };\n}\n\n/**\n * Maps a server-side feed trade (snake_case) to its client-side (camelCase) representation.\n */\nfunction mapMobileFeedTrade(server: MobileServerFeedTrade): MobileFeedTrade {\n return {\n orderDigest: server.order_digest,\n subaccount: server.subaccount,\n username: server.username,\n displayName: server.display_name,\n avatarUrl: server.avatar_url,\n productId: server.product_id,\n quantity: server.quantity,\n notional: server.notional,\n averagePrice: server.average_price,\n margin: {\n mode: server.margin.mode,\n estimatedLeverage: server.margin.estimated_leverage,\n },\n position: server.position,\n realizedPnl: server.realized_pnl,\n filledAt: server.filled_at_ms,\n };\n}\n\n/**\n * Maps a server-side feed response to a client-side {@link MobileFeedPage}.\n */\nexport function mapMobileFeedPage(\n server: MobileServerFeedResponse,\n): MobileFeedPage {\n return {\n trades: server.trades.map(mapMobileFeedTrade),\n nextCursor: server.next_cursor,\n };\n}\n\n/**\n * Maps a server-side registered device (snake_case) to its client-side (camelCase) representation.\n */\nexport function mapMobileRegisteredDevice(\n server: MobileServerRegisteredDevice,\n): MobileRegisteredDevice {\n return {\n platform: server.platform,\n locale: server.locale,\n appVersion: server.app_version,\n tokenFingerprintPrefix: server.token_fingerprint_prefix,\n lastSeenAt: server.last_seen_at,\n };\n}\n"],"mappings":";;;;AAsBA,SAAgB,kBACd,QACgB;CAChB,OAAO;EACL,YAAY,OAAO;EACnB,UAAU,OAAO;EACjB,aAAa,OAAO;EACpB,aAAa,OAAO;CACtB;AACF;;;;AAKA,SAAgB,uBACd,QACqB;CACrB,OAAO;EACL,YAAY,OAAO;EACnB,UAAU,OAAO;EACjB,aAAa,OAAO;CACtB;AACF;;;;AAKA,SAAgB,iCACd,QAC+B;CAC/B,OAAO;EACL,eAAe,OAAO;EACtB,YAAY,OAAO,WAAW,KAAK,cAAc;GAC/C,UAAU,SAAS;GACnB,SAAS,SAAS;GAClB,QAAQ,SAAS,OAAO,IAAI,oCAAoC;EAClE,EAAE;CACJ;AACF;AAEA,SAAS,qCACP,QACmC;CACnC,IAAI,OAAO,SAAS,cAClB,OAAO;EAAE,MAAM;EAAc,YAAY,OAAO;CAAW;CAE7D,OAAO;EAAE,MAAM;EAAW,WAAW,OAAO;CAAW;AACzD;;;;AAKA,SAAgB,yCACd,aACqC;CACrC,OAAO;EACL,gBAAgB,YAAY;EAC5B,YAAY,YAAY,WAAW,KAAK,cAAc;GACpD,UAAU,SAAS;GACnB,SAAS,SAAS;GAClB,QAAQ,SAAS,OAAO,IAAI,4CAA4C;EAC1E,EAAE;CACJ;AACF;AAEA,SAAS,6CACP,OACyC;CACzC,IAAI,MAAM,SAAS,cACjB,OAAO;EAAE,MAAM;EAAc,YAAY,MAAM;CAAW;CAE5D,OAAO;EAAE,MAAM;EAAW,YAAY,MAAM;CAAU;AACxD;;;;AAKA,SAAS,mBAAmB,QAAgD;CAC1E,OAAO;EACL,aAAa,OAAO;EACpB,YAAY,OAAO;EACnB,UAAU,OAAO;EACjB,aAAa,OAAO;EACpB,WAAW,OAAO;EAClB,WAAW,OAAO;EAClB,UAAU,OAAO;EACjB,UAAU,OAAO;EACjB,cAAc,OAAO;EACrB,QAAQ;GACN,MAAM,OAAO,OAAO;GACpB,mBAAmB,OAAO,OAAO;EACnC;EACA,UAAU,OAAO;EACjB,aAAa,OAAO;EACpB,UAAU,OAAO;CACnB;AACF;;;;AAKA,SAAgB,kBACd,QACgB;CAChB,OAAO;EACL,QAAQ,OAAO,OAAO,IAAI,kBAAkB;EAC5C,YAAY,OAAO;CACrB;AACF;;;;AAKA,SAAgB,0BACd,QACwB;CACxB,OAAO;EACL,UAAU,OAAO;EACjB,QAAQ,OAAO;EACf,YAAY,OAAO;EACnB,wBAAwB,OAAO;EAC/B,YAAY,OAAO;CACrB;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as MobileSignedInner } from "./types-
|
|
1
|
+
import { n as MobileSignedInner } from "./types-UHjZR-js.js";
|
|
2
2
|
|
|
3
3
|
//#region src/signing/eip712MethodByType.d.ts
|
|
4
4
|
/**
|
|
@@ -7,4 +7,4 @@ import { n as MobileSignedInner } from "./types-B76Pn7Sy.js";
|
|
|
7
7
|
declare const MOBILE_EIP712_METHOD_BY_TYPE: Record<MobileSignedInner['type'], string>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { MOBILE_EIP712_METHOD_BY_TYPE as t };
|
|
10
|
-
//# sourceMappingURL=eip712MethodByType-
|
|
10
|
+
//# sourceMappingURL=eip712MethodByType-B67XiwTu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eip712MethodByType-B67XiwTu.d.ts","names":[],"sources":["../src/signing/src/signing/eip712MethodByType.ts"],"mappings":";;;;;AAKA;cAAa,4BAAA,EAA8B,MAAM,CAC/C,iBAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as MobileSignedInner } from "./types-
|
|
1
|
+
import { n as MobileSignedInner } from "./types-CzOeSYnW.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/signing/eip712MethodByType.d.ts
|
|
4
4
|
/**
|
|
@@ -7,4 +7,4 @@ import { n as MobileSignedInner } from "./types-uCD4BNZR.cjs";
|
|
|
7
7
|
declare const MOBILE_EIP712_METHOD_BY_TYPE: Record<MobileSignedInner['type'], string>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { MOBILE_EIP712_METHOD_BY_TYPE as t };
|
|
10
|
-
//# sourceMappingURL=eip712MethodByType-
|
|
10
|
+
//# sourceMappingURL=eip712MethodByType-DCU415zf.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eip712MethodByType-DCU415zf.d.cts","names":[],"sources":["../src/signing/src/signing/eip712MethodByType.ts"],"mappings":";;;;;AAKA;cAAa,4BAAA,EAA8B,MAAM,CAC/C,iBAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/utils/feed.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Maximum feed page size the backend accepts; also the default when `limit` is omitted. Requests above this
|
|
4
|
+
* fail with `INVALID_FEED_FILTER`.
|
|
5
|
+
*/
|
|
6
|
+
declare const MOBILE_FEED_MAX_PAGE_SIZE = 50;
|
|
7
|
+
/**
|
|
8
|
+
* Lowest minimum notional the backend accepts, in whole dollars. Filtered requests below this fail with
|
|
9
|
+
* `INVALID_FEED_FILTER`; omitting the filter entirely returns the unfiltered feed.
|
|
10
|
+
*/
|
|
11
|
+
declare const MOBILE_FEED_MIN_NOTIONAL_FLOOR = 1000;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { MOBILE_FEED_MIN_NOTIONAL_FLOOR as n, MOBILE_FEED_MAX_PAGE_SIZE as t };
|
|
14
|
+
//# sourceMappingURL=feed-BF5k6Ryu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feed-BF5k6Ryu.d.ts","names":[],"sources":["../src/utils/src/utils/feed.ts"],"mappings":";;AAIA;;;cAAa,yBAAA;AAAyB;AAMtC;;;AANsC,cAMzB,8BAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/utils/feed.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Maximum feed page size the backend accepts; also the default when `limit` is omitted. Requests above this
|
|
4
|
+
* fail with `INVALID_FEED_FILTER`.
|
|
5
|
+
*/
|
|
6
|
+
declare const MOBILE_FEED_MAX_PAGE_SIZE = 50;
|
|
7
|
+
/**
|
|
8
|
+
* Lowest minimum notional the backend accepts, in whole dollars. Filtered requests below this fail with
|
|
9
|
+
* `INVALID_FEED_FILTER`; omitting the filter entirely returns the unfiltered feed.
|
|
10
|
+
*/
|
|
11
|
+
declare const MOBILE_FEED_MIN_NOTIONAL_FLOOR = 1000;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { MOBILE_FEED_MIN_NOTIONAL_FLOOR as n, MOBILE_FEED_MAX_PAGE_SIZE as t };
|
|
14
|
+
//# sourceMappingURL=feed-CBIwOhTO.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feed-CBIwOhTO.d.cts","names":[],"sources":["../src/utils/src/utils/feed.ts"],"mappings":";;AAIA;;;cAAa,yBAAA;AAAyB;AAMtC;;;AANsC,cAMzB,8BAAA"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_MobileClient = require("./MobileClient-
|
|
2
|
+
const require_MobileClient = require("./MobileClient-CfDtaEeL.cjs");
|
|
3
3
|
const require_signing_canonicalize = require("./signing/canonicalize.cjs");
|
|
4
4
|
const require_signing_eip712MethodByType = require("./signing/eip712MethodByType.cjs");
|
|
5
5
|
const require_signing_nonce = require("./signing/nonce.cjs");
|
|
@@ -10,13 +10,20 @@ const require_types_MobileServerFailureError = require("./types/MobileServerFail
|
|
|
10
10
|
const require_utils_serverResponseGuards = require("./utils/serverResponseGuards.cjs");
|
|
11
11
|
const require_endpoints = require("./endpoints.cjs");
|
|
12
12
|
const require_types_mobileErrorCodes = require("./types/mobileErrorCodes.cjs");
|
|
13
|
+
const require_types_serverModelTypes = require("./types/serverModelTypes.cjs");
|
|
13
14
|
require("./types/index.cjs");
|
|
15
|
+
const require_utils_feed = require("./utils/feed.cjs");
|
|
14
16
|
const require_utils_patterns = require("./utils/patterns.cjs");
|
|
15
17
|
require("./utils/index.cjs");
|
|
16
18
|
exports.MOBILE_CLIENT_ENDPOINTS = require_endpoints.MOBILE_CLIENT_ENDPOINTS;
|
|
17
19
|
exports.MOBILE_DISPLAY_NAME_PATTERN = require_utils_patterns.MOBILE_DISPLAY_NAME_PATTERN;
|
|
18
20
|
exports.MOBILE_EIP712_METHOD_BY_TYPE = require_signing_eip712MethodByType.MOBILE_EIP712_METHOD_BY_TYPE;
|
|
19
21
|
exports.MOBILE_ERROR_CODES = require_types_mobileErrorCodes.MOBILE_ERROR_CODES;
|
|
22
|
+
exports.MOBILE_FEED_MARGIN_MODES = require_types_serverModelTypes.MOBILE_FEED_MARGIN_MODES;
|
|
23
|
+
exports.MOBILE_FEED_MAX_PAGE_SIZE = require_utils_feed.MOBILE_FEED_MAX_PAGE_SIZE;
|
|
24
|
+
exports.MOBILE_FEED_MIN_NOTIONAL_FLOOR = require_utils_feed.MOBILE_FEED_MIN_NOTIONAL_FLOOR;
|
|
25
|
+
exports.MOBILE_FEED_TRADE_POSITION_DIRECTIONS = require_types_serverModelTypes.MOBILE_FEED_TRADE_POSITION_DIRECTIONS;
|
|
26
|
+
exports.MOBILE_FEED_TRADE_POSITION_EFFECTS = require_types_serverModelTypes.MOBILE_FEED_TRADE_POSITION_EFFECTS;
|
|
20
27
|
exports.MobileClient = require_MobileClient.MobileClient;
|
|
21
28
|
exports.MobileServerFailureError = require_types_MobileServerFailureError.MobileServerFailureError;
|
|
22
29
|
exports.buildSignedMobileRequest = require_signing_buildSignedMobileRequest.buildSignedMobileRequest;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { i as MobileSignedRequest, n as MobileSignedInner, r as MobileSignedInnerParams, t as BuildSignedMobileRequestParams } from "./types-
|
|
4
|
-
import { t as buildSignedMobileRequest } from "./buildSignedMobileRequest-
|
|
5
|
-
import { t as canonicalizeMobileInner } from "./canonicalize-
|
|
6
|
-
import { t as MOBILE_EIP712_METHOD_BY_TYPE } from "./eip712MethodByType-
|
|
1
|
+
import { _ as MobileServerRegisteredDevice, a as MobileFeedTradePosition, c as MobileNotificationCategory, d as MobileServerFeedTrade, f as MobileServerIdentity, g as MobileServerProfile, h as MobileServerNotificationPreferences, i as MobileFeedMarginMode, l as MobileNotificationPlatform, m as MobileServerNotificationPreferenceScope, n as MOBILE_FEED_TRADE_POSITION_DIRECTIONS, o as MobileFeedTradePositionDirection, p as MobileServerNotificationCategoryPreference, r as MOBILE_FEED_TRADE_POSITION_EFFECTS, s as MobileFeedTradePositionEffect, t as MOBILE_FEED_MARGIN_MODES, u as MobileServerFeedMargin } from "./serverModelTypes-CPZUvVil.cjs";
|
|
2
|
+
import { C as MobileUsernameAvailability, S as MobileUpdateUsernameParams, _ as MobileRegisteredDevice, a as GetMobileSelfIdentityParams, b as MobileUnregisterExpoTokenParams, c as MobileFeedMargin, d as MobileIdentity, f as MobileNotificationCategoryPreference, g as MobileRegisterExpoTokenParams, h as MobilePublicProfile, i as GetMobileRegisteredDevicesParams, l as MobileFeedPage, m as MobileNotificationPreferences, n as GetMobileNotificationPreferencesParams, o as GetMobileUsernameAvailabilityParams, p as MobileNotificationPreferenceScope, r as GetMobilePublicProfileParams, s as MobileClaimUsernameParams, t as GetMobileFeedParams, u as MobileFeedTrade, v as MobileSetPrivateModeParams, x as MobileUpdateNotificationPreferencesParams, y as MobileSignedRequestParams } from "./clientTypes-UFInIAQd.cjs";
|
|
3
|
+
import { i as MobileSignedRequest, n as MobileSignedInner, r as MobileSignedInnerParams, t as BuildSignedMobileRequestParams } from "./types-CzOeSYnW.cjs";
|
|
4
|
+
import { t as buildSignedMobileRequest } from "./buildSignedMobileRequest-EEnDgZF8.cjs";
|
|
5
|
+
import { t as canonicalizeMobileInner } from "./canonicalize-CDdYnhL3.cjs";
|
|
6
|
+
import { t as MOBILE_EIP712_METHOD_BY_TYPE } from "./eip712MethodByType-DCU415zf.cjs";
|
|
7
7
|
import { t as getMobileNonce } from "./nonce-zGyisRlj.cjs";
|
|
8
|
-
import { t as getMobilePayloadHash } from "./payloadHash-
|
|
9
|
-
import { a as
|
|
8
|
+
import { t as getMobilePayloadHash } from "./payloadHash-BSoGv3Lz.cjs";
|
|
9
|
+
import { a as MobileServerSignedQueryRequestByType, i as MobileServerRequestType, n as MobileServerPublicQueryRequestByType, o as MobileServerSignedQueryRequestType, r as MobileServerPublicQueryRequestType, t as MobileServerExecuteRequestType } from "./serverRequestTypes-DnU_FfMI.cjs";
|
|
10
|
+
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "./serverBaseTypes-A16onlPN.cjs";
|
|
11
|
+
import { a as MobileServerPublicQueryResponseByType, c as MobileServerSelfIdentityResponse, d as MobileServerUsernameAvailabilityResponse, i as MobileServerPublicQueryRequest, l as MobileServerSignedQueryResponseByType, n as MobileServerNotificationPreferencesResponse, o as MobileServerPublicQuerySuccessResponse, r as MobileServerProfileResponse, s as MobileServerRegisteredDevicesResponse, t as MobileServerFeedResponse, u as MobileServerSignedQuerySuccessResponse } from "./serverQueryTypes-C_cCx0Ac.cjs";
|
|
10
12
|
import { MobileClient, MobileClientOpts } from "./MobileClient.cjs";
|
|
11
13
|
import { MOBILE_CLIENT_ENDPOINTS } from "./endpoints.cjs";
|
|
12
|
-
import { n as MobileErrorCode, t as MOBILE_ERROR_CODES } from "./mobileErrorCodes-
|
|
13
|
-
import { t as MobileServerFailureError } from "./MobileServerFailureError-
|
|
14
|
-
import { t as MobileServerExecuteResult } from "./serverExecuteTypes-
|
|
15
|
-
import {
|
|
16
|
-
import { t as MOBILE_DISPLAY_NAME_PATTERN } from "./patterns-
|
|
17
|
-
import { n as isMobileServerSuccessResponse, t as isMobileServerFailureResponse } from "./serverResponseGuards-
|
|
18
|
-
export { BuildSignedMobileRequestParams, GetMobileNotificationPreferencesParams, GetMobilePublicProfileParams, GetMobileRegisteredDevicesParams, GetMobileSelfIdentityParams, GetMobileUsernameAvailabilityParams, MOBILE_CLIENT_ENDPOINTS, MOBILE_DISPLAY_NAME_PATTERN, MOBILE_EIP712_METHOD_BY_TYPE, MOBILE_ERROR_CODES, MobileClaimUsernameParams, MobileClient, MobileClientOpts, MobileErrorCode, MobileIdentity, MobileNotificationCategory, MobileNotificationCategoryPreference, MobileNotificationPlatform, MobileNotificationPreferenceScope, MobileNotificationPreferences, MobilePublicProfile, MobileRegisterExpoTokenParams, MobileRegisteredDevice, MobileServerExecuteResult, MobileServerFailureError, MobileServerFailureResponse, MobileServerIdentity, MobileServerNotificationCategoryPreference, MobileServerNotificationPreferenceScope, MobileServerNotificationPreferences, MobileServerNotificationPreferencesResponse, MobileServerProfile,
|
|
14
|
+
import { n as MobileErrorCode, t as MOBILE_ERROR_CODES } from "./mobileErrorCodes-Cj84nBnT.cjs";
|
|
15
|
+
import { t as MobileServerFailureError } from "./MobileServerFailureError-B11rr9O5.cjs";
|
|
16
|
+
import { t as MobileServerExecuteResult } from "./serverExecuteTypes-C-bioiuQ.cjs";
|
|
17
|
+
import { n as MOBILE_FEED_MIN_NOTIONAL_FLOOR, t as MOBILE_FEED_MAX_PAGE_SIZE } from "./feed-CBIwOhTO.cjs";
|
|
18
|
+
import { t as MOBILE_DISPLAY_NAME_PATTERN } from "./patterns-Db6fgz8i.cjs";
|
|
19
|
+
import { n as isMobileServerSuccessResponse, t as isMobileServerFailureResponse } from "./serverResponseGuards-BlvfJjsa.cjs";
|
|
20
|
+
export { BuildSignedMobileRequestParams, GetMobileFeedParams, GetMobileNotificationPreferencesParams, GetMobilePublicProfileParams, GetMobileRegisteredDevicesParams, GetMobileSelfIdentityParams, GetMobileUsernameAvailabilityParams, MOBILE_CLIENT_ENDPOINTS, MOBILE_DISPLAY_NAME_PATTERN, MOBILE_EIP712_METHOD_BY_TYPE, MOBILE_ERROR_CODES, MOBILE_FEED_MARGIN_MODES, MOBILE_FEED_MAX_PAGE_SIZE, MOBILE_FEED_MIN_NOTIONAL_FLOOR, MOBILE_FEED_TRADE_POSITION_DIRECTIONS, MOBILE_FEED_TRADE_POSITION_EFFECTS, MobileClaimUsernameParams, MobileClient, MobileClientOpts, MobileErrorCode, MobileFeedMargin, MobileFeedMarginMode, MobileFeedPage, MobileFeedTrade, MobileFeedTradePosition, MobileFeedTradePositionDirection, MobileFeedTradePositionEffect, MobileIdentity, MobileNotificationCategory, MobileNotificationCategoryPreference, MobileNotificationPlatform, MobileNotificationPreferenceScope, MobileNotificationPreferences, MobilePublicProfile, MobileRegisterExpoTokenParams, MobileRegisteredDevice, MobileServerExecuteRequestType, MobileServerExecuteResult, MobileServerFailureError, MobileServerFailureResponse, MobileServerFeedMargin, MobileServerFeedResponse, MobileServerFeedTrade, MobileServerIdentity, MobileServerNotificationCategoryPreference, MobileServerNotificationPreferenceScope, MobileServerNotificationPreferences, MobileServerNotificationPreferencesResponse, MobileServerProfile, MobileServerProfileResponse, MobileServerPublicQueryRequest, MobileServerPublicQueryRequestByType, MobileServerPublicQueryRequestType, MobileServerPublicQueryResponseByType, MobileServerPublicQuerySuccessResponse, MobileServerRegisteredDevice, MobileServerRegisteredDevicesResponse, MobileServerRequestType, MobileServerSelfIdentityResponse, MobileServerSignedQueryRequestByType, MobileServerSignedQueryRequestType, MobileServerSignedQueryResponseByType, MobileServerSignedQuerySuccessResponse, MobileServerSuccessResponse, MobileServerUsernameAvailabilityResponse, MobileSetPrivateModeParams, MobileSignedInner, MobileSignedInnerParams, MobileSignedRequest, MobileSignedRequestParams, MobileUnregisterExpoTokenParams, MobileUpdateNotificationPreferencesParams, MobileUpdateUsernameParams, MobileUsernameAvailability, buildSignedMobileRequest, canonicalizeMobileInner, getMobileNonce, getMobilePayloadHash, isMobileServerFailureResponse, isMobileServerSuccessResponse };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { i as MobileSignedRequest, n as MobileSignedInner, r as MobileSignedInnerParams, t as BuildSignedMobileRequestParams } from "./types-
|
|
4
|
-
import { t as buildSignedMobileRequest } from "./buildSignedMobileRequest-
|
|
5
|
-
import { t as canonicalizeMobileInner } from "./canonicalize-
|
|
6
|
-
import { t as MOBILE_EIP712_METHOD_BY_TYPE } from "./eip712MethodByType-
|
|
1
|
+
import { _ as MobileServerRegisteredDevice, a as MobileFeedTradePosition, c as MobileNotificationCategory, d as MobileServerFeedTrade, f as MobileServerIdentity, g as MobileServerProfile, h as MobileServerNotificationPreferences, i as MobileFeedMarginMode, l as MobileNotificationPlatform, m as MobileServerNotificationPreferenceScope, n as MOBILE_FEED_TRADE_POSITION_DIRECTIONS, o as MobileFeedTradePositionDirection, p as MobileServerNotificationCategoryPreference, r as MOBILE_FEED_TRADE_POSITION_EFFECTS, s as MobileFeedTradePositionEffect, t as MOBILE_FEED_MARGIN_MODES, u as MobileServerFeedMargin } from "./serverModelTypes-CqnqHY5F.js";
|
|
2
|
+
import { C as MobileUsernameAvailability, S as MobileUpdateUsernameParams, _ as MobileRegisteredDevice, a as GetMobileSelfIdentityParams, b as MobileUnregisterExpoTokenParams, c as MobileFeedMargin, d as MobileIdentity, f as MobileNotificationCategoryPreference, g as MobileRegisterExpoTokenParams, h as MobilePublicProfile, i as GetMobileRegisteredDevicesParams, l as MobileFeedPage, m as MobileNotificationPreferences, n as GetMobileNotificationPreferencesParams, o as GetMobileUsernameAvailabilityParams, p as MobileNotificationPreferenceScope, r as GetMobilePublicProfileParams, s as MobileClaimUsernameParams, t as GetMobileFeedParams, u as MobileFeedTrade, v as MobileSetPrivateModeParams, x as MobileUpdateNotificationPreferencesParams, y as MobileSignedRequestParams } from "./clientTypes-BsOps_pY.js";
|
|
3
|
+
import { i as MobileSignedRequest, n as MobileSignedInner, r as MobileSignedInnerParams, t as BuildSignedMobileRequestParams } from "./types-UHjZR-js.js";
|
|
4
|
+
import { t as buildSignedMobileRequest } from "./buildSignedMobileRequest-B4KJ6T1y.js";
|
|
5
|
+
import { t as canonicalizeMobileInner } from "./canonicalize-Cc7hdZLJ.js";
|
|
6
|
+
import { t as MOBILE_EIP712_METHOD_BY_TYPE } from "./eip712MethodByType-B67XiwTu.js";
|
|
7
7
|
import { t as getMobileNonce } from "./nonce-DCOrXXkQ.js";
|
|
8
|
-
import { t as getMobilePayloadHash } from "./payloadHash-
|
|
9
|
-
import { a as
|
|
8
|
+
import { t as getMobilePayloadHash } from "./payloadHash-BVP2v3p9.js";
|
|
9
|
+
import { a as MobileServerSignedQueryRequestByType, i as MobileServerRequestType, n as MobileServerPublicQueryRequestByType, o as MobileServerSignedQueryRequestType, r as MobileServerPublicQueryRequestType, t as MobileServerExecuteRequestType } from "./serverRequestTypes-DQDy3K9O.js";
|
|
10
|
+
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "./serverBaseTypes-m3zEi0X9.js";
|
|
11
|
+
import { a as MobileServerPublicQueryResponseByType, c as MobileServerSelfIdentityResponse, d as MobileServerUsernameAvailabilityResponse, i as MobileServerPublicQueryRequest, l as MobileServerSignedQueryResponseByType, n as MobileServerNotificationPreferencesResponse, o as MobileServerPublicQuerySuccessResponse, r as MobileServerProfileResponse, s as MobileServerRegisteredDevicesResponse, t as MobileServerFeedResponse, u as MobileServerSignedQuerySuccessResponse } from "./serverQueryTypes-CJLWWZBs.js";
|
|
10
12
|
import { MobileClient, MobileClientOpts } from "./MobileClient.js";
|
|
11
13
|
import { MOBILE_CLIENT_ENDPOINTS } from "./endpoints.js";
|
|
12
|
-
import { n as MobileErrorCode, t as MOBILE_ERROR_CODES } from "./mobileErrorCodes-
|
|
13
|
-
import { t as MobileServerFailureError } from "./MobileServerFailureError-
|
|
14
|
-
import { t as MobileServerExecuteResult } from "./serverExecuteTypes-
|
|
15
|
-
import {
|
|
16
|
-
import { t as MOBILE_DISPLAY_NAME_PATTERN } from "./patterns-
|
|
17
|
-
import { n as isMobileServerSuccessResponse, t as isMobileServerFailureResponse } from "./serverResponseGuards-
|
|
18
|
-
export { BuildSignedMobileRequestParams, GetMobileNotificationPreferencesParams, GetMobilePublicProfileParams, GetMobileRegisteredDevicesParams, GetMobileSelfIdentityParams, GetMobileUsernameAvailabilityParams, MOBILE_CLIENT_ENDPOINTS, MOBILE_DISPLAY_NAME_PATTERN, MOBILE_EIP712_METHOD_BY_TYPE, MOBILE_ERROR_CODES, MobileClaimUsernameParams, MobileClient, MobileClientOpts, MobileErrorCode, MobileIdentity, MobileNotificationCategory, MobileNotificationCategoryPreference, MobileNotificationPlatform, MobileNotificationPreferenceScope, MobileNotificationPreferences, MobilePublicProfile, MobileRegisterExpoTokenParams, MobileRegisteredDevice, MobileServerExecuteResult, MobileServerFailureError, MobileServerFailureResponse, MobileServerIdentity, MobileServerNotificationCategoryPreference, MobileServerNotificationPreferenceScope, MobileServerNotificationPreferences, MobileServerNotificationPreferencesResponse, MobileServerProfile,
|
|
14
|
+
import { n as MobileErrorCode, t as MOBILE_ERROR_CODES } from "./mobileErrorCodes-Czmigq9x.js";
|
|
15
|
+
import { t as MobileServerFailureError } from "./MobileServerFailureError-DoIvXqYV.js";
|
|
16
|
+
import { t as MobileServerExecuteResult } from "./serverExecuteTypes-DfzWOeIx.js";
|
|
17
|
+
import { n as MOBILE_FEED_MIN_NOTIONAL_FLOOR, t as MOBILE_FEED_MAX_PAGE_SIZE } from "./feed-BF5k6Ryu.js";
|
|
18
|
+
import { t as MOBILE_DISPLAY_NAME_PATTERN } from "./patterns-B5gi7OfV.js";
|
|
19
|
+
import { n as isMobileServerSuccessResponse, t as isMobileServerFailureResponse } from "./serverResponseGuards-gpHH8SHk.js";
|
|
20
|
+
export { BuildSignedMobileRequestParams, GetMobileFeedParams, GetMobileNotificationPreferencesParams, GetMobilePublicProfileParams, GetMobileRegisteredDevicesParams, GetMobileSelfIdentityParams, GetMobileUsernameAvailabilityParams, MOBILE_CLIENT_ENDPOINTS, MOBILE_DISPLAY_NAME_PATTERN, MOBILE_EIP712_METHOD_BY_TYPE, MOBILE_ERROR_CODES, MOBILE_FEED_MARGIN_MODES, MOBILE_FEED_MAX_PAGE_SIZE, MOBILE_FEED_MIN_NOTIONAL_FLOOR, MOBILE_FEED_TRADE_POSITION_DIRECTIONS, MOBILE_FEED_TRADE_POSITION_EFFECTS, MobileClaimUsernameParams, MobileClient, MobileClientOpts, MobileErrorCode, MobileFeedMargin, MobileFeedMarginMode, MobileFeedPage, MobileFeedTrade, MobileFeedTradePosition, MobileFeedTradePositionDirection, MobileFeedTradePositionEffect, MobileIdentity, MobileNotificationCategory, MobileNotificationCategoryPreference, MobileNotificationPlatform, MobileNotificationPreferenceScope, MobileNotificationPreferences, MobilePublicProfile, MobileRegisterExpoTokenParams, MobileRegisteredDevice, MobileServerExecuteRequestType, MobileServerExecuteResult, MobileServerFailureError, MobileServerFailureResponse, MobileServerFeedMargin, MobileServerFeedResponse, MobileServerFeedTrade, MobileServerIdentity, MobileServerNotificationCategoryPreference, MobileServerNotificationPreferenceScope, MobileServerNotificationPreferences, MobileServerNotificationPreferencesResponse, MobileServerProfile, MobileServerProfileResponse, MobileServerPublicQueryRequest, MobileServerPublicQueryRequestByType, MobileServerPublicQueryRequestType, MobileServerPublicQueryResponseByType, MobileServerPublicQuerySuccessResponse, MobileServerRegisteredDevice, MobileServerRegisteredDevicesResponse, MobileServerRequestType, MobileServerSelfIdentityResponse, MobileServerSignedQueryRequestByType, MobileServerSignedQueryRequestType, MobileServerSignedQueryResponseByType, MobileServerSignedQuerySuccessResponse, MobileServerSuccessResponse, MobileServerUsernameAvailabilityResponse, MobileSetPrivateModeParams, MobileSignedInner, MobileSignedInnerParams, MobileSignedRequest, MobileSignedRequestParams, MobileUnregisterExpoTokenParams, MobileUpdateNotificationPreferencesParams, MobileUpdateUsernameParams, MobileUsernameAvailability, buildSignedMobileRequest, canonicalizeMobileInner, getMobileNonce, getMobilePayloadHash, isMobileServerFailureResponse, isMobileServerSuccessResponse };
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,9 @@ import { isMobileServerFailureResponse, isMobileServerSuccessResponse } from "./
|
|
|
9
9
|
import { MobileClient } from "./MobileClient.js";
|
|
10
10
|
import { MOBILE_CLIENT_ENDPOINTS } from "./endpoints.js";
|
|
11
11
|
import { MOBILE_ERROR_CODES } from "./types/mobileErrorCodes.js";
|
|
12
|
+
import { MOBILE_FEED_MARGIN_MODES, MOBILE_FEED_TRADE_POSITION_DIRECTIONS, MOBILE_FEED_TRADE_POSITION_EFFECTS } from "./types/serverModelTypes.js";
|
|
12
13
|
import "./types/index.js";
|
|
14
|
+
import { MOBILE_FEED_MAX_PAGE_SIZE, MOBILE_FEED_MIN_NOTIONAL_FLOOR } from "./utils/feed.js";
|
|
13
15
|
import { MOBILE_DISPLAY_NAME_PATTERN } from "./utils/patterns.js";
|
|
14
16
|
import "./utils/index.js";
|
|
15
|
-
export { MOBILE_CLIENT_ENDPOINTS, MOBILE_DISPLAY_NAME_PATTERN, MOBILE_EIP712_METHOD_BY_TYPE, MOBILE_ERROR_CODES, MobileClient, MobileServerFailureError, buildSignedMobileRequest, canonicalizeMobileInner, getMobileNonce, getMobilePayloadHash, isMobileServerFailureResponse, isMobileServerSuccessResponse };
|
|
17
|
+
export { MOBILE_CLIENT_ENDPOINTS, MOBILE_DISPLAY_NAME_PATTERN, MOBILE_EIP712_METHOD_BY_TYPE, MOBILE_ERROR_CODES, MOBILE_FEED_MARGIN_MODES, MOBILE_FEED_MAX_PAGE_SIZE, MOBILE_FEED_MIN_NOTIONAL_FLOOR, MOBILE_FEED_TRADE_POSITION_DIRECTIONS, MOBILE_FEED_TRADE_POSITION_EFFECTS, MobileClient, MobileServerFailureError, buildSignedMobileRequest, canonicalizeMobileInner, getMobileNonce, getMobilePayloadHash, isMobileServerFailureResponse, isMobileServerSuccessResponse };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
//#region src/types/mobileErrorCodes.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* Numeric error codes returned by the mobile service API. Identity codes (61xx)
|
|
4
|
-
* (
|
|
5
|
-
* error enum, inlined via spread from {@link NADO_ERROR_CODES}.
|
|
3
|
+
* Numeric error codes returned by the mobile service API. Identity codes (61xx), notification codes (62xx),
|
|
4
|
+
* and feed codes (63xx) are mobile-specific; the remaining codes are shared cross-service codes from the
|
|
5
|
+
* backend's common error enum, inlined via spread from {@link NADO_ERROR_CODES}.
|
|
6
6
|
*/
|
|
7
7
|
declare const MOBILE_ERROR_CODES: {
|
|
8
8
|
readonly INVALID_DISPLAY_NAME: 6100;
|
|
@@ -14,7 +14,9 @@ declare const MOBILE_ERROR_CODES: {
|
|
|
14
14
|
readonly PROFILE_NOT_FOUND: 6106;
|
|
15
15
|
readonly INVALID_EXPO_TOKEN: 6200;
|
|
16
16
|
readonly INVALID_DEVICE_METADATA: 6201;
|
|
17
|
-
readonly INVALID_PREFERENCES: 6202;
|
|
17
|
+
readonly INVALID_PREFERENCES: 6202; /** Feed `minimumNotional` or `limit` is outside its allowed domain. Fix the request; do not retry unchanged. */
|
|
18
|
+
readonly INVALID_FEED_FILTER: 6300; /** Feed cursor is malformed or bound to a different filter. Discard it and restart from the first page. */
|
|
19
|
+
readonly INVALID_FEED_CURSOR: 6301;
|
|
18
20
|
readonly RATE_LIMIT: 1000;
|
|
19
21
|
readonly BLACKLISTED_ADDRESS: 1001;
|
|
20
22
|
readonly BLOCKED_LOCATION: 1002;
|
|
@@ -36,4 +38,4 @@ declare const MOBILE_ERROR_CODES: {
|
|
|
36
38
|
type MobileErrorCode = (typeof MOBILE_ERROR_CODES)[keyof typeof MOBILE_ERROR_CODES];
|
|
37
39
|
//#endregion
|
|
38
40
|
export { MobileErrorCode as n, MOBILE_ERROR_CODES as t };
|
|
39
|
-
//# sourceMappingURL=mobileErrorCodes-
|
|
41
|
+
//# sourceMappingURL=mobileErrorCodes-Cj84nBnT.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobileErrorCodes-Cj84nBnT.d.cts","names":[],"sources":["../src/types/src/types/mobileErrorCodes.ts"],"mappings":";;AAOA;;;;cAAa,kBAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBgD;KADjD,eAAA,WACF,kBAAA,eAAiC,kBAAkB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
//#region src/types/mobileErrorCodes.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* Numeric error codes returned by the mobile service API. Identity codes (61xx)
|
|
4
|
-
* (
|
|
5
|
-
* error enum, inlined via spread from {@link NADO_ERROR_CODES}.
|
|
3
|
+
* Numeric error codes returned by the mobile service API. Identity codes (61xx), notification codes (62xx),
|
|
4
|
+
* and feed codes (63xx) are mobile-specific; the remaining codes are shared cross-service codes from the
|
|
5
|
+
* backend's common error enum, inlined via spread from {@link NADO_ERROR_CODES}.
|
|
6
6
|
*/
|
|
7
7
|
declare const MOBILE_ERROR_CODES: {
|
|
8
8
|
readonly INVALID_DISPLAY_NAME: 6100;
|
|
@@ -14,7 +14,9 @@ declare const MOBILE_ERROR_CODES: {
|
|
|
14
14
|
readonly PROFILE_NOT_FOUND: 6106;
|
|
15
15
|
readonly INVALID_EXPO_TOKEN: 6200;
|
|
16
16
|
readonly INVALID_DEVICE_METADATA: 6201;
|
|
17
|
-
readonly INVALID_PREFERENCES: 6202;
|
|
17
|
+
readonly INVALID_PREFERENCES: 6202; /** Feed `minimumNotional` or `limit` is outside its allowed domain. Fix the request; do not retry unchanged. */
|
|
18
|
+
readonly INVALID_FEED_FILTER: 6300; /** Feed cursor is malformed or bound to a different filter. Discard it and restart from the first page. */
|
|
19
|
+
readonly INVALID_FEED_CURSOR: 6301;
|
|
18
20
|
readonly RATE_LIMIT: 1000;
|
|
19
21
|
readonly BLACKLISTED_ADDRESS: 1001;
|
|
20
22
|
readonly BLOCKED_LOCATION: 1002;
|
|
@@ -36,4 +38,4 @@ declare const MOBILE_ERROR_CODES: {
|
|
|
36
38
|
type MobileErrorCode = (typeof MOBILE_ERROR_CODES)[keyof typeof MOBILE_ERROR_CODES];
|
|
37
39
|
//#endregion
|
|
38
40
|
export { MobileErrorCode as n, MOBILE_ERROR_CODES as t };
|
|
39
|
-
//# sourceMappingURL=mobileErrorCodes-
|
|
41
|
+
//# sourceMappingURL=mobileErrorCodes-Czmigq9x.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobileErrorCodes-Czmigq9x.d.ts","names":[],"sources":["../src/types/src/types/mobileErrorCodes.ts"],"mappings":";;AAOA;;;;cAAa,kBAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBgD;KADjD,eAAA,WACF,kBAAA,eAAiC,kBAAkB"}
|