@nadohq/mobile-client 0.30.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-CfDtaEeL.cjs → MobileClient-_i0ZV6Dq.cjs} +88 -48
- package/dist/MobileClient-_i0ZV6Dq.cjs.map +1 -0
- package/dist/MobileClient.cjs +1 -1
- package/dist/MobileClient.d.cts +66 -37
- package/dist/MobileClient.d.cts.map +1 -1
- package/dist/MobileClient.d.ts +66 -37
- package/dist/MobileClient.d.ts.map +1 -1
- package/dist/MobileClient.js +88 -48
- package/dist/MobileClient.js.map +1 -1
- package/dist/{MobileServerFailureError-B11rr9O5.d.cts → MobileServerFailureError-BoyAfEZA.d.cts} +3 -3
- package/dist/{MobileServerFailureError-B11rr9O5.d.cts.map → MobileServerFailureError-BoyAfEZA.d.cts.map} +1 -1
- package/dist/{MobileServerFailureError-DoIvXqYV.d.ts → MobileServerFailureError-MgYVBh5p.d.ts} +3 -3
- package/dist/{MobileServerFailureError-DoIvXqYV.d.ts.map → MobileServerFailureError-MgYVBh5p.d.ts.map} +1 -1
- package/dist/{buildSignedMobileRequest-EEnDgZF8.d.cts → buildSignedMobileRequest-CBMt97aY.d.cts} +2 -2
- package/dist/{buildSignedMobileRequest-EEnDgZF8.d.cts.map → buildSignedMobileRequest-CBMt97aY.d.cts.map} +1 -1
- package/dist/{buildSignedMobileRequest-B4KJ6T1y.d.ts → buildSignedMobileRequest-qEC4gWaI.d.ts} +2 -2
- package/dist/{buildSignedMobileRequest-B4KJ6T1y.d.ts.map → buildSignedMobileRequest-qEC4gWaI.d.ts.map} +1 -1
- package/dist/{canonicalize-Cc7hdZLJ.d.ts → canonicalize-QNARV_Xc.d.cts} +4 -4
- package/dist/canonicalize-QNARV_Xc.d.cts.map +1 -0
- package/dist/{canonicalize-CDdYnhL3.d.cts → canonicalize-wVdGejB1.d.ts} +4 -4
- package/dist/canonicalize-wVdGejB1.d.ts.map +1 -0
- package/dist/{clientTypes-BsOps_pY.d.ts → clientTypes-6utzUU-b.d.ts} +40 -32
- package/dist/clientTypes-6utzUU-b.d.ts.map +1 -0
- package/dist/{clientTypes-UFInIAQd.d.cts → clientTypes-D9qgtNlE.d.cts} +40 -32
- package/dist/clientTypes-D9qgtNlE.d.cts.map +1 -0
- package/dist/dataMappers.cjs +2 -1
- package/dist/dataMappers.cjs.map +1 -1
- package/dist/dataMappers.d.cts +3 -3
- package/dist/dataMappers.d.cts.map +1 -1
- package/dist/dataMappers.d.ts +3 -3
- package/dist/dataMappers.d.ts.map +1 -1
- package/dist/dataMappers.js +2 -1
- package/dist/dataMappers.js.map +1 -1
- package/dist/{eip712MethodByType-DCU415zf.d.cts → eip712MethodByType-CroIPqsJ.d.cts} +2 -2
- package/dist/eip712MethodByType-CroIPqsJ.d.cts.map +1 -0
- package/dist/{eip712MethodByType-B67XiwTu.d.ts → eip712MethodByType-DBUy4AdI.d.ts} +2 -2
- package/dist/eip712MethodByType-DBUy4AdI.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/{mobileErrorCodes-Cj84nBnT.d.cts → mobileErrorCodes-CuQ5lyBV.d.ts} +2 -4
- package/dist/mobileErrorCodes-CuQ5lyBV.d.ts.map +1 -0
- package/dist/{mobileErrorCodes-Czmigq9x.d.ts → mobileErrorCodes-D_SyBm0k.d.cts} +2 -4
- package/dist/mobileErrorCodes-D_SyBm0k.d.cts.map +1 -0
- package/dist/{payloadHash-BSoGv3Lz.d.cts → payloadHash-B0tlFOK8.d.cts} +2 -2
- package/dist/payloadHash-B0tlFOK8.d.cts.map +1 -0
- package/dist/{payloadHash-BVP2v3p9.d.ts → payloadHash-D1yTQSF4.d.ts} +2 -2
- package/dist/payloadHash-D1yTQSF4.d.ts.map +1 -0
- package/dist/{serverBaseTypes-m3zEi0X9.d.ts → serverBaseTypes-CzRgwUvA.d.ts} +2 -2
- package/dist/{serverBaseTypes-m3zEi0X9.d.ts.map → serverBaseTypes-CzRgwUvA.d.ts.map} +1 -1
- package/dist/{serverBaseTypes-A16onlPN.d.cts → serverBaseTypes-DSRgU2Fb.d.cts} +2 -2
- package/dist/{serverBaseTypes-A16onlPN.d.cts.map → serverBaseTypes-DSRgU2Fb.d.cts.map} +1 -1
- 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-CPZUvVil.d.cts → serverModelTypes-BYQcsRrx.d.cts} +14 -11
- package/dist/serverModelTypes-BYQcsRrx.d.cts.map +1 -0
- package/dist/{serverModelTypes-CqnqHY5F.d.ts → serverModelTypes-DvPs5qs3.d.ts} +14 -11
- package/dist/serverModelTypes-DvPs5qs3.d.ts.map +1 -0
- package/dist/{serverQueryTypes-CJLWWZBs.d.ts → serverQueryTypes-9H6P1vJ5.d.cts} +9 -8
- package/dist/serverQueryTypes-9H6P1vJ5.d.cts.map +1 -0
- package/dist/{serverQueryTypes-C_cCx0Ac.d.cts → serverQueryTypes-Cbjx0bIj.d.ts} +9 -8
- package/dist/serverQueryTypes-Cbjx0bIj.d.ts.map +1 -0
- package/dist/{serverRequestTypes-DQDy3K9O.d.ts → serverRequestTypes-CHDk6JwE.d.cts} +31 -8
- package/dist/serverRequestTypes-CHDk6JwE.d.cts.map +1 -0
- package/dist/{serverRequestTypes-DnU_FfMI.d.cts → serverRequestTypes-DYTLrCpz.d.ts} +31 -8
- package/dist/serverRequestTypes-DYTLrCpz.d.ts.map +1 -0
- package/dist/{serverResponseGuards-BlvfJjsa.d.cts → serverResponseGuards-DRMHmfXh.d.cts} +2 -2
- package/dist/{serverResponseGuards-BlvfJjsa.d.cts.map → serverResponseGuards-DRMHmfXh.d.cts.map} +1 -1
- package/dist/{serverResponseGuards-gpHH8SHk.d.ts → serverResponseGuards-DpbZvJfL.d.ts} +2 -2
- package/dist/{serverResponseGuards-gpHH8SHk.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.d.cts +1 -1
- package/dist/types/MobileServerFailureError.d.ts +1 -1
- package/dist/types/clientTypes.d.cts +2 -2
- package/dist/types/clientTypes.d.ts +2 -2
- package/dist/types/index.d.cts +9 -9
- package/dist/types/index.d.ts +9 -9
- package/dist/types/mobileErrorCodes.cjs +2 -3
- 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 +1 -2
- package/dist/types/mobileErrorCodes.js.map +1 -1
- package/dist/types/serverBaseTypes.d.cts +1 -1
- package/dist/types/serverBaseTypes.d.ts +1 -1
- package/dist/types/serverExecuteTypes.d.cts +2 -2
- package/dist/types/serverExecuteTypes.d.ts +2 -2
- package/dist/types/serverModelTypes.cjs.map +1 -1
- package/dist/types/serverModelTypes.d.cts +1 -1
- package/dist/types/serverModelTypes.d.ts +1 -1
- package/dist/types/serverModelTypes.js.map +1 -1
- package/dist/types/serverQueryTypes.d.cts +1 -1
- package/dist/types/serverQueryTypes.d.ts +1 -1
- package/dist/types/serverRequestTypes.d.cts +2 -2
- package/dist/types/serverRequestTypes.d.ts +2 -2
- package/dist/{types-UHjZR-js.d.ts → types-CQE3HD2V.d.ts} +4 -15
- package/dist/types-CQE3HD2V.d.ts.map +1 -0
- package/dist/{types-CzOeSYnW.d.cts → types-bNB98pYk.d.cts} +4 -15
- package/dist/types-bNB98pYk.d.cts.map +1 -0
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.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 +119 -90
- package/src/dataMappers.ts +1 -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/clientTypes.ts +38 -30
- package/src/types/mobileErrorCodes.ts +1 -2
- package/src/types/serverExecuteTypes.ts +17 -0
- package/src/types/serverModelTypes.ts +13 -10
- package/src/types/serverQueryTypes.ts +5 -4
- package/src/types/serverRequestTypes.ts +27 -4
- package/dist/MobileClient-CfDtaEeL.cjs.map +0 -1
- package/dist/canonicalize-CDdYnhL3.d.cts.map +0 -1
- package/dist/canonicalize-Cc7hdZLJ.d.ts.map +0 -1
- package/dist/clientTypes-BsOps_pY.d.ts.map +0 -1
- package/dist/clientTypes-UFInIAQd.d.cts.map +0 -1
- package/dist/eip712MethodByType-B67XiwTu.d.ts.map +0 -1
- package/dist/eip712MethodByType-DCU415zf.d.cts.map +0 -1
- package/dist/mobileErrorCodes-Cj84nBnT.d.cts.map +0 -1
- package/dist/mobileErrorCodes-Czmigq9x.d.ts.map +0 -1
- package/dist/payloadHash-BSoGv3Lz.d.cts.map +0 -1
- package/dist/payloadHash-BVP2v3p9.d.ts.map +0 -1
- package/dist/serverExecuteTypes-C-bioiuQ.d.cts +0 -11
- package/dist/serverExecuteTypes-C-bioiuQ.d.cts.map +0 -1
- package/dist/serverExecuteTypes-DfzWOeIx.d.ts +0 -11
- package/dist/serverExecuteTypes-DfzWOeIx.d.ts.map +0 -1
- package/dist/serverModelTypes-CPZUvVil.d.cts.map +0 -1
- package/dist/serverModelTypes-CqnqHY5F.d.ts.map +0 -1
- package/dist/serverQueryTypes-CJLWWZBs.d.ts.map +0 -1
- package/dist/serverQueryTypes-C_cCx0Ac.d.cts.map +0 -1
- package/dist/serverRequestTypes-DQDy3K9O.d.ts.map +0 -1
- package/dist/serverRequestTypes-DnU_FfMI.d.cts.map +0 -1
- package/dist/types-CzOeSYnW.d.cts.map +0 -1
- package/dist/types-UHjZR-js.d.ts.map +0 -1
|
@@ -4,17 +4,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
* Rebuilds an inner payload with its keys in the backend's struct declaration order (`type` first, then the
|
|
5
5
|
* remaining fields in the exact order the backend serializes them). msgpack encodes object keys in insertion
|
|
6
6
|
* order and the payload hash must be reproducible regardless of how the caller constructed the object, so
|
|
7
|
-
* every inner payload — and each of its sub-types — is canonicalized here before hashing. This function
|
|
8
|
-
*
|
|
7
|
+
* every inner payload — and each of its sub-types — is canonicalized here before hashing. This function is
|
|
8
|
+
* the source of truth for that order.
|
|
9
9
|
*/
|
|
10
10
|
function canonicalizeMobileInner(inner) {
|
|
11
11
|
switch (inner.type) {
|
|
12
|
-
case "
|
|
13
|
-
type: "
|
|
14
|
-
display_name: inner.display_name
|
|
15
|
-
};
|
|
16
|
-
case "update_username": return {
|
|
17
|
-
type: "update_username",
|
|
12
|
+
case "set_username": return {
|
|
13
|
+
type: "set_username",
|
|
18
14
|
display_name: inner.display_name
|
|
19
15
|
};
|
|
20
16
|
case "set_private_mode": return {
|
|
@@ -29,39 +25,10 @@ function canonicalizeMobileInner(inner) {
|
|
|
29
25
|
locale: inner.locale,
|
|
30
26
|
app_version: inner.app_version
|
|
31
27
|
};
|
|
32
|
-
case "unregister_expo_token": return {
|
|
33
|
-
type: "unregister_expo_token",
|
|
34
|
-
expo_token: inner.expo_token
|
|
35
|
-
};
|
|
36
|
-
case "update_preferences": return {
|
|
37
|
-
type: "update_preferences",
|
|
38
|
-
preferences: canonicalizeNotificationPreferences(inner.preferences)
|
|
39
|
-
};
|
|
40
|
-
case "notification_preferences": return { type: "notification_preferences" };
|
|
41
28
|
case "registered_devices": return { type: "registered_devices" };
|
|
42
29
|
default: throw new Error(`canonicalizeMobileInner: unhandled inner payload type: ${JSON.stringify(inner)}`);
|
|
43
30
|
}
|
|
44
31
|
}
|
|
45
|
-
/**
|
|
46
|
-
* Rebuilds notification preferences with keys in the backend's struct declaration order, so the msgpack
|
|
47
|
-
* encoding matches the backend's `rmp_serde::to_vec_named` output field-for-field.
|
|
48
|
-
*/
|
|
49
|
-
function canonicalizeNotificationPreferences(preferences) {
|
|
50
|
-
return {
|
|
51
|
-
schema_version: preferences.schema_version,
|
|
52
|
-
categories: preferences.categories.map((category) => ({
|
|
53
|
-
category: category.category,
|
|
54
|
-
enabled: category.enabled,
|
|
55
|
-
scopes: category.scopes.map((scope) => scope.type === "subaccount" ? {
|
|
56
|
-
type: "subaccount",
|
|
57
|
-
subaccount: scope.subaccount
|
|
58
|
-
} : {
|
|
59
|
-
type: "product",
|
|
60
|
-
product_id: scope.product_id
|
|
61
|
-
})
|
|
62
|
-
}))
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
32
|
//#endregion
|
|
66
33
|
exports.canonicalizeMobileInner = canonicalizeMobileInner;
|
|
67
34
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonicalize.cjs","names":[],"sources":["../../src/signing/canonicalize.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"canonicalize.cjs","names":[],"sources":["../../src/signing/canonicalize.ts"],"sourcesContent":["import { MobileSignedInner } from './types';\n\n/**\n * Rebuilds an inner payload with its keys in the backend's struct declaration order (`type` first, then the\n * remaining fields in the exact order the backend serializes them). msgpack encodes object keys in insertion\n * order and the payload hash must be reproducible regardless of how the caller constructed the object, so\n * every inner payload — and each of its sub-types — is canonicalized here before hashing. This function is\n * the source of truth for that order.\n */\nexport function canonicalizeMobileInner(\n inner: MobileSignedInner,\n): MobileSignedInner {\n switch (inner.type) {\n case 'set_username':\n return { type: 'set_username', display_name: inner.display_name };\n case 'set_private_mode':\n return { type: 'set_private_mode', private_mode: inner.private_mode };\n case 'self_identity':\n return { type: 'self_identity' };\n case 'register_expo_token':\n return {\n type: 'register_expo_token',\n expo_token: inner.expo_token,\n platform: inner.platform,\n locale: inner.locale,\n app_version: inner.app_version,\n };\n case 'registered_devices':\n return { type: 'registered_devices' };\n default: {\n throw new Error(\n `canonicalizeMobileInner: unhandled inner payload type: ${JSON.stringify(inner)}`,\n );\n }\n }\n}\n"],"mappings":";;;;;;;;;AASA,SAAgB,wBACd,OACmB;CACnB,QAAQ,MAAM,MAAd;EACE,KAAK,gBACH,OAAO;GAAE,MAAM;GAAgB,cAAc,MAAM;EAAa;EAClE,KAAK,oBACH,OAAO;GAAE,MAAM;GAAoB,cAAc,MAAM;EAAa;EACtE,KAAK,iBACH,OAAO,EAAE,MAAM,gBAAgB;EACjC,KAAK,uBACH,OAAO;GACL,MAAM;GACN,YAAY,MAAM;GAClB,UAAU,MAAM;GAChB,QAAQ,MAAM;GACd,aAAa,MAAM;EACrB;EACF,KAAK,sBACH,OAAO,EAAE,MAAM,qBAAqB;EACtC,SACE,MAAM,IAAI,MACR,0DAA0D,KAAK,UAAU,KAAK,GAChF;CAEJ;AACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as canonicalizeMobileInner } from "../canonicalize-
|
|
1
|
+
import { t as canonicalizeMobileInner } from "../canonicalize-QNARV_Xc.cjs";
|
|
2
2
|
export { canonicalizeMobileInner };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as canonicalizeMobileInner } from "../canonicalize-
|
|
1
|
+
import { t as canonicalizeMobileInner } from "../canonicalize-wVdGejB1.js";
|
|
2
2
|
export { canonicalizeMobileInner };
|
|
@@ -3,17 +3,13 @@
|
|
|
3
3
|
* Rebuilds an inner payload with its keys in the backend's struct declaration order (`type` first, then the
|
|
4
4
|
* remaining fields in the exact order the backend serializes them). msgpack encodes object keys in insertion
|
|
5
5
|
* order and the payload hash must be reproducible regardless of how the caller constructed the object, so
|
|
6
|
-
* every inner payload — and each of its sub-types — is canonicalized here before hashing. This function
|
|
7
|
-
*
|
|
6
|
+
* every inner payload — and each of its sub-types — is canonicalized here before hashing. This function is
|
|
7
|
+
* the source of truth for that order.
|
|
8
8
|
*/
|
|
9
9
|
function canonicalizeMobileInner(inner) {
|
|
10
10
|
switch (inner.type) {
|
|
11
|
-
case "
|
|
12
|
-
type: "
|
|
13
|
-
display_name: inner.display_name
|
|
14
|
-
};
|
|
15
|
-
case "update_username": return {
|
|
16
|
-
type: "update_username",
|
|
11
|
+
case "set_username": return {
|
|
12
|
+
type: "set_username",
|
|
17
13
|
display_name: inner.display_name
|
|
18
14
|
};
|
|
19
15
|
case "set_private_mode": return {
|
|
@@ -28,39 +24,10 @@ function canonicalizeMobileInner(inner) {
|
|
|
28
24
|
locale: inner.locale,
|
|
29
25
|
app_version: inner.app_version
|
|
30
26
|
};
|
|
31
|
-
case "unregister_expo_token": return {
|
|
32
|
-
type: "unregister_expo_token",
|
|
33
|
-
expo_token: inner.expo_token
|
|
34
|
-
};
|
|
35
|
-
case "update_preferences": return {
|
|
36
|
-
type: "update_preferences",
|
|
37
|
-
preferences: canonicalizeNotificationPreferences(inner.preferences)
|
|
38
|
-
};
|
|
39
|
-
case "notification_preferences": return { type: "notification_preferences" };
|
|
40
27
|
case "registered_devices": return { type: "registered_devices" };
|
|
41
28
|
default: throw new Error(`canonicalizeMobileInner: unhandled inner payload type: ${JSON.stringify(inner)}`);
|
|
42
29
|
}
|
|
43
30
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Rebuilds notification preferences with keys in the backend's struct declaration order, so the msgpack
|
|
46
|
-
* encoding matches the backend's `rmp_serde::to_vec_named` output field-for-field.
|
|
47
|
-
*/
|
|
48
|
-
function canonicalizeNotificationPreferences(preferences) {
|
|
49
|
-
return {
|
|
50
|
-
schema_version: preferences.schema_version,
|
|
51
|
-
categories: preferences.categories.map((category) => ({
|
|
52
|
-
category: category.category,
|
|
53
|
-
enabled: category.enabled,
|
|
54
|
-
scopes: category.scopes.map((scope) => scope.type === "subaccount" ? {
|
|
55
|
-
type: "subaccount",
|
|
56
|
-
subaccount: scope.subaccount
|
|
57
|
-
} : {
|
|
58
|
-
type: "product",
|
|
59
|
-
product_id: scope.product_id
|
|
60
|
-
})
|
|
61
|
-
}))
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
31
|
//#endregion
|
|
65
32
|
export { canonicalizeMobileInner };
|
|
66
33
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonicalize.js","names":[],"sources":["../../src/signing/canonicalize.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"canonicalize.js","names":[],"sources":["../../src/signing/canonicalize.ts"],"sourcesContent":["import { MobileSignedInner } from './types';\n\n/**\n * Rebuilds an inner payload with its keys in the backend's struct declaration order (`type` first, then the\n * remaining fields in the exact order the backend serializes them). msgpack encodes object keys in insertion\n * order and the payload hash must be reproducible regardless of how the caller constructed the object, so\n * every inner payload — and each of its sub-types — is canonicalized here before hashing. This function is\n * the source of truth for that order.\n */\nexport function canonicalizeMobileInner(\n inner: MobileSignedInner,\n): MobileSignedInner {\n switch (inner.type) {\n case 'set_username':\n return { type: 'set_username', display_name: inner.display_name };\n case 'set_private_mode':\n return { type: 'set_private_mode', private_mode: inner.private_mode };\n case 'self_identity':\n return { type: 'self_identity' };\n case 'register_expo_token':\n return {\n type: 'register_expo_token',\n expo_token: inner.expo_token,\n platform: inner.platform,\n locale: inner.locale,\n app_version: inner.app_version,\n };\n case 'registered_devices':\n return { type: 'registered_devices' };\n default: {\n throw new Error(\n `canonicalizeMobileInner: unhandled inner payload type: ${JSON.stringify(inner)}`,\n );\n }\n }\n}\n"],"mappings":";;;;;;;;AASA,SAAgB,wBACd,OACmB;CACnB,QAAQ,MAAM,MAAd;EACE,KAAK,gBACH,OAAO;GAAE,MAAM;GAAgB,cAAc,MAAM;EAAa;EAClE,KAAK,oBACH,OAAO;GAAE,MAAM;GAAoB,cAAc,MAAM;EAAa;EACtE,KAAK,iBACH,OAAO,EAAE,MAAM,gBAAgB;EACjC,KAAK,uBACH,OAAO;GACL,MAAM;GACN,YAAY,MAAM;GAClB,UAAU,MAAM;GAChB,QAAQ,MAAM;GACd,aAAa,MAAM;EACrB;EACF,KAAK,sBACH,OAAO,EAAE,MAAM,qBAAqB;EACtC,SACE,MAAM,IAAI,MACR,0DAA0D,KAAK,UAAU,KAAK,GAChF;CAEJ;AACF"}
|
|
@@ -4,14 +4,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
* EIP-712 `method` string for each signed inner payload type.
|
|
5
5
|
*/
|
|
6
6
|
const MOBILE_EIP712_METHOD_BY_TYPE = {
|
|
7
|
-
|
|
8
|
-
update_username: "mobile:execute_update_username",
|
|
7
|
+
set_username: "mobile:execute_set_username",
|
|
9
8
|
set_private_mode: "mobile:execute_set_private_mode",
|
|
10
9
|
self_identity: "mobile:query_self_identity",
|
|
11
10
|
register_expo_token: "mobile:execute_register_expo_token",
|
|
12
|
-
unregister_expo_token: "mobile:execute_unregister_expo_token",
|
|
13
|
-
update_preferences: "mobile:execute_update_preferences",
|
|
14
|
-
notification_preferences: "mobile:query_notification_preferences",
|
|
15
11
|
registered_devices: "mobile:query_registered_devices"
|
|
16
12
|
};
|
|
17
13
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eip712MethodByType.cjs","names":[],"sources":["../../src/signing/eip712MethodByType.ts"],"sourcesContent":["import { MobileSignedInner } from './types';\n\n/**\n * EIP-712 `method` string for each signed inner payload type.\n */\nexport const MOBILE_EIP712_METHOD_BY_TYPE: Record<\n MobileSignedInner['type'],\n string\n> = {\n
|
|
1
|
+
{"version":3,"file":"eip712MethodByType.cjs","names":[],"sources":["../../src/signing/eip712MethodByType.ts"],"sourcesContent":["import { MobileSignedInner } from './types';\n\n/**\n * EIP-712 `method` string for each signed inner payload type.\n */\nexport const MOBILE_EIP712_METHOD_BY_TYPE: Record<\n MobileSignedInner['type'],\n string\n> = {\n set_username: 'mobile:execute_set_username',\n set_private_mode: 'mobile:execute_set_private_mode',\n self_identity: 'mobile:query_self_identity',\n register_expo_token: 'mobile:execute_register_expo_token',\n registered_devices: 'mobile:query_registered_devices',\n};\n"],"mappings":";;;;;AAKA,MAAa,+BAGT;CACF,cAAc;CACd,kBAAkB;CAClB,eAAe;CACf,qBAAqB;CACrB,oBAAoB;AACtB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as MOBILE_EIP712_METHOD_BY_TYPE } from "../eip712MethodByType-
|
|
1
|
+
import { t as MOBILE_EIP712_METHOD_BY_TYPE } from "../eip712MethodByType-CroIPqsJ.cjs";
|
|
2
2
|
export { MOBILE_EIP712_METHOD_BY_TYPE };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as MOBILE_EIP712_METHOD_BY_TYPE } from "../eip712MethodByType-
|
|
1
|
+
import { t as MOBILE_EIP712_METHOD_BY_TYPE } from "../eip712MethodByType-DBUy4AdI.js";
|
|
2
2
|
export { MOBILE_EIP712_METHOD_BY_TYPE };
|
|
@@ -3,14 +3,10 @@
|
|
|
3
3
|
* EIP-712 `method` string for each signed inner payload type.
|
|
4
4
|
*/
|
|
5
5
|
const MOBILE_EIP712_METHOD_BY_TYPE = {
|
|
6
|
-
|
|
7
|
-
update_username: "mobile:execute_update_username",
|
|
6
|
+
set_username: "mobile:execute_set_username",
|
|
8
7
|
set_private_mode: "mobile:execute_set_private_mode",
|
|
9
8
|
self_identity: "mobile:query_self_identity",
|
|
10
9
|
register_expo_token: "mobile:execute_register_expo_token",
|
|
11
|
-
unregister_expo_token: "mobile:execute_unregister_expo_token",
|
|
12
|
-
update_preferences: "mobile:execute_update_preferences",
|
|
13
|
-
notification_preferences: "mobile:query_notification_preferences",
|
|
14
10
|
registered_devices: "mobile:query_registered_devices"
|
|
15
11
|
};
|
|
16
12
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eip712MethodByType.js","names":[],"sources":["../../src/signing/eip712MethodByType.ts"],"sourcesContent":["import { MobileSignedInner } from './types';\n\n/**\n * EIP-712 `method` string for each signed inner payload type.\n */\nexport const MOBILE_EIP712_METHOD_BY_TYPE: Record<\n MobileSignedInner['type'],\n string\n> = {\n
|
|
1
|
+
{"version":3,"file":"eip712MethodByType.js","names":[],"sources":["../../src/signing/eip712MethodByType.ts"],"sourcesContent":["import { MobileSignedInner } from './types';\n\n/**\n * EIP-712 `method` string for each signed inner payload type.\n */\nexport const MOBILE_EIP712_METHOD_BY_TYPE: Record<\n MobileSignedInner['type'],\n string\n> = {\n set_username: 'mobile:execute_set_username',\n set_private_mode: 'mobile:execute_set_private_mode',\n self_identity: 'mobile:query_self_identity',\n register_expo_token: 'mobile:execute_register_expo_token',\n registered_devices: 'mobile:query_registered_devices',\n};\n"],"mappings":";;;;AAKA,MAAa,+BAGT;CACF,cAAc;CACd,kBAAkB;CAClB,eAAe;CACf,qBAAqB;CACrB,oBAAoB;AACtB"}
|
package/dist/signing/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as MobileSignedRequest, n as MobileSignedInner, r as MobileSignedInnerParams, t as BuildSignedMobileRequestParams } from "../types-
|
|
2
|
-
import { t as buildSignedMobileRequest } from "../buildSignedMobileRequest-
|
|
3
|
-
import { t as canonicalizeMobileInner } from "../canonicalize-
|
|
4
|
-
import { t as MOBILE_EIP712_METHOD_BY_TYPE } from "../eip712MethodByType-
|
|
1
|
+
import { i as MobileSignedRequest, n as MobileSignedInner, r as MobileSignedInnerParams, t as BuildSignedMobileRequestParams } from "../types-bNB98pYk.cjs";
|
|
2
|
+
import { t as buildSignedMobileRequest } from "../buildSignedMobileRequest-CBMt97aY.cjs";
|
|
3
|
+
import { t as canonicalizeMobileInner } from "../canonicalize-QNARV_Xc.cjs";
|
|
4
|
+
import { t as MOBILE_EIP712_METHOD_BY_TYPE } from "../eip712MethodByType-CroIPqsJ.cjs";
|
|
5
5
|
import { t as getMobileNonce } from "../nonce-zGyisRlj.cjs";
|
|
6
|
-
import { t as getMobilePayloadHash } from "../payloadHash-
|
|
6
|
+
import { t as getMobilePayloadHash } from "../payloadHash-B0tlFOK8.cjs";
|
|
7
7
|
export { BuildSignedMobileRequestParams, MOBILE_EIP712_METHOD_BY_TYPE, MobileSignedInner, MobileSignedInnerParams, MobileSignedRequest, buildSignedMobileRequest, canonicalizeMobileInner, getMobileNonce, getMobilePayloadHash };
|
package/dist/signing/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as MobileSignedRequest, n as MobileSignedInner, r as MobileSignedInnerParams, t as BuildSignedMobileRequestParams } from "../types-
|
|
2
|
-
import { t as buildSignedMobileRequest } from "../buildSignedMobileRequest-
|
|
3
|
-
import { t as canonicalizeMobileInner } from "../canonicalize-
|
|
4
|
-
import { t as MOBILE_EIP712_METHOD_BY_TYPE } from "../eip712MethodByType-
|
|
1
|
+
import { i as MobileSignedRequest, n as MobileSignedInner, r as MobileSignedInnerParams, t as BuildSignedMobileRequestParams } from "../types-CQE3HD2V.js";
|
|
2
|
+
import { t as buildSignedMobileRequest } from "../buildSignedMobileRequest-qEC4gWaI.js";
|
|
3
|
+
import { t as canonicalizeMobileInner } from "../canonicalize-wVdGejB1.js";
|
|
4
|
+
import { t as MOBILE_EIP712_METHOD_BY_TYPE } from "../eip712MethodByType-DBUy4AdI.js";
|
|
5
5
|
import { t as getMobileNonce } from "../nonce-DCOrXXkQ.js";
|
|
6
|
-
import { t as getMobilePayloadHash } from "../payloadHash-
|
|
6
|
+
import { t as getMobilePayloadHash } from "../payloadHash-D1yTQSF4.js";
|
|
7
7
|
export { BuildSignedMobileRequestParams, MOBILE_EIP712_METHOD_BY_TYPE, MobileSignedInner, MobileSignedInnerParams, MobileSignedRequest, buildSignedMobileRequest, canonicalizeMobileInner, getMobileNonce, getMobilePayloadHash };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../MobileClient-
|
|
2
|
+
require("../MobileClient-_i0ZV6Dq.cjs");
|
|
3
3
|
let _msgpack_msgpack = require("@msgpack/msgpack");
|
|
4
4
|
let viem = require("viem");
|
|
5
5
|
//#region src/signing/payloadHash.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as getMobilePayloadHash } from "../payloadHash-
|
|
1
|
+
import { t as getMobilePayloadHash } from "../payloadHash-B0tlFOK8.cjs";
|
|
2
2
|
export { getMobilePayloadHash };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as getMobilePayloadHash } from "../payloadHash-
|
|
1
|
+
import { t as getMobilePayloadHash } from "../payloadHash-D1yTQSF4.js";
|
|
2
2
|
export { getMobilePayloadHash };
|
package/dist/signing/types.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as MobileSignedRequest, n as MobileSignedInner, r as MobileSignedInnerParams, t as BuildSignedMobileRequestParams } from "../types-
|
|
1
|
+
import { i as MobileSignedRequest, n as MobileSignedInner, r as MobileSignedInnerParams, t as BuildSignedMobileRequestParams } from "../types-bNB98pYk.cjs";
|
|
2
2
|
export { BuildSignedMobileRequestParams, MobileSignedInner, MobileSignedInnerParams, MobileSignedRequest };
|
package/dist/signing/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as MobileSignedRequest, n as MobileSignedInner, r as MobileSignedInnerParams, t as BuildSignedMobileRequestParams } from "../types-
|
|
1
|
+
import { i as MobileSignedRequest, n as MobileSignedInner, r as MobileSignedInnerParams, t as BuildSignedMobileRequestParams } from "../types-CQE3HD2V.js";
|
|
2
2
|
export { BuildSignedMobileRequestParams, MobileSignedInner, MobileSignedInnerParams, MobileSignedRequest };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as MobileServerFailureError } from "../MobileServerFailureError-
|
|
1
|
+
import { t as MobileServerFailureError } from "../MobileServerFailureError-BoyAfEZA.cjs";
|
|
2
2
|
export { MobileServerFailureError };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as MobileServerFailureError } from "../MobileServerFailureError-
|
|
1
|
+
import { t as MobileServerFailureError } from "../MobileServerFailureError-MgYVBh5p.js";
|
|
2
2
|
export { MobileServerFailureError };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
export { GetMobileFeedParams, GetMobileNotificationPreferencesParams, GetMobilePublicProfileParams, GetMobileRegisteredDevicesParams, GetMobileSelfIdentityParams, GetMobileUsernameAvailabilityParams,
|
|
1
|
+
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";
|
|
2
|
+
export { GetMobileFeedParams, GetMobileNotificationPreferencesParams, GetMobilePublicProfileParams, GetMobileRegisteredDevicesParams, GetMobileSelfIdentityParams, GetMobileUsernameAvailabilityParams, MobileFeedMargin, MobileFeedPage, MobileFeedTrade, MobileIdentity, MobileNotificationCategoryPreference, MobileNotificationPreferenceScope, MobileNotificationPreferences, MobilePublicProfile, MobileRegisterExpoTokenParams, MobileRegisteredDevice, MobileSetPrivateModeParams, MobileSetUsernameParams, MobileSignedRequestParams, MobileUnregisterExpoTokenParams, MobileUpdateNotificationPreferencesParams, MobileUsernameAvailability, MobileWithExpoTokenParams };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
export { GetMobileFeedParams, GetMobileNotificationPreferencesParams, GetMobilePublicProfileParams, GetMobileRegisteredDevicesParams, GetMobileSelfIdentityParams, GetMobileUsernameAvailabilityParams,
|
|
1
|
+
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";
|
|
2
|
+
export { GetMobileFeedParams, GetMobileNotificationPreferencesParams, GetMobilePublicProfileParams, GetMobileRegisteredDevicesParams, GetMobileSelfIdentityParams, GetMobileUsernameAvailabilityParams, MobileFeedMargin, MobileFeedPage, MobileFeedTrade, MobileIdentity, MobileNotificationCategoryPreference, MobileNotificationPreferenceScope, MobileNotificationPreferences, MobilePublicProfile, MobileRegisterExpoTokenParams, MobileRegisteredDevice, MobileSetPrivateModeParams, MobileSetUsernameParams, MobileSignedRequestParams, MobileUnregisterExpoTokenParams, MobileUpdateNotificationPreferencesParams, MobileUsernameAvailability, MobileWithExpoTokenParams };
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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-
|
|
2
|
-
import { C as
|
|
3
|
-
import { a as
|
|
4
|
-
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "../serverBaseTypes-
|
|
5
|
-
import {
|
|
6
|
-
import { n as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
export { GetMobileFeedParams, GetMobileNotificationPreferencesParams, GetMobilePublicProfileParams, GetMobileRegisteredDevicesParams, GetMobileSelfIdentityParams, GetMobileUsernameAvailabilityParams, MOBILE_ERROR_CODES, MOBILE_FEED_MARGIN_MODES, MOBILE_FEED_TRADE_POSITION_DIRECTIONS, MOBILE_FEED_TRADE_POSITION_EFFECTS,
|
|
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 { 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";
|
|
4
|
+
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "../serverBaseTypes-DSRgU2Fb.cjs";
|
|
5
|
+
import { n as MobileServerPublicExecuteRequest, t as MobileServerExecuteResult } from "../serverExecuteTypes-BCb6bUMP.cjs";
|
|
6
|
+
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";
|
|
7
|
+
import { n as MobileErrorCode, t as MOBILE_ERROR_CODES } from "../mobileErrorCodes-D_SyBm0k.cjs";
|
|
8
|
+
import { t as MobileServerFailureError } from "../MobileServerFailureError-BoyAfEZA.cjs";
|
|
9
|
+
export { GetMobileFeedParams, GetMobileNotificationPreferencesParams, GetMobilePublicProfileParams, GetMobileRegisteredDevicesParams, GetMobileSelfIdentityParams, GetMobileUsernameAvailabilityParams, MOBILE_ERROR_CODES, MOBILE_FEED_MARGIN_MODES, MOBILE_FEED_TRADE_POSITION_DIRECTIONS, MOBILE_FEED_TRADE_POSITION_EFFECTS, 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, MobileSignedRequestParams, MobileUnregisterExpoTokenParams, MobileUpdateNotificationPreferencesParams, MobileUsernameAvailability, MobileWithExpoTokenParams };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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-
|
|
2
|
-
import { C as
|
|
3
|
-
import { a as
|
|
4
|
-
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "../serverBaseTypes-
|
|
5
|
-
import {
|
|
6
|
-
import { n as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
export { GetMobileFeedParams, GetMobileNotificationPreferencesParams, GetMobilePublicProfileParams, GetMobileRegisteredDevicesParams, GetMobileSelfIdentityParams, GetMobileUsernameAvailabilityParams, MOBILE_ERROR_CODES, MOBILE_FEED_MARGIN_MODES, MOBILE_FEED_TRADE_POSITION_DIRECTIONS, MOBILE_FEED_TRADE_POSITION_EFFECTS,
|
|
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 { 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";
|
|
4
|
+
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "../serverBaseTypes-CzRgwUvA.js";
|
|
5
|
+
import { n as MobileServerPublicExecuteRequest, t as MobileServerExecuteResult } from "../serverExecuteTypes-CI3NBW2Z.js";
|
|
6
|
+
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";
|
|
7
|
+
import { n as MobileErrorCode, t as MOBILE_ERROR_CODES } from "../mobileErrorCodes-CuQ5lyBV.js";
|
|
8
|
+
import { t as MobileServerFailureError } from "../MobileServerFailureError-MgYVBh5p.js";
|
|
9
|
+
export { GetMobileFeedParams, GetMobileNotificationPreferencesParams, GetMobilePublicProfileParams, GetMobileRegisteredDevicesParams, GetMobileSelfIdentityParams, GetMobileUsernameAvailabilityParams, MOBILE_ERROR_CODES, MOBILE_FEED_MARGIN_MODES, MOBILE_FEED_TRADE_POSITION_DIRECTIONS, MOBILE_FEED_TRADE_POSITION_EFFECTS, 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, MobileSignedRequestParams, MobileUnregisterExpoTokenParams, MobileUpdateNotificationPreferencesParams, MobileUsernameAvailability, MobileWithExpoTokenParams };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../MobileClient-
|
|
2
|
+
require("../MobileClient-_i0ZV6Dq.cjs");
|
|
3
3
|
//#region src/types/mobileErrorCodes.ts
|
|
4
4
|
/**
|
|
5
5
|
* Numeric error codes returned by the mobile service API. Identity codes (61xx), notification codes (62xx),
|
|
@@ -10,9 +10,8 @@ const MOBILE_ERROR_CODES = {
|
|
|
10
10
|
...require("@nadohq/shared").NADO_ERROR_CODES,
|
|
11
11
|
INVALID_DISPLAY_NAME: 6100,
|
|
12
12
|
USERNAME_UNAVAILABLE: 6101,
|
|
13
|
-
IDENTITY_ALREADY_CLAIMED: 6102,
|
|
14
|
-
IDENTITY_REQUIRED: 6103,
|
|
15
13
|
INVALID_IDENTITY_TARGET: 6104,
|
|
14
|
+
/** Another identity write for the subaccount committed with a later nonce. Re-read before retrying. */
|
|
16
15
|
STALE_IDENTITY_UPDATE: 6105,
|
|
17
16
|
PROFILE_NOT_FOUND: 6106,
|
|
18
17
|
INVALID_EXPO_TOKEN: 6200,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobileErrorCodes.cjs","names":["NADO_ERROR_CODES"],"sources":["../../src/types/mobileErrorCodes.ts"],"sourcesContent":["import { NADO_ERROR_CODES } from '@nadohq/shared';\n\n/**\n * Numeric error codes returned by the mobile service API. Identity codes (61xx), notification codes (62xx),\n * and feed codes (63xx) are mobile-specific; the remaining codes are shared cross-service codes from the\n * backend's common error enum, inlined via spread from {@link NADO_ERROR_CODES}.\n */\nexport const MOBILE_ERROR_CODES = {\n ...NADO_ERROR_CODES,\n INVALID_DISPLAY_NAME: 6100,\n USERNAME_UNAVAILABLE: 6101,\n
|
|
1
|
+
{"version":3,"file":"mobileErrorCodes.cjs","names":["NADO_ERROR_CODES"],"sources":["../../src/types/mobileErrorCodes.ts"],"sourcesContent":["import { NADO_ERROR_CODES } from '@nadohq/shared';\n\n/**\n * Numeric error codes returned by the mobile service API. Identity codes (61xx), notification codes (62xx),\n * and feed codes (63xx) are mobile-specific; the remaining codes are shared cross-service codes from the\n * backend's common error enum, inlined via spread from {@link NADO_ERROR_CODES}.\n */\nexport const MOBILE_ERROR_CODES = {\n ...NADO_ERROR_CODES,\n INVALID_DISPLAY_NAME: 6100,\n USERNAME_UNAVAILABLE: 6101,\n INVALID_IDENTITY_TARGET: 6104,\n /** Another identity write for the subaccount committed with a later nonce. Re-read before retrying. */\n STALE_IDENTITY_UPDATE: 6105,\n PROFILE_NOT_FOUND: 6106,\n INVALID_EXPO_TOKEN: 6200,\n INVALID_DEVICE_METADATA: 6201,\n INVALID_PREFERENCES: 6202,\n /** Feed `minimumNotional` or `limit` is outside its allowed domain. Fix the request; do not retry unchanged. */\n INVALID_FEED_FILTER: 6300,\n /** Feed cursor is malformed or bound to a different filter. Discard it and restart from the first page. */\n INVALID_FEED_CURSOR: 6301,\n} as const;\n\n/**\n * Union of all known mobile service API error codes.\n */\nexport type MobileErrorCode =\n (typeof MOBILE_ERROR_CODES)[keyof typeof MOBILE_ERROR_CODES];\n"],"mappings":";;;;;;;;AAOA,MAAa,qBAAqB;CAChC,2BAAGA,EAAAA;CACH,sBAAsB;CACtB,sBAAsB;CACtB,yBAAyB;;CAEzB,uBAAuB;CACvB,mBAAmB;CACnB,oBAAoB;CACpB,yBAAyB;CACzB,qBAAqB;;CAErB,qBAAqB;;CAErB,qBAAqB;AACvB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as MobileErrorCode, t as MOBILE_ERROR_CODES } from "../mobileErrorCodes-
|
|
1
|
+
import { n as MobileErrorCode, t as MOBILE_ERROR_CODES } from "../mobileErrorCodes-D_SyBm0k.cjs";
|
|
2
2
|
export { MOBILE_ERROR_CODES, MobileErrorCode };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as MobileErrorCode, t as MOBILE_ERROR_CODES } from "../mobileErrorCodes-
|
|
1
|
+
import { n as MobileErrorCode, t as MOBILE_ERROR_CODES } from "../mobileErrorCodes-CuQ5lyBV.js";
|
|
2
2
|
export { MOBILE_ERROR_CODES, MobileErrorCode };
|
|
@@ -9,9 +9,8 @@ const MOBILE_ERROR_CODES = {
|
|
|
9
9
|
...NADO_ERROR_CODES,
|
|
10
10
|
INVALID_DISPLAY_NAME: 6100,
|
|
11
11
|
USERNAME_UNAVAILABLE: 6101,
|
|
12
|
-
IDENTITY_ALREADY_CLAIMED: 6102,
|
|
13
|
-
IDENTITY_REQUIRED: 6103,
|
|
14
12
|
INVALID_IDENTITY_TARGET: 6104,
|
|
13
|
+
/** Another identity write for the subaccount committed with a later nonce. Re-read before retrying. */
|
|
15
14
|
STALE_IDENTITY_UPDATE: 6105,
|
|
16
15
|
PROFILE_NOT_FOUND: 6106,
|
|
17
16
|
INVALID_EXPO_TOKEN: 6200,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobileErrorCodes.js","names":[],"sources":["../../src/types/mobileErrorCodes.ts"],"sourcesContent":["import { NADO_ERROR_CODES } from '@nadohq/shared';\n\n/**\n * Numeric error codes returned by the mobile service API. Identity codes (61xx), notification codes (62xx),\n * and feed codes (63xx) are mobile-specific; the remaining codes are shared cross-service codes from the\n * backend's common error enum, inlined via spread from {@link NADO_ERROR_CODES}.\n */\nexport const MOBILE_ERROR_CODES = {\n ...NADO_ERROR_CODES,\n INVALID_DISPLAY_NAME: 6100,\n USERNAME_UNAVAILABLE: 6101,\n
|
|
1
|
+
{"version":3,"file":"mobileErrorCodes.js","names":[],"sources":["../../src/types/mobileErrorCodes.ts"],"sourcesContent":["import { NADO_ERROR_CODES } from '@nadohq/shared';\n\n/**\n * Numeric error codes returned by the mobile service API. Identity codes (61xx), notification codes (62xx),\n * and feed codes (63xx) are mobile-specific; the remaining codes are shared cross-service codes from the\n * backend's common error enum, inlined via spread from {@link NADO_ERROR_CODES}.\n */\nexport const MOBILE_ERROR_CODES = {\n ...NADO_ERROR_CODES,\n INVALID_DISPLAY_NAME: 6100,\n USERNAME_UNAVAILABLE: 6101,\n INVALID_IDENTITY_TARGET: 6104,\n /** Another identity write for the subaccount committed with a later nonce. Re-read before retrying. */\n STALE_IDENTITY_UPDATE: 6105,\n PROFILE_NOT_FOUND: 6106,\n INVALID_EXPO_TOKEN: 6200,\n INVALID_DEVICE_METADATA: 6201,\n INVALID_PREFERENCES: 6202,\n /** Feed `minimumNotional` or `limit` is outside its allowed domain. Fix the request; do not retry unchanged. */\n INVALID_FEED_FILTER: 6300,\n /** Feed cursor is malformed or bound to a different filter. Discard it and restart from the first page. */\n INVALID_FEED_CURSOR: 6301,\n} as const;\n\n/**\n * Union of all known mobile service API error codes.\n */\nexport type MobileErrorCode =\n (typeof MOBILE_ERROR_CODES)[keyof typeof MOBILE_ERROR_CODES];\n"],"mappings":";;;;;;;AAOA,MAAa,qBAAqB;CAChC,GAAG;CACH,sBAAsB;CACtB,sBAAsB;CACtB,yBAAyB;;CAEzB,uBAAuB;CACvB,mBAAmB;CACnB,oBAAoB;CACpB,yBAAyB;CACzB,qBAAqB;;CAErB,qBAAqB;;CAErB,qBAAqB;AACvB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "../serverBaseTypes-
|
|
1
|
+
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "../serverBaseTypes-DSRgU2Fb.cjs";
|
|
2
2
|
export { MobileServerFailureResponse, MobileServerSuccessResponse };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "../serverBaseTypes-
|
|
1
|
+
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "../serverBaseTypes-CzRgwUvA.js";
|
|
2
2
|
export { MobileServerFailureResponse, MobileServerSuccessResponse };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as MobileServerExecuteResult } from "../serverExecuteTypes-
|
|
2
|
-
export { MobileServerExecuteResult };
|
|
1
|
+
import { n as MobileServerPublicExecuteRequest, t as MobileServerExecuteResult } from "../serverExecuteTypes-BCb6bUMP.cjs";
|
|
2
|
+
export { MobileServerExecuteResult, MobileServerPublicExecuteRequest };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as MobileServerExecuteResult } from "../serverExecuteTypes-
|
|
2
|
-
export { MobileServerExecuteResult };
|
|
1
|
+
import { n as MobileServerPublicExecuteRequest, t as MobileServerExecuteResult } from "../serverExecuteTypes-CI3NBW2Z.js";
|
|
2
|
+
export { MobileServerExecuteResult, MobileServerPublicExecuteRequest };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverModelTypes.cjs","names":[],"sources":["../../src/types/serverModelTypes.ts"],"sourcesContent":["import { BalanceSide } from '@nadohq/shared';\nimport { Hex } from 'viem';\n\n/**\n * Platform of a device registered for push notifications.\n */\nexport type MobileNotificationPlatform = 'ios' | 'android';\n\n/**\n * Category of push notification.\n */\nexport type MobileNotificationCategory =\n | 'order_fill'\n | 'order_update'\n | 'liquidation'\n | 'funding'\n | 'product_listing'\n | 'announcement';\n\n/**\n * Server-side public profile shape (snake_case).\n */\nexport interface MobileServerProfile {\n subaccount: Hex;\n username: string;\n display_name: string;\n}\n\n/**\n * Server-side identity shape (snake_case) returned by the signed `self_identity` query.\n */\nexport interface MobileServerIdentity {\n subaccount: Hex;\n username: string;\n display_name: string;\n private_mode: boolean;\n}\n\n/**\n * Direction of the position a feed trade resulted in — for `closed`, the direction that was closed. This is\n * NOT the execution buy/sell side, which the feed does not expose. Aliases {@link BalanceSide} so the feed's\n * direction values stay in lockstep with the rest of the SDK.\n */\nexport type MobileFeedTradePositionDirection = BalanceSide;\n\n/**\n * Every {@link MobileFeedTradePositionDirection} the feed can report, for callers that need the values at\n * runtime (validation, filters, UI enumeration).\n */\nexport const MOBILE_FEED_TRADE_POSITION_DIRECTIONS = [\n 'long',\n 'short',\n] as const satisfies readonly MobileFeedTradePositionDirection[];\n\n/**\n * Every {@link MobileFeedTradePositionEffect} the feed can report, for callers that need the values at\n * runtime (validation, filters, UI enumeration).\n */\nexport const MOBILE_FEED_TRADE_POSITION_EFFECTS = [\n 'opened',\n 'increased',\n 'reduced',\n 'closed',\n 'flipped',\n] as const;\n\n/**\n * How a feed trade changed the trader's position in the product.\n */\nexport type MobileFeedTradePositionEffect =\n (typeof MOBILE_FEED_TRADE_POSITION_EFFECTS)[number];\n\n/**\n * Position change of a feed trade. Both keys are single words, so the wire and client shapes are identical\n * and this type is shared by {@link MobileServerFeedTrade} and the client-side `MobileFeedTrade`.\n */\nexport interface MobileFeedTradePosition {\n direction: MobileFeedTradePositionDirection;\n effect: MobileFeedTradePositionEffect;\n}\n\n/**\n * Every {@link MobileFeedMarginMode} the feed can report, for callers that need the values at runtime\n * (validation, filters, UI enumeration).\n */\nexport const MOBILE_FEED_MARGIN_MODES = ['cross', 'isolated'] as const;\n\n/**\n * Margin mode a feed trade was executed under. Shared by the wire and client margin shapes.\n */\nexport type MobileFeedMarginMode = (typeof MOBILE_FEED_MARGIN_MODES)[number];\n\n/**\n * Server-side margin of a feed trade. Branch on `mode` — do not infer isolated state from leverage presence:\n * `estimated_leverage` (a rounded whole-number estimate, not exact submitted leverage) is omitted on `cross`,\n * and also omitted inside `isolated` when no estimate is available.\n */\nexport interface MobileServerFeedMargin {\n mode: MobileFeedMarginMode;\n estimated_leverage?: number;\n}\n\n/**\n * Server-side feed trade shape (snake_case): one row per order digest, enriched at read time with the\n * trader's current identity. Amounts are display-oriented human-unit JSON numbers — do not use them for\n * accounting, order construction, or exact threshold decisions.\n */\nexport interface MobileServerFeedTrade {\n /** Order digest this row is keyed by; the stable id clients use to reconcile live pagination. */\n order_digest: Hex;\n subaccount: Hex;\n username: string;\n display_name: string;\n /** Reserved for a future avatar source; `null` until one is implemented. */\n avatar_url: string | null;\n product_id: number;\n /** Executed quantity in human units. */\n quantity: number;\n /** Trade notional in whole-dollar human units. */\n notional: number;\n /** Average execution price in human units. */\n average_price: number;\n margin: MobileServerFeedMargin;\n position: MobileFeedTradePosition;\n /** Realized PnL of the trade in human units; can be negative. */\n realized_pnl: number;\n /** Fill time as JavaScript-safe integer Unix milliseconds. */\n filled_at_ms: number;\n}\n\n/**\n * Server-side scope limiting a notification category preference. Scopes are rejected by the backend for the\n * MVP (`scopes` must be empty) but are part of the wire format.\n */\nexport type MobileServerNotificationPreferenceScope =\n | { type: 'subaccount'; subaccount: Hex }\n | { type: 'product'; product_id: number };\n\n/**\n * Server-side per-category notification preference (snake_case).\n */\nexport interface MobileServerNotificationCategoryPreference {\n category: MobileNotificationCategory;\n enabled: boolean;\n scopes: MobileServerNotificationPreferenceScope[];\n}\n\n/**\n * Server-side notification preferences shape (snake_case), used in both the `update_preferences`
|
|
1
|
+
{"version":3,"file":"serverModelTypes.cjs","names":[],"sources":["../../src/types/serverModelTypes.ts"],"sourcesContent":["import { BalanceSide } from '@nadohq/shared';\nimport { Hex } from 'viem';\n\n/**\n * Platform of a device registered for push notifications.\n */\nexport type MobileNotificationPlatform = 'ios' | 'android';\n\n/**\n * Category of push notification.\n */\nexport type MobileNotificationCategory =\n | 'order_fill'\n | 'order_update'\n | 'liquidation'\n | 'funding'\n | 'product_listing'\n | 'announcement';\n\n/**\n * Server-side public profile shape (snake_case). Name fields are `null` until the subaccount claims a\n * username.\n */\nexport interface MobileServerProfile {\n subaccount: Hex;\n username: string | null;\n display_name: string | null;\n private_mode: boolean;\n}\n\n/**\n * Server-side identity shape (snake_case) returned by the signed `self_identity` query. Name fields are\n * `null` until the subaccount claims a username.\n */\nexport interface MobileServerIdentity {\n subaccount: Hex;\n username: string | null;\n display_name: string | null;\n private_mode: boolean;\n}\n\n/**\n * Direction of the position a feed trade resulted in — for `closed`, the direction that was closed. This is\n * NOT the execution buy/sell side, which the feed does not expose. Aliases {@link BalanceSide} so the feed's\n * direction values stay in lockstep with the rest of the SDK.\n */\nexport type MobileFeedTradePositionDirection = BalanceSide;\n\n/**\n * Every {@link MobileFeedTradePositionDirection} the feed can report, for callers that need the values at\n * runtime (validation, filters, UI enumeration).\n */\nexport const MOBILE_FEED_TRADE_POSITION_DIRECTIONS = [\n 'long',\n 'short',\n] as const satisfies readonly MobileFeedTradePositionDirection[];\n\n/**\n * Every {@link MobileFeedTradePositionEffect} the feed can report, for callers that need the values at\n * runtime (validation, filters, UI enumeration).\n */\nexport const MOBILE_FEED_TRADE_POSITION_EFFECTS = [\n 'opened',\n 'increased',\n 'reduced',\n 'closed',\n 'flipped',\n] as const;\n\n/**\n * How a feed trade changed the trader's position in the product.\n */\nexport type MobileFeedTradePositionEffect =\n (typeof MOBILE_FEED_TRADE_POSITION_EFFECTS)[number];\n\n/**\n * Position change of a feed trade. Both keys are single words, so the wire and client shapes are identical\n * and this type is shared by {@link MobileServerFeedTrade} and the client-side `MobileFeedTrade`.\n */\nexport interface MobileFeedTradePosition {\n direction: MobileFeedTradePositionDirection;\n effect: MobileFeedTradePositionEffect;\n}\n\n/**\n * Every {@link MobileFeedMarginMode} the feed can report, for callers that need the values at runtime\n * (validation, filters, UI enumeration).\n */\nexport const MOBILE_FEED_MARGIN_MODES = ['cross', 'isolated'] as const;\n\n/**\n * Margin mode a feed trade was executed under. Shared by the wire and client margin shapes.\n */\nexport type MobileFeedMarginMode = (typeof MOBILE_FEED_MARGIN_MODES)[number];\n\n/**\n * Server-side margin of a feed trade. Branch on `mode` — do not infer isolated state from leverage presence:\n * `estimated_leverage` (a rounded whole-number estimate, not exact submitted leverage) is omitted on `cross`,\n * and also omitted inside `isolated` when no estimate is available.\n */\nexport interface MobileServerFeedMargin {\n mode: MobileFeedMarginMode;\n estimated_leverage?: number;\n}\n\n/**\n * Server-side feed trade shape (snake_case): one row per order digest, enriched at read time with the\n * trader's current identity. Amounts are display-oriented human-unit JSON numbers — do not use them for\n * accounting, order construction, or exact threshold decisions.\n */\nexport interface MobileServerFeedTrade {\n /** Order digest this row is keyed by; the stable id clients use to reconcile live pagination. */\n order_digest: Hex;\n subaccount: Hex;\n username: string | null;\n display_name: string | null;\n /** Reserved for a future avatar source; `null` until one is implemented. */\n avatar_url: string | null;\n product_id: number;\n /** Executed quantity in human units. */\n quantity: number;\n /** Trade notional in whole-dollar human units. */\n notional: number;\n /** Average execution price in human units. */\n average_price: number;\n margin: MobileServerFeedMargin;\n position: MobileFeedTradePosition;\n /** Realized PnL of the trade in human units; can be negative. */\n realized_pnl: number;\n /** Fill time as JavaScript-safe integer Unix milliseconds. */\n filled_at_ms: number;\n}\n\n/**\n * Server-side scope limiting a notification category preference. Scopes are rejected by the backend for the\n * MVP (`scopes` must be empty) but are part of the wire format.\n */\nexport type MobileServerNotificationPreferenceScope =\n | { type: 'subaccount'; subaccount: Hex }\n | { type: 'product'; product_id: number };\n\n/**\n * Server-side per-category notification preference (snake_case).\n */\nexport interface MobileServerNotificationCategoryPreference {\n category: MobileNotificationCategory;\n enabled: boolean;\n scopes: MobileServerNotificationPreferenceScope[];\n}\n\n/**\n * Server-side notification preferences shape (snake_case), used in both the `update_preferences` public\n * execute and the `notification_preferences` public query response.\n */\nexport interface MobileServerNotificationPreferences {\n /** Only `1` is accepted by the backend for the MVP. */\n schema_version: 1;\n categories: MobileServerNotificationCategoryPreference[];\n}\n\n/**\n * Server-side registered push device shape (snake_case).\n */\nexport interface MobileServerRegisteredDevice {\n platform: MobileNotificationPlatform;\n locale: string | null;\n app_version: string | null;\n token_fingerprint_prefix: string;\n last_seen_at: number;\n}\n"],"mappings":";;;;;;AAoDA,MAAa,wCAAwC,CACnD,QACA,OACF;;;;;AAMA,MAAa,qCAAqC;CAChD;CACA;CACA;CACA;CACA;AACF;;;;;AAqBA,MAAa,2BAA2B,CAAC,SAAS,UAAU"}
|
|
@@ -1,2 +1,2 @@
|
|
|
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-
|
|
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
2
|
export { MOBILE_FEED_MARGIN_MODES, MOBILE_FEED_TRADE_POSITION_DIRECTIONS, MOBILE_FEED_TRADE_POSITION_EFFECTS, MobileFeedMarginMode, MobileFeedTradePosition, MobileFeedTradePositionDirection, MobileFeedTradePositionEffect, MobileNotificationCategory, MobileNotificationPlatform, MobileServerFeedMargin, MobileServerFeedTrade, MobileServerIdentity, MobileServerNotificationCategoryPreference, MobileServerNotificationPreferenceScope, MobileServerNotificationPreferences, MobileServerProfile, MobileServerRegisteredDevice };
|
|
@@ -1,2 +1,2 @@
|
|
|
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-
|
|
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
2
|
export { MOBILE_FEED_MARGIN_MODES, MOBILE_FEED_TRADE_POSITION_DIRECTIONS, MOBILE_FEED_TRADE_POSITION_EFFECTS, MobileFeedMarginMode, MobileFeedTradePosition, MobileFeedTradePositionDirection, MobileFeedTradePositionEffect, MobileNotificationCategory, MobileNotificationPlatform, MobileServerFeedMargin, MobileServerFeedTrade, MobileServerIdentity, MobileServerNotificationCategoryPreference, MobileServerNotificationPreferenceScope, MobileServerNotificationPreferences, MobileServerProfile, MobileServerRegisteredDevice };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverModelTypes.js","names":[],"sources":["../../src/types/serverModelTypes.ts"],"sourcesContent":["import { BalanceSide } from '@nadohq/shared';\nimport { Hex } from 'viem';\n\n/**\n * Platform of a device registered for push notifications.\n */\nexport type MobileNotificationPlatform = 'ios' | 'android';\n\n/**\n * Category of push notification.\n */\nexport type MobileNotificationCategory =\n | 'order_fill'\n | 'order_update'\n | 'liquidation'\n | 'funding'\n | 'product_listing'\n | 'announcement';\n\n/**\n * Server-side public profile shape (snake_case).\n */\nexport interface MobileServerProfile {\n subaccount: Hex;\n username: string;\n display_name: string;\n}\n\n/**\n * Server-side identity shape (snake_case) returned by the signed `self_identity` query.\n */\nexport interface MobileServerIdentity {\n subaccount: Hex;\n username: string;\n display_name: string;\n private_mode: boolean;\n}\n\n/**\n * Direction of the position a feed trade resulted in — for `closed`, the direction that was closed. This is\n * NOT the execution buy/sell side, which the feed does not expose. Aliases {@link BalanceSide} so the feed's\n * direction values stay in lockstep with the rest of the SDK.\n */\nexport type MobileFeedTradePositionDirection = BalanceSide;\n\n/**\n * Every {@link MobileFeedTradePositionDirection} the feed can report, for callers that need the values at\n * runtime (validation, filters, UI enumeration).\n */\nexport const MOBILE_FEED_TRADE_POSITION_DIRECTIONS = [\n 'long',\n 'short',\n] as const satisfies readonly MobileFeedTradePositionDirection[];\n\n/**\n * Every {@link MobileFeedTradePositionEffect} the feed can report, for callers that need the values at\n * runtime (validation, filters, UI enumeration).\n */\nexport const MOBILE_FEED_TRADE_POSITION_EFFECTS = [\n 'opened',\n 'increased',\n 'reduced',\n 'closed',\n 'flipped',\n] as const;\n\n/**\n * How a feed trade changed the trader's position in the product.\n */\nexport type MobileFeedTradePositionEffect =\n (typeof MOBILE_FEED_TRADE_POSITION_EFFECTS)[number];\n\n/**\n * Position change of a feed trade. Both keys are single words, so the wire and client shapes are identical\n * and this type is shared by {@link MobileServerFeedTrade} and the client-side `MobileFeedTrade`.\n */\nexport interface MobileFeedTradePosition {\n direction: MobileFeedTradePositionDirection;\n effect: MobileFeedTradePositionEffect;\n}\n\n/**\n * Every {@link MobileFeedMarginMode} the feed can report, for callers that need the values at runtime\n * (validation, filters, UI enumeration).\n */\nexport const MOBILE_FEED_MARGIN_MODES = ['cross', 'isolated'] as const;\n\n/**\n * Margin mode a feed trade was executed under. Shared by the wire and client margin shapes.\n */\nexport type MobileFeedMarginMode = (typeof MOBILE_FEED_MARGIN_MODES)[number];\n\n/**\n * Server-side margin of a feed trade. Branch on `mode` — do not infer isolated state from leverage presence:\n * `estimated_leverage` (a rounded whole-number estimate, not exact submitted leverage) is omitted on `cross`,\n * and also omitted inside `isolated` when no estimate is available.\n */\nexport interface MobileServerFeedMargin {\n mode: MobileFeedMarginMode;\n estimated_leverage?: number;\n}\n\n/**\n * Server-side feed trade shape (snake_case): one row per order digest, enriched at read time with the\n * trader's current identity. Amounts are display-oriented human-unit JSON numbers — do not use them for\n * accounting, order construction, or exact threshold decisions.\n */\nexport interface MobileServerFeedTrade {\n /** Order digest this row is keyed by; the stable id clients use to reconcile live pagination. */\n order_digest: Hex;\n subaccount: Hex;\n username: string;\n display_name: string;\n /** Reserved for a future avatar source; `null` until one is implemented. */\n avatar_url: string | null;\n product_id: number;\n /** Executed quantity in human units. */\n quantity: number;\n /** Trade notional in whole-dollar human units. */\n notional: number;\n /** Average execution price in human units. */\n average_price: number;\n margin: MobileServerFeedMargin;\n position: MobileFeedTradePosition;\n /** Realized PnL of the trade in human units; can be negative. */\n realized_pnl: number;\n /** Fill time as JavaScript-safe integer Unix milliseconds. */\n filled_at_ms: number;\n}\n\n/**\n * Server-side scope limiting a notification category preference. Scopes are rejected by the backend for the\n * MVP (`scopes` must be empty) but are part of the wire format.\n */\nexport type MobileServerNotificationPreferenceScope =\n | { type: 'subaccount'; subaccount: Hex }\n | { type: 'product'; product_id: number };\n\n/**\n * Server-side per-category notification preference (snake_case).\n */\nexport interface MobileServerNotificationCategoryPreference {\n category: MobileNotificationCategory;\n enabled: boolean;\n scopes: MobileServerNotificationPreferenceScope[];\n}\n\n/**\n * Server-side notification preferences shape (snake_case), used in both the `update_preferences`
|
|
1
|
+
{"version":3,"file":"serverModelTypes.js","names":[],"sources":["../../src/types/serverModelTypes.ts"],"sourcesContent":["import { BalanceSide } from '@nadohq/shared';\nimport { Hex } from 'viem';\n\n/**\n * Platform of a device registered for push notifications.\n */\nexport type MobileNotificationPlatform = 'ios' | 'android';\n\n/**\n * Category of push notification.\n */\nexport type MobileNotificationCategory =\n | 'order_fill'\n | 'order_update'\n | 'liquidation'\n | 'funding'\n | 'product_listing'\n | 'announcement';\n\n/**\n * Server-side public profile shape (snake_case). Name fields are `null` until the subaccount claims a\n * username.\n */\nexport interface MobileServerProfile {\n subaccount: Hex;\n username: string | null;\n display_name: string | null;\n private_mode: boolean;\n}\n\n/**\n * Server-side identity shape (snake_case) returned by the signed `self_identity` query. Name fields are\n * `null` until the subaccount claims a username.\n */\nexport interface MobileServerIdentity {\n subaccount: Hex;\n username: string | null;\n display_name: string | null;\n private_mode: boolean;\n}\n\n/**\n * Direction of the position a feed trade resulted in — for `closed`, the direction that was closed. This is\n * NOT the execution buy/sell side, which the feed does not expose. Aliases {@link BalanceSide} so the feed's\n * direction values stay in lockstep with the rest of the SDK.\n */\nexport type MobileFeedTradePositionDirection = BalanceSide;\n\n/**\n * Every {@link MobileFeedTradePositionDirection} the feed can report, for callers that need the values at\n * runtime (validation, filters, UI enumeration).\n */\nexport const MOBILE_FEED_TRADE_POSITION_DIRECTIONS = [\n 'long',\n 'short',\n] as const satisfies readonly MobileFeedTradePositionDirection[];\n\n/**\n * Every {@link MobileFeedTradePositionEffect} the feed can report, for callers that need the values at\n * runtime (validation, filters, UI enumeration).\n */\nexport const MOBILE_FEED_TRADE_POSITION_EFFECTS = [\n 'opened',\n 'increased',\n 'reduced',\n 'closed',\n 'flipped',\n] as const;\n\n/**\n * How a feed trade changed the trader's position in the product.\n */\nexport type MobileFeedTradePositionEffect =\n (typeof MOBILE_FEED_TRADE_POSITION_EFFECTS)[number];\n\n/**\n * Position change of a feed trade. Both keys are single words, so the wire and client shapes are identical\n * and this type is shared by {@link MobileServerFeedTrade} and the client-side `MobileFeedTrade`.\n */\nexport interface MobileFeedTradePosition {\n direction: MobileFeedTradePositionDirection;\n effect: MobileFeedTradePositionEffect;\n}\n\n/**\n * Every {@link MobileFeedMarginMode} the feed can report, for callers that need the values at runtime\n * (validation, filters, UI enumeration).\n */\nexport const MOBILE_FEED_MARGIN_MODES = ['cross', 'isolated'] as const;\n\n/**\n * Margin mode a feed trade was executed under. Shared by the wire and client margin shapes.\n */\nexport type MobileFeedMarginMode = (typeof MOBILE_FEED_MARGIN_MODES)[number];\n\n/**\n * Server-side margin of a feed trade. Branch on `mode` — do not infer isolated state from leverage presence:\n * `estimated_leverage` (a rounded whole-number estimate, not exact submitted leverage) is omitted on `cross`,\n * and also omitted inside `isolated` when no estimate is available.\n */\nexport interface MobileServerFeedMargin {\n mode: MobileFeedMarginMode;\n estimated_leverage?: number;\n}\n\n/**\n * Server-side feed trade shape (snake_case): one row per order digest, enriched at read time with the\n * trader's current identity. Amounts are display-oriented human-unit JSON numbers — do not use them for\n * accounting, order construction, or exact threshold decisions.\n */\nexport interface MobileServerFeedTrade {\n /** Order digest this row is keyed by; the stable id clients use to reconcile live pagination. */\n order_digest: Hex;\n subaccount: Hex;\n username: string | null;\n display_name: string | null;\n /** Reserved for a future avatar source; `null` until one is implemented. */\n avatar_url: string | null;\n product_id: number;\n /** Executed quantity in human units. */\n quantity: number;\n /** Trade notional in whole-dollar human units. */\n notional: number;\n /** Average execution price in human units. */\n average_price: number;\n margin: MobileServerFeedMargin;\n position: MobileFeedTradePosition;\n /** Realized PnL of the trade in human units; can be negative. */\n realized_pnl: number;\n /** Fill time as JavaScript-safe integer Unix milliseconds. */\n filled_at_ms: number;\n}\n\n/**\n * Server-side scope limiting a notification category preference. Scopes are rejected by the backend for the\n * MVP (`scopes` must be empty) but are part of the wire format.\n */\nexport type MobileServerNotificationPreferenceScope =\n | { type: 'subaccount'; subaccount: Hex }\n | { type: 'product'; product_id: number };\n\n/**\n * Server-side per-category notification preference (snake_case).\n */\nexport interface MobileServerNotificationCategoryPreference {\n category: MobileNotificationCategory;\n enabled: boolean;\n scopes: MobileServerNotificationPreferenceScope[];\n}\n\n/**\n * Server-side notification preferences shape (snake_case), used in both the `update_preferences` public\n * execute and the `notification_preferences` public query response.\n */\nexport interface MobileServerNotificationPreferences {\n /** Only `1` is accepted by the backend for the MVP. */\n schema_version: 1;\n categories: MobileServerNotificationCategoryPreference[];\n}\n\n/**\n * Server-side registered push device shape (snake_case).\n */\nexport interface MobileServerRegisteredDevice {\n platform: MobileNotificationPlatform;\n locale: string | null;\n app_version: string | null;\n token_fingerprint_prefix: string;\n last_seen_at: number;\n}\n"],"mappings":";;;;;AAoDA,MAAa,wCAAwC,CACnD,QACA,OACF;;;;;AAMA,MAAa,qCAAqC;CAChD;CACA;CACA;CACA;CACA;AACF;;;;;AAqBA,MAAa,2BAA2B,CAAC,SAAS,UAAU"}
|