@nadohq/mobile-client 0.29.0 → 0.31.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/README.md +15 -8
- package/dist/{MobileClient-9JSAzblH.cjs → MobileClient-_i0ZV6Dq.cjs} +104 -44
- package/dist/MobileClient-_i0ZV6Dq.cjs.map +1 -0
- package/dist/MobileClient.cjs +1 -1
- package/dist/MobileClient.d.cts +77 -36
- package/dist/MobileClient.d.cts.map +1 -1
- package/dist/MobileClient.d.ts +77 -36
- package/dist/MobileClient.d.ts.map +1 -1
- package/dist/MobileClient.js +105 -45
- package/dist/MobileClient.js.map +1 -1
- package/dist/{MobileServerFailureError-ZggEcEda.d.cts → MobileServerFailureError-BoyAfEZA.d.cts} +3 -2
- package/dist/MobileServerFailureError-BoyAfEZA.d.cts.map +1 -0
- package/dist/{MobileServerFailureError-f9KhKnJj.d.ts → MobileServerFailureError-MgYVBh5p.d.ts} +3 -2
- package/dist/MobileServerFailureError-MgYVBh5p.d.ts.map +1 -0
- package/dist/{buildSignedMobileRequest-BsbBkU0K.d.cts → buildSignedMobileRequest-CBMt97aY.d.cts} +2 -2
- package/dist/{buildSignedMobileRequest-BsbBkU0K.d.cts.map → buildSignedMobileRequest-CBMt97aY.d.cts.map} +1 -1
- package/dist/{buildSignedMobileRequest-CDRsRNHm.d.ts → buildSignedMobileRequest-qEC4gWaI.d.ts} +2 -2
- package/dist/{buildSignedMobileRequest-CDRsRNHm.d.ts.map → buildSignedMobileRequest-qEC4gWaI.d.ts.map} +1 -1
- package/dist/{canonicalize-PX6dTIdF.d.ts → canonicalize-QNARV_Xc.d.cts} +4 -4
- package/dist/canonicalize-QNARV_Xc.d.cts.map +1 -0
- package/dist/{canonicalize-Dm7sXwPg.d.cts → canonicalize-wVdGejB1.d.ts} +4 -4
- package/dist/canonicalize-wVdGejB1.d.ts.map +1 -0
- package/dist/clientTypes-6utzUU-b.d.ts +240 -0
- package/dist/clientTypes-6utzUU-b.d.ts.map +1 -0
- package/dist/clientTypes-D9qgtNlE.d.cts +240 -0
- package/dist/clientTypes-D9qgtNlE.d.cts.map +1 -0
- package/dist/dataMappers.cjs +35 -1
- 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 +35 -2
- package/dist/dataMappers.js.map +1 -1
- package/dist/{eip712MethodByType-DLh9MRsD.d.cts → eip712MethodByType-CroIPqsJ.d.cts} +2 -2
- package/dist/eip712MethodByType-CroIPqsJ.d.cts.map +1 -0
- package/dist/{eip712MethodByType-DJgXal9r.d.ts → eip712MethodByType-DBUy4AdI.d.ts} +2 -2
- package/dist/eip712MethodByType-DBUy4AdI.d.ts.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-BeyBKmwh.d.cts → mobileErrorCodes-CuQ5lyBV.d.ts} +8 -8
- package/dist/mobileErrorCodes-CuQ5lyBV.d.ts.map +1 -0
- package/dist/{mobileErrorCodes-QG5XbEY6.d.ts → mobileErrorCodes-D_SyBm0k.d.cts} +8 -8
- package/dist/mobileErrorCodes-D_SyBm0k.d.cts.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-B0tlFOK8.d.cts} +2 -2
- package/dist/payloadHash-B0tlFOK8.d.cts.map +1 -0
- package/dist/{payloadHash-Bmhzs78N.d.ts → payloadHash-D1yTQSF4.d.ts} +2 -2
- package/dist/payloadHash-D1yTQSF4.d.ts.map +1 -0
- package/dist/serverBaseTypes-CzRgwUvA.d.ts +25 -0
- package/dist/serverBaseTypes-CzRgwUvA.d.ts.map +1 -0
- package/dist/serverBaseTypes-DSRgU2Fb.d.cts +25 -0
- package/dist/serverBaseTypes-DSRgU2Fb.d.cts.map +1 -0
- package/dist/serverExecuteTypes-BCb6bUMP.d.cts +19 -0
- package/dist/serverExecuteTypes-BCb6bUMP.d.cts.map +1 -0
- package/dist/serverExecuteTypes-CI3NBW2Z.d.ts +19 -0
- package/dist/serverExecuteTypes-CI3NBW2Z.d.ts.map +1 -0
- package/dist/serverModelTypes-BYQcsRrx.d.cts +146 -0
- package/dist/serverModelTypes-BYQcsRrx.d.cts.map +1 -0
- package/dist/serverModelTypes-DvPs5qs3.d.ts +146 -0
- package/dist/serverModelTypes-DvPs5qs3.d.ts.map +1 -0
- package/dist/serverQueryTypes-9H6P1vJ5.d.cts +92 -0
- package/dist/serverQueryTypes-9H6P1vJ5.d.cts.map +1 -0
- package/dist/serverQueryTypes-Cbjx0bIj.d.ts +92 -0
- package/dist/serverQueryTypes-Cbjx0bIj.d.ts.map +1 -0
- package/dist/serverRequestTypes-CHDk6JwE.d.cts +85 -0
- package/dist/serverRequestTypes-CHDk6JwE.d.cts.map +1 -0
- package/dist/serverRequestTypes-DYTLrCpz.d.ts +85 -0
- package/dist/serverRequestTypes-DYTLrCpz.d.ts.map +1 -0
- package/dist/{serverResponseGuards-DjCNL3CR.d.cts → serverResponseGuards-DRMHmfXh.d.cts} +2 -2
- package/dist/{serverResponseGuards-DjCNL3CR.d.cts.map → serverResponseGuards-DRMHmfXh.d.cts.map} +1 -1
- package/dist/{serverResponseGuards-C_vZIgGl.d.ts → serverResponseGuards-DpbZvJfL.d.ts} +2 -2
- package/dist/{serverResponseGuards-C_vZIgGl.d.ts.map → serverResponseGuards-DpbZvJfL.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.cjs +4 -37
- package/dist/signing/canonicalize.cjs.map +1 -1
- package/dist/signing/canonicalize.d.cts +1 -1
- package/dist/signing/canonicalize.d.ts +1 -1
- package/dist/signing/canonicalize.js +4 -37
- package/dist/signing/canonicalize.js.map +1 -1
- package/dist/signing/eip712MethodByType.cjs +1 -5
- package/dist/signing/eip712MethodByType.cjs.map +1 -1
- package/dist/signing/eip712MethodByType.d.cts +1 -1
- package/dist/signing/eip712MethodByType.d.ts +1 -1
- package/dist/signing/eip712MethodByType.js +1 -5
- package/dist/signing/eip712MethodByType.js.map +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 +1 -1
- 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.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 +10 -7
- 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 +9 -6
- 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 +2 -2
- package/dist/types/serverExecuteTypes.d.ts +2 -2
- 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-B76Pn7Sy.d.ts → types-CQE3HD2V.d.ts} +4 -15
- package/dist/types-CQE3HD2V.d.ts.map +1 -0
- package/dist/{types-uCD4BNZR.d.cts → types-bNB98pYk.d.cts} +4 -15
- package/dist/types-bNB98pYk.d.cts.map +1 -0
- 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 +163 -112
- package/src/dataMappers.ts +41 -0
- package/src/signing/canonicalize.ts +4 -37
- package/src/signing/eip712MethodByType.ts +1 -5
- package/src/signing/signing.test.ts +17 -60
- package/src/signing/types.ts +2 -12
- package/src/types/MobileServerFailureError.ts +2 -4
- package/src/types/clientTypes.ts +105 -27
- package/src/types/index.ts +1 -0
- package/src/types/mobileErrorCodes.ts +8 -5
- package/src/types/serverBaseTypes.ts +7 -28
- package/src/types/serverExecuteTypes.ts +17 -0
- package/src/types/serverModelTypes.ts +104 -8
- package/src/types/serverQueryTypes.ts +84 -39
- package/src/types/serverRequestTypes.ts +91 -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-ZggEcEda.d.cts.map +0 -1
- package/dist/MobileServerFailureError-f9KhKnJj.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 +0 -168
- package/dist/clientTypes-DWW2N66c.d.ts.map +0 -1
- package/dist/clientTypes-Et0PUa2d.d.cts +0 -168
- 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 +0 -11
- package/dist/serverExecuteTypes-CXnMjKnt.d.ts.map +0 -1
- package/dist/serverExecuteTypes-DKYK1V7C.d.cts +0 -11
- 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
- package/dist/types-B76Pn7Sy.d.ts.map +0 -1
- package/dist/types-uCD4BNZR.d.cts.map +0 -1
package/dist/dataMappers.js
CHANGED
|
@@ -17,7 +17,8 @@ function mapMobilePublicProfile(server) {
|
|
|
17
17
|
return {
|
|
18
18
|
subaccount: server.subaccount,
|
|
19
19
|
username: server.username,
|
|
20
|
-
displayName: server.display_name
|
|
20
|
+
displayName: server.display_name,
|
|
21
|
+
privateMode: server.private_mode
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
@@ -67,6 +68,38 @@ function mapMobileNotificationPreferenceScopeToServer(scope) {
|
|
|
67
68
|
};
|
|
68
69
|
}
|
|
69
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
|
+
/**
|
|
70
103
|
* Maps a server-side registered device (snake_case) to its client-side (camelCase) representation.
|
|
71
104
|
*/
|
|
72
105
|
function mapMobileRegisteredDevice(server) {
|
|
@@ -79,6 +112,6 @@ function mapMobileRegisteredDevice(server) {
|
|
|
79
112
|
};
|
|
80
113
|
}
|
|
81
114
|
//#endregion
|
|
82
|
-
export { mapMobileIdentity, mapMobileNotificationPreferences, mapMobileNotificationPreferencesToServer, mapMobilePublicProfile, mapMobileRegisteredDevice };
|
|
115
|
+
export { mapMobileFeedPage, mapMobileIdentity, mapMobileNotificationPreferences, mapMobileNotificationPreferencesToServer, mapMobilePublicProfile, mapMobileRegisteredDevice };
|
|
83
116
|
|
|
84
117
|
//# 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 privateMode: server.private_mode,\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;EACpB,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-bNB98pYk.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-CroIPqsJ.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eip712MethodByType-CroIPqsJ.d.cts","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-CQE3HD2V.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-DBUy4AdI.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eip712MethodByType-DBUy4AdI.d.ts","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-_i0ZV6Dq.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-BYQcsRrx.cjs";
|
|
2
|
+
import { C as MobileWithExpoTokenParams, S as MobileUsernameAvailability, _ as MobileSetPrivateModeParams, a as GetMobileSelfIdentityParams, b as MobileUnregisterExpoTokenParams, c as MobileFeedPage, d as MobileNotificationCategoryPreference, f as MobileNotificationPreferenceScope, g as MobileRegisteredDevice, h as MobileRegisterExpoTokenParams, i as GetMobileRegisteredDevicesParams, l as MobileFeedTrade, m as MobilePublicProfile, n as GetMobileNotificationPreferencesParams, o as GetMobileUsernameAvailabilityParams, p as MobileNotificationPreferences, r as GetMobilePublicProfileParams, s as MobileFeedMargin, t as GetMobileFeedParams, u as MobileIdentity, v as MobileSetUsernameParams, x as MobileUpdateNotificationPreferencesParams, y as MobileSignedRequestParams } from "./clientTypes-D9qgtNlE.cjs";
|
|
3
|
+
import { i as MobileSignedRequest, n as MobileSignedInner, r as MobileSignedInnerParams, t as BuildSignedMobileRequestParams } from "./types-bNB98pYk.cjs";
|
|
4
|
+
import { t as buildSignedMobileRequest } from "./buildSignedMobileRequest-CBMt97aY.cjs";
|
|
5
|
+
import { t as canonicalizeMobileInner } from "./canonicalize-QNARV_Xc.cjs";
|
|
6
|
+
import { t as MOBILE_EIP712_METHOD_BY_TYPE } from "./eip712MethodByType-CroIPqsJ.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-B0tlFOK8.cjs";
|
|
9
|
+
import { a as MobileServerPublicQueryRequestType, c as MobileServerSignedQueryRequestType, i as MobileServerPublicQueryRequestByType, n as MobileServerPublicExecuteRequestByType, o as MobileServerRequestType, r as MobileServerPublicExecuteRequestType, s as MobileServerSignedQueryRequestByType, t as MobileServerExecuteRequestType } from "./serverRequestTypes-CHDk6JwE.cjs";
|
|
10
|
+
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "./serverBaseTypes-DSRgU2Fb.cjs";
|
|
11
|
+
import { n as MobileServerPublicExecuteRequest, t as MobileServerExecuteResult } from "./serverExecuteTypes-BCb6bUMP.cjs";
|
|
12
|
+
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-9H6P1vJ5.cjs";
|
|
10
13
|
import { MobileClient, MobileClientOpts } from "./MobileClient.cjs";
|
|
11
14
|
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
|
|
15
|
-
import {
|
|
16
|
-
import { t as
|
|
17
|
-
|
|
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, MobileServerProfileRequest, MobileServerProfileResponse, MobileServerPublicQueryParamsByType, MobileServerPublicQueryRequest, MobileServerPublicQueryType, MobileServerRegisteredDevice, MobileServerRegisteredDevicesResponse, MobileServerRequestType, MobileServerSelfIdentityResponse, MobileServerSuccessResponse, MobileServerUsernameAvailabilityRequest, MobileServerUsernameAvailabilityResponse, MobileSetPrivateModeParams, MobileSignedInner, MobileSignedInnerParams, MobileSignedRequest, MobileSignedRequestParams, MobileUnregisterExpoTokenParams, MobileUpdateNotificationPreferencesParams, MobileUpdateUsernameParams, MobileUsernameAvailability, buildSignedMobileRequest, canonicalizeMobileInner, getMobileNonce, getMobilePayloadHash, isMobileServerFailureResponse, isMobileServerSuccessResponse };
|
|
15
|
+
import { n as MobileErrorCode, t as MOBILE_ERROR_CODES } from "./mobileErrorCodes-D_SyBm0k.cjs";
|
|
16
|
+
import { t as MobileServerFailureError } from "./MobileServerFailureError-BoyAfEZA.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-DRMHmfXh.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, 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, MobileServerPublicExecuteRequest, MobileServerPublicExecuteRequestByType, MobileServerPublicExecuteRequestType, MobileServerPublicQueryRequest, MobileServerPublicQueryRequestByType, MobileServerPublicQueryRequestType, MobileServerPublicQueryResponseByType, MobileServerPublicQuerySuccessResponse, MobileServerRegisteredDevice, MobileServerRegisteredDevicesResponse, MobileServerRequestType, MobileServerSelfIdentityResponse, MobileServerSignedQueryRequestByType, MobileServerSignedQueryRequestType, MobileServerSignedQueryResponseByType, MobileServerSignedQuerySuccessResponse, MobileServerSuccessResponse, MobileServerUsernameAvailabilityResponse, MobileSetPrivateModeParams, MobileSetUsernameParams, MobileSignedInner, MobileSignedInnerParams, MobileSignedRequest, MobileSignedRequestParams, MobileUnregisterExpoTokenParams, MobileUpdateNotificationPreferencesParams, MobileUsernameAvailability, MobileWithExpoTokenParams, 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-DvPs5qs3.js";
|
|
2
|
+
import { C as MobileWithExpoTokenParams, S as MobileUsernameAvailability, _ as MobileSetPrivateModeParams, a as GetMobileSelfIdentityParams, b as MobileUnregisterExpoTokenParams, c as MobileFeedPage, d as MobileNotificationCategoryPreference, f as MobileNotificationPreferenceScope, g as MobileRegisteredDevice, h as MobileRegisterExpoTokenParams, i as GetMobileRegisteredDevicesParams, l as MobileFeedTrade, m as MobilePublicProfile, n as GetMobileNotificationPreferencesParams, o as GetMobileUsernameAvailabilityParams, p as MobileNotificationPreferences, r as GetMobilePublicProfileParams, s as MobileFeedMargin, t as GetMobileFeedParams, u as MobileIdentity, v as MobileSetUsernameParams, x as MobileUpdateNotificationPreferencesParams, y as MobileSignedRequestParams } from "./clientTypes-6utzUU-b.js";
|
|
3
|
+
import { i as MobileSignedRequest, n as MobileSignedInner, r as MobileSignedInnerParams, t as BuildSignedMobileRequestParams } from "./types-CQE3HD2V.js";
|
|
4
|
+
import { t as buildSignedMobileRequest } from "./buildSignedMobileRequest-qEC4gWaI.js";
|
|
5
|
+
import { t as canonicalizeMobileInner } from "./canonicalize-wVdGejB1.js";
|
|
6
|
+
import { t as MOBILE_EIP712_METHOD_BY_TYPE } from "./eip712MethodByType-DBUy4AdI.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-D1yTQSF4.js";
|
|
9
|
+
import { a as MobileServerPublicQueryRequestType, c as MobileServerSignedQueryRequestType, i as MobileServerPublicQueryRequestByType, n as MobileServerPublicExecuteRequestByType, o as MobileServerRequestType, r as MobileServerPublicExecuteRequestType, s as MobileServerSignedQueryRequestByType, t as MobileServerExecuteRequestType } from "./serverRequestTypes-DYTLrCpz.js";
|
|
10
|
+
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "./serverBaseTypes-CzRgwUvA.js";
|
|
11
|
+
import { n as MobileServerPublicExecuteRequest, t as MobileServerExecuteResult } from "./serverExecuteTypes-CI3NBW2Z.js";
|
|
12
|
+
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-Cbjx0bIj.js";
|
|
10
13
|
import { MobileClient, MobileClientOpts } from "./MobileClient.js";
|
|
11
14
|
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
|
|
15
|
-
import {
|
|
16
|
-
import { t as
|
|
17
|
-
|
|
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, MobileServerProfileRequest, MobileServerProfileResponse, MobileServerPublicQueryParamsByType, MobileServerPublicQueryRequest, MobileServerPublicQueryType, MobileServerRegisteredDevice, MobileServerRegisteredDevicesResponse, MobileServerRequestType, MobileServerSelfIdentityResponse, MobileServerSuccessResponse, MobileServerUsernameAvailabilityRequest, MobileServerUsernameAvailabilityResponse, MobileSetPrivateModeParams, MobileSignedInner, MobileSignedInnerParams, MobileSignedRequest, MobileSignedRequestParams, MobileUnregisterExpoTokenParams, MobileUpdateNotificationPreferencesParams, MobileUpdateUsernameParams, MobileUsernameAvailability, buildSignedMobileRequest, canonicalizeMobileInner, getMobileNonce, getMobilePayloadHash, isMobileServerFailureResponse, isMobileServerSuccessResponse };
|
|
15
|
+
import { n as MobileErrorCode, t as MOBILE_ERROR_CODES } from "./mobileErrorCodes-CuQ5lyBV.js";
|
|
16
|
+
import { t as MobileServerFailureError } from "./MobileServerFailureError-MgYVBh5p.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-DpbZvJfL.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, 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, MobileServerPublicExecuteRequest, MobileServerPublicExecuteRequestByType, MobileServerPublicExecuteRequestType, MobileServerPublicQueryRequest, MobileServerPublicQueryRequestByType, MobileServerPublicQueryRequestType, MobileServerPublicQueryResponseByType, MobileServerPublicQuerySuccessResponse, MobileServerRegisteredDevice, MobileServerRegisteredDevicesResponse, MobileServerRequestType, MobileServerSelfIdentityResponse, MobileServerSignedQueryRequestByType, MobileServerSignedQueryRequestType, MobileServerSignedQueryResponseByType, MobileServerSignedQuerySuccessResponse, MobileServerSuccessResponse, MobileServerUsernameAvailabilityResponse, MobileSetPrivateModeParams, MobileSetUsernameParams, MobileSignedInner, MobileSignedInnerParams, MobileSignedRequest, MobileSignedRequestParams, MobileUnregisterExpoTokenParams, MobileUpdateNotificationPreferencesParams, MobileUsernameAvailability, MobileWithExpoTokenParams, 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,20 +1,20 @@
|
|
|
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;
|
|
9
9
|
readonly USERNAME_UNAVAILABLE: 6101;
|
|
10
|
-
readonly
|
|
11
|
-
readonly IDENTITY_REQUIRED: 6103;
|
|
12
|
-
readonly INVALID_IDENTITY_TARGET: 6104;
|
|
10
|
+
readonly INVALID_IDENTITY_TARGET: 6104; /** Another identity write for the subaccount committed with a later nonce. Re-read before retrying. */
|
|
13
11
|
readonly STALE_IDENTITY_UPDATE: 6105;
|
|
14
12
|
readonly PROFILE_NOT_FOUND: 6106;
|
|
15
13
|
readonly INVALID_EXPO_TOKEN: 6200;
|
|
16
14
|
readonly INVALID_DEVICE_METADATA: 6201;
|
|
17
|
-
readonly INVALID_PREFERENCES: 6202;
|
|
15
|
+
readonly INVALID_PREFERENCES: 6202; /** Feed `minimumNotional` or `limit` is outside its allowed domain. Fix the request; do not retry unchanged. */
|
|
16
|
+
readonly INVALID_FEED_FILTER: 6300; /** Feed cursor is malformed or bound to a different filter. Discard it and restart from the first page. */
|
|
17
|
+
readonly INVALID_FEED_CURSOR: 6301;
|
|
18
18
|
readonly RATE_LIMIT: 1000;
|
|
19
19
|
readonly BLACKLISTED_ADDRESS: 1001;
|
|
20
20
|
readonly BLOCKED_LOCATION: 1002;
|
|
@@ -36,4 +36,4 @@ declare const MOBILE_ERROR_CODES: {
|
|
|
36
36
|
type MobileErrorCode = (typeof MOBILE_ERROR_CODES)[keyof typeof MOBILE_ERROR_CODES];
|
|
37
37
|
//#endregion
|
|
38
38
|
export { MobileErrorCode as n, MOBILE_ERROR_CODES as t };
|
|
39
|
-
//# sourceMappingURL=mobileErrorCodes-
|
|
39
|
+
//# sourceMappingURL=mobileErrorCodes-CuQ5lyBV.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobileErrorCodes-CuQ5lyBV.d.ts","names":[],"sources":["../src/types/src/types/mobileErrorCodes.ts"],"mappings":";;AAOA;;;;cAAa,kBAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBgD;;KADjD,eAAA,WACF,kBAAA,eAAiC,kBAAkB"}
|
|
@@ -1,20 +1,20 @@
|
|
|
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;
|
|
9
9
|
readonly USERNAME_UNAVAILABLE: 6101;
|
|
10
|
-
readonly
|
|
11
|
-
readonly IDENTITY_REQUIRED: 6103;
|
|
12
|
-
readonly INVALID_IDENTITY_TARGET: 6104;
|
|
10
|
+
readonly INVALID_IDENTITY_TARGET: 6104; /** Another identity write for the subaccount committed with a later nonce. Re-read before retrying. */
|
|
13
11
|
readonly STALE_IDENTITY_UPDATE: 6105;
|
|
14
12
|
readonly PROFILE_NOT_FOUND: 6106;
|
|
15
13
|
readonly INVALID_EXPO_TOKEN: 6200;
|
|
16
14
|
readonly INVALID_DEVICE_METADATA: 6201;
|
|
17
|
-
readonly INVALID_PREFERENCES: 6202;
|
|
15
|
+
readonly INVALID_PREFERENCES: 6202; /** Feed `minimumNotional` or `limit` is outside its allowed domain. Fix the request; do not retry unchanged. */
|
|
16
|
+
readonly INVALID_FEED_FILTER: 6300; /** Feed cursor is malformed or bound to a different filter. Discard it and restart from the first page. */
|
|
17
|
+
readonly INVALID_FEED_CURSOR: 6301;
|
|
18
18
|
readonly RATE_LIMIT: 1000;
|
|
19
19
|
readonly BLACKLISTED_ADDRESS: 1001;
|
|
20
20
|
readonly BLOCKED_LOCATION: 1002;
|
|
@@ -36,4 +36,4 @@ declare const MOBILE_ERROR_CODES: {
|
|
|
36
36
|
type MobileErrorCode = (typeof MOBILE_ERROR_CODES)[keyof typeof MOBILE_ERROR_CODES];
|
|
37
37
|
//#endregion
|
|
38
38
|
export { MobileErrorCode as n, MOBILE_ERROR_CODES as t };
|
|
39
|
-
//# sourceMappingURL=mobileErrorCodes-
|
|
39
|
+
//# sourceMappingURL=mobileErrorCodes-D_SyBm0k.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobileErrorCodes-D_SyBm0k.d.cts","names":[],"sources":["../src/types/src/types/mobileErrorCodes.ts"],"mappings":";;AAOA;;;;cAAa,kBAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBgD;;KADjD,eAAA,WACF,kBAAA,eAAiC,kBAAkB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patterns-B5gi7OfV.d.ts","names":[],"sources":["../src/utils/src/utils/patterns.ts"],"mappings":";;AAGA;;cAAa,2BAAA,EAA2B,MAA0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patterns-Db6fgz8i.d.cts","names":[],"sources":["../src/utils/src/utils/patterns.ts"],"mappings":";;AAGA;;cAAa,2BAAA,EAA2B,MAA0B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as MobileSignedInner } from "./types-
|
|
1
|
+
import { n as MobileSignedInner } from "./types-bNB98pYk.cjs";
|
|
2
2
|
import { Hex } from "viem";
|
|
3
3
|
|
|
4
4
|
//#region src/signing/payloadHash.d.ts
|
|
@@ -10,4 +10,4 @@ import { Hex } from "viem";
|
|
|
10
10
|
declare function getMobilePayloadHash(inner: MobileSignedInner): Hex;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { getMobilePayloadHash as t };
|
|
13
|
-
//# sourceMappingURL=payloadHash-
|
|
13
|
+
//# sourceMappingURL=payloadHash-B0tlFOK8.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payloadHash-B0tlFOK8.d.cts","names":[],"sources":["../src/signing/src/signing/payloadHash.ts"],"mappings":";;;;;;AASA;;;iBAAgB,oBAAA,CAAqB,KAAA,EAAO,iBAAA,GAAoB,GAAG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as MobileSignedInner } from "./types-
|
|
1
|
+
import { n as MobileSignedInner } from "./types-CQE3HD2V.js";
|
|
2
2
|
import { Hex } from "viem";
|
|
3
3
|
|
|
4
4
|
//#region src/signing/payloadHash.d.ts
|
|
@@ -10,4 +10,4 @@ import { Hex } from "viem";
|
|
|
10
10
|
declare function getMobilePayloadHash(inner: MobileSignedInner): Hex;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { getMobilePayloadHash as t };
|
|
13
|
-
//# sourceMappingURL=payloadHash-
|
|
13
|
+
//# sourceMappingURL=payloadHash-D1yTQSF4.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payloadHash-D1yTQSF4.d.ts","names":[],"sources":["../src/signing/src/signing/payloadHash.ts"],"mappings":";;;;;;AASA;;;iBAAgB,oBAAA,CAAqB,KAAA,EAAO,iBAAA,GAAoB,GAAG"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { o as MobileServerRequestType } from "./serverRequestTypes-DYTLrCpz.js";
|
|
2
|
+
|
|
3
|
+
//#region src/types/serverBaseTypes.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Base success envelope shared by every mobile service API route: just the `status` discriminant. Query
|
|
6
|
+
* routes intersect this with their payload (see {@link MobileServerPublicQuerySuccessResponse}), inlining the
|
|
7
|
+
* payload fields alongside `status` rather than nesting them under a `data` key like the engine does; execute
|
|
8
|
+
* routes return it as-is because they carry no payload.
|
|
9
|
+
*/
|
|
10
|
+
interface MobileServerSuccessResponse {
|
|
11
|
+
status: 'success';
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Failure envelope returned by any mobile service API route. A response missing this envelope shape
|
|
15
|
+
* (e.g. a malformed body, or a non-JSON response) is a transport-level error, not a domain error.
|
|
16
|
+
*/
|
|
17
|
+
interface MobileServerFailureResponse {
|
|
18
|
+
status: 'failure';
|
|
19
|
+
error: string;
|
|
20
|
+
error_code: number;
|
|
21
|
+
request_type: MobileServerRequestType;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { MobileServerSuccessResponse as n, MobileServerFailureResponse as t };
|
|
25
|
+
//# sourceMappingURL=serverBaseTypes-CzRgwUvA.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverBaseTypes-CzRgwUvA.d.ts","names":[],"sources":["../src/types/src/types/serverBaseTypes.ts"],"mappings":";;;;;AAQA;;;;UAAiB,2BAAA;EACf,MAAM;AAAA;;;;;UAOS,2BAAA;EACf,MAAA;EACA,KAAA;EACA,UAAA;EACA,YAAA,EAAc,uBAAuB;AAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { o as MobileServerRequestType } from "./serverRequestTypes-CHDk6JwE.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/types/serverBaseTypes.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Base success envelope shared by every mobile service API route: just the `status` discriminant. Query
|
|
6
|
+
* routes intersect this with their payload (see {@link MobileServerPublicQuerySuccessResponse}), inlining the
|
|
7
|
+
* payload fields alongside `status` rather than nesting them under a `data` key like the engine does; execute
|
|
8
|
+
* routes return it as-is because they carry no payload.
|
|
9
|
+
*/
|
|
10
|
+
interface MobileServerSuccessResponse {
|
|
11
|
+
status: 'success';
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Failure envelope returned by any mobile service API route. A response missing this envelope shape
|
|
15
|
+
* (e.g. a malformed body, or a non-JSON response) is a transport-level error, not a domain error.
|
|
16
|
+
*/
|
|
17
|
+
interface MobileServerFailureResponse {
|
|
18
|
+
status: 'failure';
|
|
19
|
+
error: string;
|
|
20
|
+
error_code: number;
|
|
21
|
+
request_type: MobileServerRequestType;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { MobileServerSuccessResponse as n, MobileServerFailureResponse as t };
|
|
25
|
+
//# sourceMappingURL=serverBaseTypes-DSRgU2Fb.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverBaseTypes-DSRgU2Fb.d.cts","names":[],"sources":["../src/types/src/types/serverBaseTypes.ts"],"mappings":";;;;;AAQA;;;;UAAiB,2BAAA;EACf,MAAM;AAAA;;;;;UAOS,2BAAA;EACf,MAAA;EACA,KAAA;EACA,UAAA;EACA,YAAA,EAAc,uBAAuB;AAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { n as MobileServerPublicExecuteRequestByType, r as MobileServerPublicExecuteRequestType } from "./serverRequestTypes-CHDk6JwE.cjs";
|
|
2
|
+
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "./serverBaseTypes-DSRgU2Fb.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/types/serverExecuteTypes.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Unsigned `public_execute` request body: a `type` discriminant flattened with its params, mirroring
|
|
7
|
+
* {@link MobileServerPublicQueryRequest}.
|
|
8
|
+
*/
|
|
9
|
+
type MobileServerPublicExecuteRequest<T extends MobileServerPublicExecuteRequestType = MobileServerPublicExecuteRequestType> = { [K in MobileServerPublicExecuteRequestType]: {
|
|
10
|
+
type: K;
|
|
11
|
+
} & MobileServerPublicExecuteRequestByType[K] }[T];
|
|
12
|
+
/**
|
|
13
|
+
* Discriminated `execute` result union. Mobile execute routes return no payload beyond the success
|
|
14
|
+
* discriminant, so the success arm is the base success envelope; failures use the uniform failure envelope.
|
|
15
|
+
*/
|
|
16
|
+
type MobileServerExecuteResult = MobileServerSuccessResponse | MobileServerFailureResponse;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { MobileServerPublicExecuteRequest as n, MobileServerExecuteResult as t };
|
|
19
|
+
//# sourceMappingURL=serverExecuteTypes-BCb6bUMP.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverExecuteTypes-BCb6bUMP.d.cts","names":[],"sources":["../src/types/src/types/serverExecuteTypes.ts"],"mappings":";;;;;;AAaA;;KAAY,gCAAA,WACA,oCAAA,GACR,oCAAA,YAEI,oCAAA;EACJ,IAAA,EAAM,CAAA;AAAA,IACJ,sCAAA,CAAuC,CAAA,IAC3C,CAAA;;;;;KAMU,yBAAA,GACR,2BAAA,GACA,2BAA2B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { n as MobileServerPublicExecuteRequestByType, r as MobileServerPublicExecuteRequestType } from "./serverRequestTypes-DYTLrCpz.js";
|
|
2
|
+
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "./serverBaseTypes-CzRgwUvA.js";
|
|
3
|
+
|
|
4
|
+
//#region src/types/serverExecuteTypes.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Unsigned `public_execute` request body: a `type` discriminant flattened with its params, mirroring
|
|
7
|
+
* {@link MobileServerPublicQueryRequest}.
|
|
8
|
+
*/
|
|
9
|
+
type MobileServerPublicExecuteRequest<T extends MobileServerPublicExecuteRequestType = MobileServerPublicExecuteRequestType> = { [K in MobileServerPublicExecuteRequestType]: {
|
|
10
|
+
type: K;
|
|
11
|
+
} & MobileServerPublicExecuteRequestByType[K] }[T];
|
|
12
|
+
/**
|
|
13
|
+
* Discriminated `execute` result union. Mobile execute routes return no payload beyond the success
|
|
14
|
+
* discriminant, so the success arm is the base success envelope; failures use the uniform failure envelope.
|
|
15
|
+
*/
|
|
16
|
+
type MobileServerExecuteResult = MobileServerSuccessResponse | MobileServerFailureResponse;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { MobileServerPublicExecuteRequest as n, MobileServerExecuteResult as t };
|
|
19
|
+
//# sourceMappingURL=serverExecuteTypes-CI3NBW2Z.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverExecuteTypes-CI3NBW2Z.d.ts","names":[],"sources":["../src/types/src/types/serverExecuteTypes.ts"],"mappings":";;;;;;AAaA;;KAAY,gCAAA,WACA,oCAAA,GACR,oCAAA,YAEI,oCAAA;EACJ,IAAA,EAAM,CAAA;AAAA,IACJ,sCAAA,CAAuC,CAAA,IAC3C,CAAA;;;;;KAMU,yBAAA,GACR,2BAAA,GACA,2BAA2B"}
|