@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
|
@@ -19,46 +19,30 @@ const FIXED_PRIVATE_KEY =
|
|
|
19
19
|
'0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b786907' as const;
|
|
20
20
|
const FIXED_VERIFYING_ADDR = '0x0000000000000000000000000000000000000001';
|
|
21
21
|
|
|
22
|
+
// `set_username`, `set_private_mode`, and `register_expo_token` mirror the backend's pinned fixtures in
|
|
23
|
+
// mobile/src/api/types.rs, so a divergence here is a real wire-format break rather than a stale expectation.
|
|
22
24
|
const PINNED_HASHES = {
|
|
23
|
-
|
|
24
|
-
'
|
|
25
|
-
update_username:
|
|
26
|
-
'0x92c3831d30de8206f9ee9d4cf29ed2a2fb1612a3b818e2e46121fc1d5eb4edb6',
|
|
25
|
+
set_username:
|
|
26
|
+
'0xb4a55d9eb0be4e5c9457761c0c34c75cf39f7c07bd170700d8dd5e9c7de4a659',
|
|
27
27
|
set_private_mode:
|
|
28
28
|
'0x4d12a06234d751e6ddcc01d8f70836bb5b7e207e573641d1efb5aaf2b0f30d10',
|
|
29
29
|
self_identity:
|
|
30
30
|
'0x10e94c4502cade0a0b4d7469717bcc1d266fc6a3b7635236fa1d3600b58c9954',
|
|
31
|
-
// The three execute hashes below mirror the backend's pinned fixtures in mobile/src/api/types.rs.
|
|
32
31
|
register_expo_token:
|
|
33
32
|
'0x1b9471afc9bde66f9bffd576d3326420e1bade4e16afa3a73ddc65f27155611c',
|
|
34
|
-
unregister_expo_token:
|
|
35
|
-
'0xd131071d0898c97496f3d41dfc05f30a5f82c95e550944c4fba47419ddd0ebf3',
|
|
36
|
-
update_preferences:
|
|
37
|
-
'0x071b8ac6f3d2518267dd238c8c96e15e07e0552aede3ba32383706bb05726f83',
|
|
38
|
-
notification_preferences:
|
|
39
|
-
'0x3694dda0e5732b36eb3b60da6b147ec4e35520fc54529610c69d19d722d4fe97',
|
|
40
33
|
registered_devices:
|
|
41
34
|
'0xe77b42e32d27f054f86d5ed52c9aac7b3eed857eb6209ee883c92f01b84d3334',
|
|
42
35
|
} as const;
|
|
43
36
|
|
|
44
37
|
describe('[mobile-client]: signing (offline)', () => {
|
|
45
38
|
describe('pinned payload hashes', () => {
|
|
46
|
-
it('
|
|
39
|
+
it('set_username', () => {
|
|
47
40
|
const inner: MobileSignedInner = {
|
|
48
|
-
type: '
|
|
41
|
+
type: 'set_username',
|
|
49
42
|
display_name: 'Alice.One',
|
|
50
43
|
};
|
|
51
44
|
const hash = getMobilePayloadHash(canonicalizeMobileInner(inner));
|
|
52
|
-
expect(hash).toBe(PINNED_HASHES.
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('update_username', () => {
|
|
56
|
-
const inner: MobileSignedInner = {
|
|
57
|
-
type: 'update_username',
|
|
58
|
-
display_name: 'Alice.Two',
|
|
59
|
-
};
|
|
60
|
-
const hash = getMobilePayloadHash(canonicalizeMobileInner(inner));
|
|
61
|
-
expect(hash).toBe(PINNED_HASHES.update_username);
|
|
45
|
+
expect(hash).toBe(PINNED_HASHES.set_username);
|
|
62
46
|
});
|
|
63
47
|
|
|
64
48
|
it('set_private_mode', () => {
|
|
@@ -88,33 +72,6 @@ describe('[mobile-client]: signing (offline)', () => {
|
|
|
88
72
|
expect(hash).toBe(PINNED_HASHES.register_expo_token);
|
|
89
73
|
});
|
|
90
74
|
|
|
91
|
-
it('unregister_expo_token', () => {
|
|
92
|
-
const inner: MobileSignedInner = {
|
|
93
|
-
type: 'unregister_expo_token',
|
|
94
|
-
expo_token: 'ExponentPushToken[abcdef1234567890abcdef]',
|
|
95
|
-
};
|
|
96
|
-
const hash = getMobilePayloadHash(canonicalizeMobileInner(inner));
|
|
97
|
-
expect(hash).toBe(PINNED_HASHES.unregister_expo_token);
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it('update_preferences', () => {
|
|
101
|
-
const inner: MobileSignedInner = {
|
|
102
|
-
type: 'update_preferences',
|
|
103
|
-
preferences: {
|
|
104
|
-
schema_version: 1,
|
|
105
|
-
categories: [{ category: 'order_fill', enabled: true, scopes: [] }],
|
|
106
|
-
},
|
|
107
|
-
};
|
|
108
|
-
const hash = getMobilePayloadHash(canonicalizeMobileInner(inner));
|
|
109
|
-
expect(hash).toBe(PINNED_HASHES.update_preferences);
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
it('notification_preferences', () => {
|
|
113
|
-
const inner: MobileSignedInner = { type: 'notification_preferences' };
|
|
114
|
-
const hash = getMobilePayloadHash(canonicalizeMobileInner(inner));
|
|
115
|
-
expect(hash).toBe(PINNED_HASHES.notification_preferences);
|
|
116
|
-
});
|
|
117
|
-
|
|
118
75
|
it('registered_devices', () => {
|
|
119
76
|
const inner: MobileSignedInner = { type: 'registered_devices' };
|
|
120
77
|
const hash = getMobilePayloadHash(canonicalizeMobileInner(inner));
|
|
@@ -134,19 +91,19 @@ describe('[mobile-client]: signing (offline)', () => {
|
|
|
134
91
|
expect(hash).toBe(PINNED_HASHES.set_private_mode);
|
|
135
92
|
});
|
|
136
93
|
|
|
137
|
-
it('canonicalizes
|
|
138
|
-
//
|
|
139
|
-
//
|
|
94
|
+
it('canonicalizes multi-field key order regardless of input key order', () => {
|
|
95
|
+
// register_expo_token is the only signed payload with more than one field, so it is where a caller can
|
|
96
|
+
// actually get the order wrong; canonicalizeMobileInner must rebuild it in the backend's declaration order.
|
|
140
97
|
const outOfOrderInner = {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
type: '
|
|
146
|
-
} as
|
|
98
|
+
app_version: '1.2.3',
|
|
99
|
+
locale: 'en-GB',
|
|
100
|
+
platform: 'ios',
|
|
101
|
+
expo_token: 'ExponentPushToken[abcdef1234567890abcdef]',
|
|
102
|
+
type: 'register_expo_token',
|
|
103
|
+
} as MobileSignedInner;
|
|
147
104
|
|
|
148
105
|
const hash = getMobilePayloadHash(canonicalizeMobileInner(outOfOrderInner));
|
|
149
|
-
expect(hash).toBe(PINNED_HASHES.
|
|
106
|
+
expect(hash).toBe(PINNED_HASHES.register_expo_token);
|
|
150
107
|
});
|
|
151
108
|
|
|
152
109
|
describe('nonce generation', () => {
|
package/src/signing/types.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { WalletClientWithAccount } from '@nadohq/shared';
|
|
2
2
|
import { Hex } from 'viem';
|
|
3
3
|
import { MobileSignedRequestParams } from '../types/clientTypes';
|
|
4
|
-
import {
|
|
5
|
-
MobileNotificationPlatform,
|
|
6
|
-
MobileServerNotificationPreferences,
|
|
7
|
-
} from '../types/serverModelTypes';
|
|
4
|
+
import { MobileNotificationPlatform } from '../types/serverModelTypes';
|
|
8
5
|
|
|
9
6
|
/**
|
|
10
7
|
* Unsigned inner payloads that can be authenticated against the mobile service API.
|
|
@@ -16,8 +13,7 @@ import {
|
|
|
16
13
|
* {@link canonicalizeMobileInner}, which is the source of truth. Keep the field order here in sync with it.
|
|
17
14
|
*/
|
|
18
15
|
export type MobileSignedInner =
|
|
19
|
-
| { type: '
|
|
20
|
-
| { type: 'update_username'; display_name: string }
|
|
16
|
+
| { type: 'set_username'; display_name: string }
|
|
21
17
|
| { type: 'set_private_mode'; private_mode: boolean }
|
|
22
18
|
| { type: 'self_identity' }
|
|
23
19
|
| {
|
|
@@ -29,12 +25,6 @@ export type MobileSignedInner =
|
|
|
29
25
|
locale: string | null;
|
|
30
26
|
app_version: string | null;
|
|
31
27
|
}
|
|
32
|
-
| { type: 'unregister_expo_token'; expo_token: string }
|
|
33
|
-
| {
|
|
34
|
-
type: 'update_preferences';
|
|
35
|
-
preferences: MobileServerNotificationPreferences;
|
|
36
|
-
}
|
|
37
|
-
| { type: 'notification_preferences' }
|
|
38
28
|
| { type: 'registered_devices' };
|
|
39
29
|
|
|
40
30
|
/**
|
package/src/types/clientTypes.ts
CHANGED
|
@@ -8,34 +8,40 @@ import {
|
|
|
8
8
|
} from './serverModelTypes';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* A subaccount's
|
|
11
|
+
* A subaccount's identity on the mobile service API. Every non-isolated subaccount has one implicitly, so
|
|
12
|
+
* both name fields are `null` until a username is claimed — render a local fallback label in that case and
|
|
13
|
+
* key lookups, links, and caches off `subaccount`.
|
|
12
14
|
*
|
|
13
15
|
* `username` and `displayName` are two representations of the same claimed name: `displayName` is what the
|
|
14
16
|
* user entered (preserving casing, e.g. `Alice.One`), while `username` is the canonical, lowercased handle
|
|
15
|
-
* derived from it (e.g. `alice.one`)
|
|
16
|
-
* ({@link MobilePublicProfile}); `displayName` is only for presentation.
|
|
17
|
+
* derived from it (e.g. `alice.one`), unique across identities.
|
|
17
18
|
*/
|
|
18
19
|
export interface MobileIdentity {
|
|
19
20
|
subaccount: Hex;
|
|
20
21
|
/**
|
|
21
|
-
* Canonical, lowercased handle derived from {@link MobileIdentity.displayName}, unique
|
|
22
|
-
*
|
|
22
|
+
* Canonical, lowercased handle derived from {@link MobileIdentity.displayName}, unique across identities,
|
|
23
|
+
* or `null` if no username has been claimed.
|
|
23
24
|
*/
|
|
24
|
-
username: string;
|
|
25
|
+
username: string | null;
|
|
25
26
|
/**
|
|
26
|
-
* User-facing name as claimed, preserving original casing
|
|
27
|
+
* User-facing name as claimed, preserving original casing, or `null` if no username has been claimed.
|
|
28
|
+
* Validated against `MOBILE_DISPLAY_NAME_PATTERN`.
|
|
27
29
|
*/
|
|
28
|
-
displayName: string;
|
|
30
|
+
displayName: string | null;
|
|
29
31
|
privateMode: boolean;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
/**
|
|
33
|
-
* A subaccount's public profile, as returned by an unsigned profile lookup.
|
|
35
|
+
* A subaccount's public profile, as returned by an unsigned profile lookup. Private Mode hides the account's
|
|
36
|
+
* activity, not its profile, so `privateMode` is exposed here too.
|
|
34
37
|
*/
|
|
35
38
|
export interface MobilePublicProfile {
|
|
36
39
|
subaccount: Hex;
|
|
37
|
-
username
|
|
38
|
-
|
|
40
|
+
/** Canonical, lowercased handle, or `null` if no username has been claimed. */
|
|
41
|
+
username: string | null;
|
|
42
|
+
/** User-facing name as claimed, or `null` if no username has been claimed. */
|
|
43
|
+
displayName: string | null;
|
|
44
|
+
privateMode: boolean;
|
|
39
45
|
}
|
|
40
46
|
|
|
41
47
|
/**
|
|
@@ -65,8 +71,10 @@ export interface MobileFeedTrade {
|
|
|
65
71
|
/** Order digest this trade is keyed by; the stable id for reconciling live pagination. */
|
|
66
72
|
orderDigest: Hex;
|
|
67
73
|
subaccount: Hex;
|
|
68
|
-
username
|
|
69
|
-
|
|
74
|
+
/** `null` when the trader has not claimed a username; render a local fallback label from `subaccount`. */
|
|
75
|
+
username: string | null;
|
|
76
|
+
/** `null` when the trader has not claimed a username; render a local fallback label from `subaccount`. */
|
|
77
|
+
displayName: string | null;
|
|
70
78
|
/** Reserved for a future avatar source; `null` until one is implemented. */
|
|
71
79
|
avatarUrl: string | null;
|
|
72
80
|
productId: number;
|
|
@@ -150,6 +158,16 @@ export interface MobileRegisteredDevice {
|
|
|
150
158
|
export interface MobileSignedRequestParams
|
|
151
159
|
extends Subaccount, SignatureParams {}
|
|
152
160
|
|
|
161
|
+
/**
|
|
162
|
+
* Common params for the unsigned notification requests, which name their target with an Expo push token
|
|
163
|
+
* instead of a subaccount and signature — the counterpart to {@link MobileSignedRequestParams}. The backend
|
|
164
|
+
* resolves the token's owning wallet and reads or mutates that wallet's state.
|
|
165
|
+
*/
|
|
166
|
+
export interface MobileWithExpoTokenParams {
|
|
167
|
+
/** Expo push token, e.g. `ExponentPushToken[...]`. */
|
|
168
|
+
expoToken: string;
|
|
169
|
+
}
|
|
170
|
+
|
|
153
171
|
/**
|
|
154
172
|
* Params for {@link MobileClient.getUsernameAvailability}.
|
|
155
173
|
*/
|
|
@@ -160,9 +178,7 @@ export interface GetMobileUsernameAvailabilityParams {
|
|
|
160
178
|
/**
|
|
161
179
|
* Params for {@link MobileClient.getPublicProfile}.
|
|
162
180
|
*/
|
|
163
|
-
export
|
|
164
|
-
username: string;
|
|
165
|
-
}
|
|
181
|
+
export type GetMobilePublicProfileParams = Subaccount;
|
|
166
182
|
|
|
167
183
|
/**
|
|
168
184
|
* Params for {@link MobileClient.getFeed}.
|
|
@@ -188,16 +204,10 @@ export interface GetMobileFeedParams {
|
|
|
188
204
|
export type GetMobileSelfIdentityParams = MobileSignedRequestParams;
|
|
189
205
|
|
|
190
206
|
/**
|
|
191
|
-
* Params for {@link MobileClient.
|
|
192
|
-
*/
|
|
193
|
-
export interface MobileClaimUsernameParams extends MobileSignedRequestParams {
|
|
194
|
-
displayName: string;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Params for {@link MobileClient.updateUsername}.
|
|
207
|
+
* Params for {@link MobileClient.setUsername}.
|
|
199
208
|
*/
|
|
200
|
-
export interface
|
|
209
|
+
export interface MobileSetUsernameParams extends MobileSignedRequestParams {
|
|
210
|
+
/** User-facing name to claim, preserving casing. Must match `MOBILE_DISPLAY_NAME_PATTERN`. */
|
|
201
211
|
displayName: string;
|
|
202
212
|
}
|
|
203
213
|
|
|
@@ -230,21 +240,19 @@ export interface MobileRegisterExpoTokenParams extends MobileSignedRequestParams
|
|
|
230
240
|
/**
|
|
231
241
|
* Params for {@link MobileClient.unregisterExpoToken}.
|
|
232
242
|
*/
|
|
233
|
-
export
|
|
234
|
-
expoToken: string;
|
|
235
|
-
}
|
|
243
|
+
export type MobileUnregisterExpoTokenParams = MobileWithExpoTokenParams;
|
|
236
244
|
|
|
237
245
|
/**
|
|
238
246
|
* Params for {@link MobileClient.updateNotificationPreferences}.
|
|
239
247
|
*/
|
|
240
|
-
export interface MobileUpdateNotificationPreferencesParams extends
|
|
248
|
+
export interface MobileUpdateNotificationPreferencesParams extends MobileWithExpoTokenParams {
|
|
241
249
|
preferences: MobileNotificationPreferences;
|
|
242
250
|
}
|
|
243
251
|
|
|
244
252
|
/**
|
|
245
253
|
* Params for {@link MobileClient.getNotificationPreferences}.
|
|
246
254
|
*/
|
|
247
|
-
export type GetMobileNotificationPreferencesParams =
|
|
255
|
+
export type GetMobileNotificationPreferencesParams = MobileWithExpoTokenParams;
|
|
248
256
|
|
|
249
257
|
/**
|
|
250
258
|
* Params for {@link MobileClient.getRegisteredDevices}.
|
|
@@ -9,9 +9,8 @@ export 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,
|
|
@@ -2,6 +2,23 @@ import {
|
|
|
2
2
|
MobileServerFailureResponse,
|
|
3
3
|
MobileServerSuccessResponse,
|
|
4
4
|
} from './serverBaseTypes';
|
|
5
|
+
import {
|
|
6
|
+
MobileServerPublicExecuteRequestByType,
|
|
7
|
+
MobileServerPublicExecuteRequestType,
|
|
8
|
+
} from './serverRequestTypes';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Unsigned `public_execute` request body: a `type` discriminant flattened with its params, mirroring
|
|
12
|
+
* {@link MobileServerPublicQueryRequest}.
|
|
13
|
+
*/
|
|
14
|
+
export type MobileServerPublicExecuteRequest<
|
|
15
|
+
T extends MobileServerPublicExecuteRequestType =
|
|
16
|
+
MobileServerPublicExecuteRequestType,
|
|
17
|
+
> = {
|
|
18
|
+
[K in MobileServerPublicExecuteRequestType]: {
|
|
19
|
+
type: K;
|
|
20
|
+
} & MobileServerPublicExecuteRequestByType[K];
|
|
21
|
+
}[T];
|
|
5
22
|
|
|
6
23
|
/**
|
|
7
24
|
* Discriminated `execute` result union. Mobile execute routes return no payload beyond the success
|
|
@@ -18,21 +18,24 @@ export type MobileNotificationCategory =
|
|
|
18
18
|
| 'announcement';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* Server-side public profile shape (snake_case).
|
|
21
|
+
* Server-side public profile shape (snake_case). Name fields are `null` until the subaccount claims a
|
|
22
|
+
* username.
|
|
22
23
|
*/
|
|
23
24
|
export interface MobileServerProfile {
|
|
24
25
|
subaccount: Hex;
|
|
25
|
-
username: string;
|
|
26
|
-
display_name: string;
|
|
26
|
+
username: string | null;
|
|
27
|
+
display_name: string | null;
|
|
28
|
+
private_mode: boolean;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
/**
|
|
30
|
-
* Server-side identity shape (snake_case) returned by the signed `self_identity` query.
|
|
32
|
+
* Server-side identity shape (snake_case) returned by the signed `self_identity` query. Name fields are
|
|
33
|
+
* `null` until the subaccount claims a username.
|
|
31
34
|
*/
|
|
32
35
|
export interface MobileServerIdentity {
|
|
33
36
|
subaccount: Hex;
|
|
34
|
-
username: string;
|
|
35
|
-
display_name: string;
|
|
37
|
+
username: string | null;
|
|
38
|
+
display_name: string | null;
|
|
36
39
|
private_mode: boolean;
|
|
37
40
|
}
|
|
38
41
|
|
|
@@ -109,8 +112,8 @@ export interface MobileServerFeedTrade {
|
|
|
109
112
|
/** Order digest this row is keyed by; the stable id clients use to reconcile live pagination. */
|
|
110
113
|
order_digest: Hex;
|
|
111
114
|
subaccount: Hex;
|
|
112
|
-
username: string;
|
|
113
|
-
display_name: string;
|
|
115
|
+
username: string | null;
|
|
116
|
+
display_name: string | null;
|
|
114
117
|
/** Reserved for a future avatar source; `null` until one is implemented. */
|
|
115
118
|
avatar_url: string | null;
|
|
116
119
|
product_id: number;
|
|
@@ -146,8 +149,8 @@ export interface MobileServerNotificationCategoryPreference {
|
|
|
146
149
|
}
|
|
147
150
|
|
|
148
151
|
/**
|
|
149
|
-
* Server-side notification preferences shape (snake_case), used in both the `update_preferences`
|
|
150
|
-
* the `notification_preferences` query response.
|
|
152
|
+
* Server-side notification preferences shape (snake_case), used in both the `update_preferences` public
|
|
153
|
+
* execute and the `notification_preferences` public query response.
|
|
151
154
|
*/
|
|
152
155
|
export interface MobileServerNotificationPreferences {
|
|
153
156
|
/** Only `1` is accepted by the backend for the MVP. */
|
|
@@ -53,15 +53,16 @@ export interface MobileServerFeedResponse {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
* Payload of the signed `self_identity` query success response.
|
|
57
|
-
*
|
|
56
|
+
* Payload of the signed `self_identity` query success response. Every non-isolated subaccount has an implicit
|
|
57
|
+
* identity, so the backend returns one for any valid sender, with `null` name fields when no username has
|
|
58
|
+
* been claimed; `identity` stays nullable to match the backend's `Option`.
|
|
58
59
|
*/
|
|
59
60
|
export interface MobileServerSelfIdentityResponse {
|
|
60
61
|
identity: MobileServerIdentity | null;
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
/**
|
|
64
|
-
* Payload of the
|
|
65
|
+
* Payload of the `notification_preferences` public query success response.
|
|
65
66
|
*/
|
|
66
67
|
export interface MobileServerNotificationPreferencesResponse {
|
|
67
68
|
preferences: MobileServerNotificationPreferences;
|
|
@@ -84,6 +85,7 @@ export interface MobileServerPublicQueryResponseByType {
|
|
|
84
85
|
username_availability: MobileServerUsernameAvailabilityResponse;
|
|
85
86
|
profile: MobileServerProfileResponse;
|
|
86
87
|
feed: MobileServerFeedResponse;
|
|
88
|
+
notification_preferences: MobileServerNotificationPreferencesResponse;
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
/**
|
|
@@ -94,7 +96,6 @@ export interface MobileServerPublicQueryResponseByType {
|
|
|
94
96
|
*/
|
|
95
97
|
export interface MobileServerSignedQueryResponseByType {
|
|
96
98
|
self_identity: MobileServerSelfIdentityResponse;
|
|
97
|
-
notification_preferences: MobileServerNotificationPreferencesResponse;
|
|
98
99
|
registered_devices: MobileServerRegisteredDevicesResponse;
|
|
99
100
|
}
|
|
100
101
|
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { Hex } from 'viem';
|
|
1
2
|
import { MobileSignedInner } from '../signing/types';
|
|
3
|
+
import { MobileServerNotificationPreferences } from './serverModelTypes';
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* Params for each unsigned `public_query`, keyed by request `type`.
|
|
5
7
|
*/
|
|
6
8
|
export interface MobileServerPublicQueryRequestByType {
|
|
7
9
|
username_availability: { display_name: string };
|
|
8
|
-
profile: {
|
|
10
|
+
profile: { subaccount: Hex };
|
|
9
11
|
feed: {
|
|
10
12
|
/**
|
|
11
13
|
* Minimum notional as a whole-dollar JSON integer (NOT an x18 string), at least $1,000. Omitted or
|
|
@@ -20,6 +22,7 @@ export interface MobileServerPublicQueryRequestByType {
|
|
|
20
22
|
*/
|
|
21
23
|
cursor?: string;
|
|
22
24
|
};
|
|
25
|
+
notification_preferences: { expo_token: string };
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
/**
|
|
@@ -28,6 +31,26 @@ export interface MobileServerPublicQueryRequestByType {
|
|
|
28
31
|
export type MobileServerPublicQueryRequestType =
|
|
29
32
|
keyof MobileServerPublicQueryRequestByType;
|
|
30
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Params for each unsigned `public_execute`, keyed by request `type`. Possession of an active Expo push token
|
|
36
|
+
* authorizes these notification-only mutations: the backend resolves the token's owning wallet and mutates
|
|
37
|
+
* its state, so no signature, sender, or nonce is sent. Ordering is the backend's last-write-wins commit
|
|
38
|
+
* order, so callers must serialize their own writes.
|
|
39
|
+
*/
|
|
40
|
+
export interface MobileServerPublicExecuteRequestByType {
|
|
41
|
+
unregister_expo_token: { expo_token: string };
|
|
42
|
+
update_preferences: {
|
|
43
|
+
expo_token: string;
|
|
44
|
+
preferences: MobileServerNotificationPreferences;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Discriminant `type` values for unsigned `public_execute` requests.
|
|
50
|
+
*/
|
|
51
|
+
export type MobileServerPublicExecuteRequestType =
|
|
52
|
+
keyof MobileServerPublicExecuteRequestByType;
|
|
53
|
+
|
|
31
54
|
/**
|
|
32
55
|
* Params for each signed `query`, keyed by request `type`. These queries identify the caller through the
|
|
33
56
|
* signed envelope (`sender`) and take no further params, so every entry is empty — the signed counterpart to
|
|
@@ -37,7 +60,6 @@ export type MobileServerPublicQueryRequestType =
|
|
|
37
60
|
*/
|
|
38
61
|
export interface MobileServerSignedQueryRequestByType {
|
|
39
62
|
self_identity: Record<string, never>;
|
|
40
|
-
notification_preferences: Record<string, never>;
|
|
41
63
|
registered_devices: Record<string, never>;
|
|
42
64
|
}
|
|
43
65
|
|
|
@@ -59,10 +81,11 @@ export type MobileServerExecuteRequestType = Exclude<
|
|
|
59
81
|
|
|
60
82
|
/**
|
|
61
83
|
* Wire `request_type` the backend echoes on failure envelopes, prefixed by the route that produced it:
|
|
62
|
-
* `public_query_*` for unsigned queries, `
|
|
63
|
-
* (e.g. `
|
|
84
|
+
* `public_query_*` for unsigned queries, `public_execute_*` for unsigned writes, `query_*` for signed
|
|
85
|
+
* queries, and `execute_*` for signed writes (e.g. `execute_set_username`).
|
|
64
86
|
*/
|
|
65
87
|
export type MobileServerRequestType =
|
|
66
88
|
| `public_query_${MobileServerPublicQueryRequestType}`
|
|
89
|
+
| `public_execute_${MobileServerPublicExecuteRequestType}`
|
|
67
90
|
| `query_${MobileServerSignedQueryRequestType}`
|
|
68
91
|
| `execute_${MobileServerExecuteRequestType}`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MobileClient-CfDtaEeL.cjs","names":["mapMobilePublicProfile","mapMobileFeedPage","mapMobileIdentity","mapMobileNotificationPreferences","mapMobileRegisteredDevice","mapMobileNotificationPreferencesToServer","WalletNotProvidedError","buildSignedMobileRequest","isMobileServerFailureResponse","MobileServerFailureError","isMobileServerSuccessResponse"],"sources":["../src/MobileClient.ts"],"sourcesContent":["import {\n WalletClientWithAccount,\n WalletNotProvidedError,\n} from '@nadohq/shared';\nimport axios, { AxiosInstance, AxiosResponse } from 'axios';\nimport {\n mapMobileFeedPage,\n mapMobileIdentity,\n mapMobileNotificationPreferences,\n mapMobileNotificationPreferencesToServer,\n mapMobilePublicProfile,\n mapMobileRegisteredDevice,\n} from './dataMappers';\nimport {\n buildSignedMobileRequest,\n MobileSignedInner,\n MobileSignedInnerParams,\n MobileSignedRequest,\n} from './signing';\nimport {\n GetMobileFeedParams,\n GetMobileNotificationPreferencesParams,\n GetMobilePublicProfileParams,\n GetMobileRegisteredDevicesParams,\n GetMobileSelfIdentityParams,\n GetMobileUsernameAvailabilityParams,\n MobileClaimUsernameParams,\n MobileFeedPage,\n MobileIdentity,\n MobileNotificationPreferences,\n MobilePublicProfile,\n MobileRegisteredDevice,\n MobileRegisterExpoTokenParams,\n MobileSetPrivateModeParams,\n MobileSignedRequestParams,\n MobileUnregisterExpoTokenParams,\n MobileUpdateNotificationPreferencesParams,\n MobileUpdateUsernameParams,\n MobileUsernameAvailability,\n} from './types/clientTypes';\nimport { MobileServerFailureError } from './types/MobileServerFailureError';\nimport { MobileServerSuccessResponse } from './types/serverBaseTypes';\nimport { MobileServerExecuteResult } from './types/serverExecuteTypes';\nimport {\n MobileServerPublicQueryRequest,\n MobileServerPublicQuerySuccessResponse,\n MobileServerSignedQuerySuccessResponse,\n} from './types/serverQueryTypes';\nimport {\n MobileServerPublicQueryRequestByType,\n MobileServerPublicQueryRequestType,\n MobileServerSignedQueryRequestType,\n} from './types/serverRequestTypes';\nimport {\n isMobileServerFailureResponse,\n isMobileServerSuccessResponse,\n} from './utils/serverResponseGuards';\n\n/**\n * Options for constructing a {@link MobileClient}.\n */\nexport interface MobileClientOpts {\n /**\n * Base URL of the mobile service API, e.g. {@link MOBILE_CLIENT_ENDPOINTS}.\n */\n url: string;\n /**\n * Wallet client used to sign requests.\n */\n walletClient?: WalletClientWithAccount;\n /**\n * If provided, this signer is used instead of `walletClient` for all signed requests.\n */\n linkedSignerWalletClient?: WalletClientWithAccount;\n}\n\n/**\n * Client for the Nado mobile service API: username claims, public profile lookups, privacy settings, and\n * push notification device/preference management.\n */\nexport class MobileClient {\n readonly opts: MobileClientOpts;\n readonly axiosInstance: AxiosInstance;\n\n constructor(opts: MobileClientOpts) {\n this.opts = opts;\n this.axiosInstance = axios.create({\n withCredentials: true,\n // We have custom logic to validate response status and create an appropriate error\n validateStatus: () => true,\n });\n }\n\n /**\n * Sets the linked signer for requests\n *\n * @param linkedSignerWalletClient The linkedSigner to use for all signatures. Set to null to revert to the chain signer\n */\n public setLinkedSigner(\n linkedSignerWalletClient: WalletClientWithAccount | null,\n ) {\n this.opts.linkedSignerWalletClient = linkedSignerWalletClient ?? undefined;\n }\n\n /*\n Public queries\n */\n\n /**\n * Checks whether a username derived from the given display name is available to claim.\n */\n async getUsernameAvailability(\n params: GetMobileUsernameAvailabilityParams,\n ): Promise<MobileUsernameAvailability> {\n const body: MobileServerPublicQueryRequest<'username_availability'> = {\n type: 'username_availability',\n display_name: params.displayName,\n };\n const data = await this.publicQuery(body);\n return { username: data.username, available: data.available };\n }\n\n /**\n * Looks up a subaccount's public profile by username.\n *\n * @throws {MobileServerFailureError} With error code `PROFILE_NOT_FOUND` if no identity has claimed the\n * username or it is invalid. Private Mode does not hide the profile itself, only the account's activity.\n */\n async getPublicProfile(\n params: GetMobilePublicProfileParams,\n ): Promise<MobilePublicProfile> {\n const body: MobileServerPublicQueryRequest<'profile'> = {\n type: 'profile',\n username: params.username,\n };\n const data = await this.publicQuery(body);\n return mapMobilePublicProfile(data.profile);\n }\n\n /**\n * Fetches a page of the global trade feed: public, named, perpetual trades, newest first, optionally\n * filtered by a whole-dollar minimum notional (omitted means unfiltered). The feed is best-effort rather\n * than authoritative history, and pagination is live (not snapshot), so deduplicate pages by\n * {@link MobileFeedTrade.orderDigest}.\n *\n * @throws {MobileServerFailureError} With error code `INVALID_FEED_FILTER` if `minimumNotional` or\n * `limit` is outside its allowed domain (fix the request; do not retry unchanged), or\n * `INVALID_FEED_CURSOR` if the cursor is malformed or was issued for a different `minimumNotional`\n * (discard the cursor and restart from the first page).\n */\n async getFeed(params: GetMobileFeedParams = {}): Promise<MobileFeedPage> {\n const body: MobileServerPublicQueryRequest<'feed'> = {\n type: 'feed',\n minimum_notional: params.minimumNotional,\n limit: params.limit,\n cursor: params.cursor,\n };\n const data = await this.publicQuery(body);\n return mapMobileFeedPage(data);\n }\n\n /*\n Signed queries\n */\n\n /**\n * Fetches the caller's own identity for a subaccount. Returns `null` if the subaccount has not claimed a\n * username yet — this is normal data, not an error.\n */\n async getSelfIdentity(\n params: GetMobileSelfIdentityParams,\n ): Promise<MobileIdentity | null> {\n const signedRequest = await this.getSignedRequest(\n 'self_identity',\n params,\n {},\n );\n const data = await this.query<'self_identity'>(signedRequest);\n return data.identity ? mapMobileIdentity(data.identity) : null;\n }\n\n /**\n * Fetches a wallet's push notification preferences. Falls back to the backend's defaults if the wallet has\n * never updated its preferences.\n */\n async getNotificationPreferences(\n params: GetMobileNotificationPreferencesParams,\n ): Promise<MobileNotificationPreferences> {\n const signedRequest = await this.getSignedRequest(\n 'notification_preferences',\n params,\n {},\n );\n const data = await this.query<'notification_preferences'>(signedRequest);\n return mapMobileNotificationPreferences(data.preferences);\n }\n\n /**\n * Fetches the devices registered for push notifications for a wallet.\n */\n async getRegisteredDevices(\n params: GetMobileRegisteredDevicesParams,\n ): Promise<MobileRegisteredDevice[]> {\n const signedRequest = await this.getSignedRequest(\n 'registered_devices',\n params,\n {},\n );\n const data = await this.query<'registered_devices'>(signedRequest);\n return data.devices.map(mapMobileRegisteredDevice);\n }\n\n /*\n Signed executes\n */\n\n /**\n * Claims a username for a subaccount, derived from the given display name.\n */\n async claimUsername(\n params: MobileClaimUsernameParams,\n ): Promise<MobileServerSuccessResponse> {\n const signedRequest = await this.getSignedRequest(\n 'claim_username',\n params,\n {\n display_name: params.displayName,\n },\n );\n return this.execute(signedRequest);\n }\n\n /**\n * Updates the display name for a subaccount's already-claimed identity.\n */\n async updateUsername(\n params: MobileUpdateUsernameParams,\n ): Promise<MobileServerSuccessResponse> {\n const signedRequest = await this.getSignedRequest(\n 'update_username',\n params,\n { display_name: params.displayName },\n );\n return this.execute(signedRequest);\n }\n\n /**\n * Sets whether a subaccount's profile is private.\n */\n async setPrivateMode(\n params: MobileSetPrivateModeParams,\n ): Promise<MobileServerSuccessResponse> {\n const signedRequest = await this.getSignedRequest(\n 'set_private_mode',\n params,\n { private_mode: params.privateMode },\n );\n return this.execute(signedRequest);\n }\n\n /**\n * Registers an Expo push token for the wallet, transferring active ownership of the token if another\n * wallet had registered it. Idempotent per `(wallet, token)`.\n *\n * @throws {MobileServerFailureError} With error code `INVALID_EXPO_TOKEN` if the token is not a valid Expo\n * push token, or `INVALID_DEVICE_METADATA` if `locale` (max 35 chars) or `appVersion` (max 64 chars) is\n * too long.\n */\n async registerExpoToken(\n params: MobileRegisterExpoTokenParams,\n ): Promise<MobileServerSuccessResponse> {\n const signedRequest = await this.getSignedRequest(\n 'register_expo_token',\n params,\n {\n expo_token: params.expoToken,\n platform: params.platform,\n locale: params.locale ?? null,\n app_version: params.appVersion ?? null,\n },\n );\n return this.execute(signedRequest);\n }\n\n /**\n * Unregisters an Expo push token for the wallet. Idempotent — unregistering an unknown token succeeds.\n */\n async unregisterExpoToken(\n params: MobileUnregisterExpoTokenParams,\n ): Promise<MobileServerSuccessResponse> {\n const signedRequest = await this.getSignedRequest(\n 'unregister_expo_token',\n params,\n { expo_token: params.expoToken },\n );\n return this.execute(signedRequest);\n }\n\n /**\n * Replaces the wallet's push notification preferences. The backend requires `schemaVersion` of 1, exactly\n * one entry per known category, and empty `scopes` on every entry.\n *\n * @throws {MobileServerFailureError} With error code `INVALID_PREFERENCES` if those rules are violated.\n */\n async updateNotificationPreferences(\n params: MobileUpdateNotificationPreferencesParams,\n ): Promise<MobileServerSuccessResponse> {\n const signedRequest = await this.getSignedRequest(\n 'update_preferences',\n params,\n {\n preferences: mapMobileNotificationPreferencesToServer(\n params.preferences,\n ),\n },\n );\n return this.execute(signedRequest);\n }\n\n /*\n Base Fns\n */\n\n protected async getSignedRequest<T extends MobileSignedInner['type']>(\n type: T,\n params: MobileSignedRequestParams,\n innerParams: MobileSignedInnerParams<T>,\n ): Promise<MobileSignedRequest> {\n // Use the linked signer if provided, otherwise use the default signer provided to the client\n const walletClient =\n this.opts.linkedSignerWalletClient ?? this.opts.walletClient;\n\n if (walletClient == null) {\n throw new WalletNotProvidedError();\n }\n\n const inner = { type, ...innerParams } as MobileSignedInner;\n return buildSignedMobileRequest({ ...params, walletClient, inner });\n }\n\n // Spelled out as an intersection rather than `MobileServerPublicQueryRequest<T>`: the latter is an indexed\n // access on a mapped type, which is not an inference site, so `T` would always widen to the full union.\n protected async publicQuery<T extends MobileServerPublicQueryRequestType>(\n body: { type: T } & MobileServerPublicQueryRequestByType[T],\n ): Promise<MobileServerPublicQuerySuccessResponse<T>> {\n const response = await this.axiosInstance.post<unknown>(\n `${this.opts.url}/mobile/public_query`,\n body,\n );\n\n this.checkResponseStatus(response);\n this.checkServerStatus(response);\n\n // checkServerStatus throws on failure responses so the cast to the success response is acceptable here\n return response.data as MobileServerPublicQuerySuccessResponse<T>;\n }\n\n protected async query<T extends MobileServerSignedQueryRequestType>(\n body: MobileSignedRequest,\n ): Promise<MobileServerSignedQuerySuccessResponse<T>> {\n const response = await this.axiosInstance.post<unknown>(\n `${this.opts.url}/mobile/query`,\n body,\n );\n\n this.checkResponseStatus(response);\n this.checkServerStatus(response);\n\n // checkServerStatus throws on failure responses so the cast to the success response is acceptable here\n return response.data as MobileServerSignedQuerySuccessResponse<T>;\n }\n\n protected async execute(\n body: MobileSignedRequest,\n ): Promise<MobileServerSuccessResponse> {\n const response = await this.axiosInstance.post<MobileServerExecuteResult>(\n `${this.opts.url}/mobile/execute`,\n body,\n );\n\n this.checkResponseStatus(response);\n this.checkServerStatus(response);\n\n // checkServerStatus catches the failure result and throws the error, so the cast to the success response is acceptable here\n return response.data as MobileServerSuccessResponse;\n }\n\n /**\n * Validates the HTTP status before interpreting the body. Unlike the engine, the mobile backend returns\n * failure envelopes with non-2xx statuses (e.g. 404 for `PROFILE_NOT_FOUND`), so a non-2xx response with a\n * failure envelope still throws the typed error; anything else is a transport-level error.\n */\n private checkResponseStatus(response: AxiosResponse<unknown>) {\n if (response.status >= 200 && response.status < 300) {\n return;\n }\n if (isMobileServerFailureResponse(response.data)) {\n throw new MobileServerFailureError(response.data, response.status);\n }\n throw new Error(\n `Unexpected response from mobile service: ${response.status} ${response.statusText}. Data: ${JSON.stringify(response.data)}`,\n );\n }\n\n private checkServerStatus(response: AxiosResponse<unknown>) {\n const { data } = response;\n\n if (isMobileServerFailureResponse(data)) {\n throw new MobileServerFailureError(data, response.status);\n }\n if (!isMobileServerSuccessResponse(data)) {\n throw new Error(\n `Unexpected response from mobile service: missing success envelope. Data: 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;CAEJ;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"canonicalize-CDdYnhL3.d.cts","names":[],"sources":["../src/signing/src/signing/canonicalize.ts"],"mappings":";;;;;AAUA;;;;;iBAAgB,uBAAA,CACd,KAAA,EAAO,iBAAA,GACN,iBAAiB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"canonicalize-Cc7hdZLJ.d.ts","names":[],"sources":["../src/signing/src/signing/canonicalize.ts"],"mappings":";;;;;AAUA;;;;;iBAAgB,uBAAA,CACd,KAAA,EAAO,iBAAA,GACN,iBAAiB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clientTypes-BsOps_pY.d.ts","names":[],"sources":["../src/types/src/types/clientTypes.ts"],"mappings":";;;;;;;AAiBA;;;;;;UAAiB,cAAA;EACf,UAAA,EAAY,GAAG;EAUf;;AAAW;AAMb;EAXE,QAAA;;;;EAIA,WAAA;EACA,WAAA;AAAA;;AASW;AAMb;UATiB,mBAAA;EACf,UAAA,EAAY,GAAG;EACf,QAAA;EACA,WAAA;AAAA;;;;UAMe,0BAAA;EACf,QAAA;EACA,SAAS;AAAA;AAUQ;AAQnB;;;;AARmB,UAFF,gBAAA;EACf,IAAA,EAAM,oBAAoB;EAC1B,iBAAA;AAAA;;;;;;UAQe,eAAA;EAKf;EAHA,WAAA,EAAa,GAAA;EACb,UAAA,EAAY,GAAA;EACZ,QAAA;EACA,WAAA;EASA;EAPA,SAAA;EACA,SAAA;EASA;EAPA,QAAA;EASA;EAPA,QAAA;EASQ;EAPR,YAAA;EACA,MAAA,EAAQ,gBAAA;EAeqB;EAb7B,QAAA,EAAU,uBAAA;EAca;EAZvB,WAAA;EAYQ;EAVR,QAAA;AAAA;AAWU;AAOZ;;;;;AAPY,UAFK,cAAA;EACf,MAAA,EAAQ,eAAe;EACvB,UAAA;AAAA;;AAS8B;AAKhC;;KAPY,iCAAA;EACN,IAAA;EAAoB,UAA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AA;EACf,QAAQ;AAAA;;;AA8BG;UAxBI,mBAAA;EA8B2B;;;AAC/B;EA1BX,eAAA;EAgC0C;EA9B1C,KAAA;EA8BkD;AACvC;AAMb;;EAhCE,MAAA;AAAA;;;;KAMU,2BAAA,GAA8B,yBAAyB;;;;UAKlD,yBAAA,SAAkC,yBAAyB;EAC1E,WAAW;AAAA;;;AAwCF;UAlCM,0BAAA,SAAmC,yBAAyB;EAC3E,WAAW;AAAA;;;;UAMI,0BAAA,SAAmC,yBAAyB;EAC3E,WAAW;AAAA;AAuCb;;;AAAA,UAjCiB,6BAAA,SAAsC,yBAAyB;EAiCF;AAK9E;;EAlCE,SAAA;EACA,QAAA,EAAU,0BAAA;EAiC4D;;;EA7BtE,MAAA;;;;EAIA,UAAA;AAAA;;;;UAMe,+BAAA,SAAwC,yBAAyB;EAChF,SAAS;AAAA;;;;UAMM,yCAAA,SAAkD,yBAAyB;EAC1F,WAAA,EAAa,6BAAA;AAAA;;;;KAMH,sCAAA,GAAyC,yBAAyB;;;;KAKlE,gCAAA,GAAmC,yBAAyB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eip712MethodByType-B67XiwTu.d.ts","names":[],"sources":["../src/signing/src/signing/eip712MethodByType.ts"],"mappings":";;;;;AAKA;cAAa,4BAAA,EAA8B,MAAM,CAC/C,iBAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eip712MethodByType-DCU415zf.d.cts","names":[],"sources":["../src/signing/src/signing/eip712MethodByType.ts"],"mappings":";;;;;AAKA;cAAa,4BAAA,EAA8B,MAAM,CAC/C,iBAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mobileErrorCodes-Cj84nBnT.d.cts","names":[],"sources":["../src/types/src/types/mobileErrorCodes.ts"],"mappings":";;AAOA;;;;cAAa,kBAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBgD;KADjD,eAAA,WACF,kBAAA,eAAiC,kBAAkB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mobileErrorCodes-Czmigq9x.d.ts","names":[],"sources":["../src/types/src/types/mobileErrorCodes.ts"],"mappings":";;AAOA;;;;cAAa,kBAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBgD;KADjD,eAAA,WACF,kBAAA,eAAiC,kBAAkB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"payloadHash-BSoGv3Lz.d.cts","names":[],"sources":["../src/signing/src/signing/payloadHash.ts"],"mappings":";;;;;;AASA;;;iBAAgB,oBAAA,CAAqB,KAAA,EAAO,iBAAA,GAAoB,GAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"payloadHash-BVP2v3p9.d.ts","names":[],"sources":["../src/signing/src/signing/payloadHash.ts"],"mappings":";;;;;;AASA;;;iBAAgB,oBAAA,CAAqB,KAAA,EAAO,iBAAA,GAAoB,GAAG"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "./serverBaseTypes-A16onlPN.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/types/serverExecuteTypes.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Discriminated `execute` result union. Mobile execute routes return no payload beyond the success
|
|
6
|
-
* discriminant, so the success arm is the base success envelope; failures use the uniform failure envelope.
|
|
7
|
-
*/
|
|
8
|
-
type MobileServerExecuteResult = MobileServerSuccessResponse | MobileServerFailureResponse;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { MobileServerExecuteResult as t };
|
|
11
|
-
//# sourceMappingURL=serverExecuteTypes-C-bioiuQ.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serverExecuteTypes-C-bioiuQ.d.cts","names":[],"sources":["../src/types/src/types/serverExecuteTypes.ts"],"mappings":";;;;;AASA;;KAAY,yBAAA,GACR,2BAAA,GACA,2BAA2B"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "./serverBaseTypes-m3zEi0X9.js";
|
|
2
|
-
|
|
3
|
-
//#region src/types/serverExecuteTypes.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Discriminated `execute` result union. Mobile execute routes return no payload beyond the success
|
|
6
|
-
* discriminant, so the success arm is the base success envelope; failures use the uniform failure envelope.
|
|
7
|
-
*/
|
|
8
|
-
type MobileServerExecuteResult = MobileServerSuccessResponse | MobileServerFailureResponse;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { MobileServerExecuteResult as t };
|
|
11
|
-
//# sourceMappingURL=serverExecuteTypes-DfzWOeIx.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serverExecuteTypes-DfzWOeIx.d.ts","names":[],"sources":["../src/types/src/types/serverExecuteTypes.ts"],"mappings":";;;;;AASA;;KAAY,yBAAA,GACR,2BAAA,GACA,2BAA2B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serverModelTypes-CPZUvVil.d.cts","names":[],"sources":["../src/types/src/types/serverModelTypes.ts"],"mappings":";;;;;;AAMA;KAAY,0BAAA;;;AAA0B;KAK1B,0BAAA;;;;UAWK,mBAAA;EACf,UAAA,EAAY,GAAG;EACf,QAAA;EACA,YAAA;AAAA;;;;UAMe,oBAAA;EACf,UAAA,EAAY,GAAG;EACf,QAAA;EACA,YAAA;EACA,YAAA;AAAA;;;;;;KAQU,gCAAA,GAAmC,WAAW;;AAR5C;AAQd;;cAMa,qCAAA;;AAN6C;AAM1D;;cASa,kCAAA;;AANmD;AAMhE;KAWY,6BAAA,WACF,kCAAkC;;;AANlC;AAKV;UAOiB,uBAAA;EACf,SAAA,EAAW,gCAAA;EACX,MAAA,EAAQ,6BAA6B;AAAA;AAFvC;;;;AAAA,cASa,wBAAA;;;;KAKD,oBAAA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AA;EACvB,OAAA,EAAS,2BAAA;EACT,IAAA,EAAM,wBAAA;AAAA;;;;;;;UASS,qCAAA;EACf,aAAA,EAAe,gCAAA;EACf,wBAAA,EAA0B,2CAAA;EAC1B,kBAAA,EAAoB,qCAAA;AAAA;;AAZU;AAShC;;;KAWY,sCAAA,WACA,kCAAA,GACR,kCAAA,IACA,2BAAA,GAA8B,qCAAA,CAAsC,CAAA;;;;;KAM5D,sCAAA,WACA,kCAAA,GACR,kCAAA,IACA,2BAAA,GAA8B,qCAAA,CAAsC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serverRequestTypes-DQDy3K9O.d.ts","names":[],"sources":["../src/types/src/types/serverRequestTypes.ts"],"mappings":";;;;;AAKA;UAAiB,oCAAA;EACf,qBAAA;IAAyB,YAAA;EAAA;EACzB,OAAA;IAAW,QAAA;EAAA;EACX,IAAA;IAKE;;;;IAAA,gBAAA,WAcQ;IAZR,KAAA;IAaI;;AAAoC;AAS5C;IAjBI,MAAA;EAAA;AAAA;;;;KAOQ,kCAAA,SACJ,oCAAoC;;;;;;;;UAS3B,oCAAA;EACf,aAAA,EAAe,MAAA;EACf,wBAAA,EAA0B,MAAA;EAC1B,kBAAA,EAAoB,MAAA;AAAA;AAQsB;AAM5C;;;AAN4C,KADhC,kCAAA,SACJ,oCAAoC;;;;;KAMhC,8BAAA,GAAiC,OAAA,CAC3C,iBAAA,UACA,kCAAA;;;;AAAkC;AAQpC;KAAY,uBAAA,mBACQ,kCAAA,cACP,kCAAA,gBACE,8BAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serverRequestTypes-DnU_FfMI.d.cts","names":[],"sources":["../src/types/src/types/serverRequestTypes.ts"],"mappings":";;;;;AAKA;UAAiB,oCAAA;EACf,qBAAA;IAAyB,YAAA;EAAA;EACzB,OAAA;IAAW,QAAA;EAAA;EACX,IAAA;IAKE;;;;IAAA,gBAAA,WAcQ;IAZR,KAAA;IAaI;;AAAoC;AAS5C;IAjBI,MAAA;EAAA;AAAA;;;;KAOQ,kCAAA,SACJ,oCAAoC;;;;;;;;UAS3B,oCAAA;EACf,aAAA,EAAe,MAAA;EACf,wBAAA,EAA0B,MAAA;EAC1B,kBAAA,EAAoB,MAAA;AAAA;AAQsB;AAM5C;;;AAN4C,KADhC,kCAAA,SACJ,oCAAoC;;;;;KAMhC,8BAAA,GAAiC,OAAA,CAC3C,iBAAA,UACA,kCAAA;;;;AAAkC;AAQpC;KAAY,uBAAA,mBACQ,kCAAA,cACP,kCAAA,gBACE,8BAAA"}
|