@nadohq/mobile-client 0.53.0 → 0.54.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 +12 -4
- package/dist/{MobileClient-CEVEYnV1.cjs → MobileClient-BbTaqTzi.cjs} +141 -3
- package/dist/MobileClient-BbTaqTzi.cjs.map +1 -0
- package/dist/MobileClient.cjs +1 -1
- package/dist/MobileClient.d.cts +75 -8
- package/dist/MobileClient.d.cts.map +1 -1
- package/dist/MobileClient.d.ts +75 -8
- package/dist/MobileClient.d.ts.map +1 -1
- package/dist/MobileClient.js +141 -3
- package/dist/MobileClient.js.map +1 -1
- package/dist/{MobileServerFailureError-GsGrBgO0.d.ts → MobileServerFailureError-B2og8e5O.d.ts} +3 -3
- package/dist/{MobileServerFailureError-GsGrBgO0.d.ts.map → MobileServerFailureError-B2og8e5O.d.ts.map} +1 -1
- package/dist/{MobileServerFailureError-D4ina2b2.d.cts → MobileServerFailureError-BrLtaHnU.d.cts} +3 -3
- package/dist/{MobileServerFailureError-D4ina2b2.d.cts.map → MobileServerFailureError-BrLtaHnU.d.cts.map} +1 -1
- package/dist/{buildSignedMobileRequest-D9XzRTyq.d.cts → buildSignedMobileRequest-CZ-EdxYI.d.cts} +2 -2
- package/dist/{buildSignedMobileRequest-D9XzRTyq.d.cts.map → buildSignedMobileRequest-CZ-EdxYI.d.cts.map} +1 -1
- package/dist/{buildSignedMobileRequest-7Iwi5k6h.d.ts → buildSignedMobileRequest-CoAVSDPx.d.ts} +2 -2
- package/dist/{buildSignedMobileRequest-7Iwi5k6h.d.ts.map → buildSignedMobileRequest-CoAVSDPx.d.ts.map} +1 -1
- package/dist/{canonicalize-OYR35XMP.d.cts → canonicalize-0_B6UOxO.d.cts} +2 -2
- package/dist/canonicalize-0_B6UOxO.d.cts.map +1 -0
- package/dist/{canonicalize-T4ShepBu.d.ts → canonicalize-BC-JICjp.d.ts} +2 -2
- package/dist/canonicalize-BC-JICjp.d.ts.map +1 -0
- package/dist/clientTypes-P4LAjreY.d.ts +731 -0
- package/dist/clientTypes-P4LAjreY.d.ts.map +1 -0
- package/dist/clientTypes-YF5d8bvg.d.cts +731 -0
- package/dist/clientTypes-YF5d8bvg.d.cts.map +1 -0
- package/dist/dataMappers.cjs +358 -0
- package/dist/dataMappers.cjs.map +1 -1
- package/dist/dataMappers.d.cts +132 -6
- package/dist/dataMappers.d.cts.map +1 -1
- package/dist/dataMappers.d.ts +132 -6
- package/dist/dataMappers.d.ts.map +1 -1
- package/dist/dataMappers.js +339 -2
- package/dist/dataMappers.js.map +1 -1
- package/dist/{eip712MethodByType-D6edRSIs.d.ts → eip712MethodByType-DWtLyPY7.d.ts} +2 -2
- package/dist/eip712MethodByType-DWtLyPY7.d.ts.map +1 -0
- package/dist/{eip712MethodByType-BAqld4fP.d.cts → eip712MethodByType-sHQ-VTHd.d.cts} +2 -2
- package/dist/eip712MethodByType-sHQ-VTHd.d.cts.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-CGYR3_Io.d.ts → mobileErrorCodes-DccrM4NI.d.cts} +8 -2
- package/dist/{mobileErrorCodes-CGYR3_Io.d.cts.map → mobileErrorCodes-DccrM4NI.d.cts.map} +1 -1
- package/dist/{mobileErrorCodes-CGYR3_Io.d.cts → mobileErrorCodes-DccrM4NI.d.ts} +8 -2
- package/dist/{mobileErrorCodes-CGYR3_Io.d.ts.map → mobileErrorCodes-DccrM4NI.d.ts.map} +1 -1
- package/dist/{payloadHash-B7Nmf64N.d.cts → payloadHash-CSgTglN4.d.cts} +2 -2
- package/dist/payloadHash-CSgTglN4.d.cts.map +1 -0
- package/dist/{payloadHash-RxkbwgTH.d.ts → payloadHash-qsU1DEF0.d.ts} +2 -2
- package/dist/payloadHash-qsU1DEF0.d.ts.map +1 -0
- package/dist/{serverBaseTypes-BOuAdmuQ.d.cts → serverBaseTypes-CuMsGXgc.d.cts} +2 -2
- package/dist/{serverBaseTypes-BOuAdmuQ.d.cts.map → serverBaseTypes-CuMsGXgc.d.cts.map} +1 -1
- package/dist/{serverBaseTypes-DDzfBA1a.d.ts → serverBaseTypes-DKCLDn3x.d.ts} +2 -2
- package/dist/{serverBaseTypes-DDzfBA1a.d.ts.map → serverBaseTypes-DKCLDn3x.d.ts.map} +1 -1
- package/dist/{serverExecuteTypes-DrxK2r7m.d.ts → serverExecuteTypes-DKG1mqy1.d.ts} +3 -3
- package/dist/{serverExecuteTypes-DrxK2r7m.d.ts.map → serverExecuteTypes-DKG1mqy1.d.ts.map} +1 -1
- package/dist/{serverExecuteTypes-DamHfu25.d.cts → serverExecuteTypes-TPX0GCgv.d.cts} +3 -3
- package/dist/{serverExecuteTypes-DamHfu25.d.cts.map → serverExecuteTypes-TPX0GCgv.d.cts.map} +1 -1
- package/dist/serverModelTypes-MlqdaMRd.d.cts +490 -0
- package/dist/serverModelTypes-MlqdaMRd.d.cts.map +1 -0
- package/dist/serverModelTypes-MlqdaMRd.d.ts +490 -0
- package/dist/serverModelTypes-MlqdaMRd.d.ts.map +1 -0
- package/dist/serverQueryTypes-BLUe10AI.d.ts +152 -0
- package/dist/serverQueryTypes-BLUe10AI.d.ts.map +1 -0
- package/dist/serverQueryTypes-BZOoJBpb.d.cts +152 -0
- package/dist/serverQueryTypes-BZOoJBpb.d.cts.map +1 -0
- package/dist/{serverRequestTypes-BylecTUn.d.cts → serverRequestTypes-BULjZnnz.d.ts} +69 -4
- package/dist/serverRequestTypes-BULjZnnz.d.ts.map +1 -0
- package/dist/{serverRequestTypes-DcdmGfTu.d.ts → serverRequestTypes-XbnLUsXT.d.cts} +69 -4
- package/dist/serverRequestTypes-XbnLUsXT.d.cts.map +1 -0
- package/dist/{serverResponseGuards-CjR1tv7G.d.cts → serverResponseGuards-DIj9MIrJ.d.cts} +2 -2
- package/dist/{serverResponseGuards-CjR1tv7G.d.cts.map → serverResponseGuards-DIj9MIrJ.d.cts.map} +1 -1
- package/dist/{serverResponseGuards-BspbRjOM.d.ts → serverResponseGuards-DY_8lAo7.d.ts} +2 -2
- package/dist/{serverResponseGuards-BspbRjOM.d.ts.map → serverResponseGuards-DY_8lAo7.d.ts.map} +1 -1
- package/dist/signing/buildSignedMobileRequest.d.cts +1 -1
- package/dist/signing/buildSignedMobileRequest.d.ts +1 -1
- package/dist/signing/canonicalize.d.cts +1 -1
- package/dist/signing/canonicalize.d.ts +1 -1
- package/dist/signing/eip712MethodByType.d.cts +1 -1
- package/dist/signing/eip712MethodByType.d.ts +1 -1
- package/dist/signing/index.d.cts +5 -5
- package/dist/signing/index.d.ts +5 -5
- package/dist/signing/payloadHash.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.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 +13 -1
- 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 +13 -1
- 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 +1 -1
- package/dist/types/serverExecuteTypes.d.ts +1 -1
- package/dist/types/serverModelTypes.cjs.map +1 -1
- package/dist/types/serverModelTypes.d.cts +2 -2
- package/dist/types/serverModelTypes.d.ts +2 -2
- package/dist/types/serverModelTypes.js.map +1 -1
- package/dist/types/serverQueryTypes.d.cts +2 -2
- package/dist/types/serverQueryTypes.d.ts +2 -2
- package/dist/types/serverRequestTypes.d.cts +2 -2
- package/dist/types/serverRequestTypes.d.ts +2 -2
- package/dist/{types-BG321aOe.d.ts → types-B_4veFLc.d.ts} +3 -3
- package/dist/{types-BG321aOe.d.ts.map → types-B_4veFLc.d.ts.map} +1 -1
- package/dist/{types-D30luCKT.d.cts → types-CwpXP7xM.d.cts} +3 -3
- package/dist/{types-D30luCKT.d.cts.map → types-CwpXP7xM.d.cts.map} +1 -1
- 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 +192 -2
- package/src/dataMappers.ts +503 -1
- package/src/socialFeed.test.ts +723 -0
- package/src/types/clientTypes.ts +467 -0
- package/src/types/mobileErrorCodes.ts +12 -0
- package/src/types/serverModelTypes.ts +388 -0
- package/src/types/serverQueryTypes.ts +74 -0
- package/src/types/serverRequestTypes.ts +94 -1
- package/dist/MobileClient-CEVEYnV1.cjs.map +0 -1
- package/dist/canonicalize-OYR35XMP.d.cts.map +0 -1
- package/dist/canonicalize-T4ShepBu.d.ts.map +0 -1
- package/dist/clientTypes-FQTkDfq3.d.cts +0 -349
- package/dist/clientTypes-FQTkDfq3.d.cts.map +0 -1
- package/dist/clientTypes-FaHdWkNu.d.ts +0 -349
- package/dist/clientTypes-FaHdWkNu.d.ts.map +0 -1
- package/dist/eip712MethodByType-BAqld4fP.d.cts.map +0 -1
- package/dist/eip712MethodByType-D6edRSIs.d.ts.map +0 -1
- package/dist/payloadHash-B7Nmf64N.d.cts.map +0 -1
- package/dist/payloadHash-RxkbwgTH.d.ts.map +0 -1
- package/dist/serverModelTypes-YmHqfxc8.d.cts +0 -173
- package/dist/serverModelTypes-YmHqfxc8.d.cts.map +0 -1
- package/dist/serverModelTypes-YmHqfxc8.d.ts +0 -173
- package/dist/serverModelTypes-YmHqfxc8.d.ts.map +0 -1
- package/dist/serverQueryTypes-C-_h9awN.d.ts +0 -89
- package/dist/serverQueryTypes-C-_h9awN.d.ts.map +0 -1
- package/dist/serverQueryTypes-CuVsrzGV.d.cts +0 -89
- package/dist/serverQueryTypes-CuVsrzGV.d.cts.map +0 -1
- package/dist/serverRequestTypes-BylecTUn.d.cts.map +0 -1
- package/dist/serverRequestTypes-DcdmGfTu.d.ts.map +0 -1
|
@@ -1,349 +0,0 @@
|
|
|
1
|
-
import { a as MobileFeedTradePosition, c as MobileNotificationCategory, i as MobileFeedMarginMode, l as MobileNotificationPlatform } from "./serverModelTypes-YmHqfxc8.js";
|
|
2
|
-
import { SignatureParams, Subaccount } from "@nadohq/shared";
|
|
3
|
-
import { Hex } from "viem";
|
|
4
|
-
|
|
5
|
-
//#region src/types/clientTypes.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* A subaccount's public profile, as returned by an unsigned profile lookup. Private Mode hides the account's
|
|
8
|
-
* activity, not its profile, so `privateMode` is exposed here too. A subaccount with no identity row still
|
|
9
|
-
* yields a profile, with `null` names and `privateMode: false`.
|
|
10
|
-
*
|
|
11
|
-
* The last three fields are `undefined` unless the matching {@link MobileProfilesInclude} asked for them —
|
|
12
|
-
* absent means "not requested" rather than "none".
|
|
13
|
-
*/
|
|
14
|
-
interface MobilePublicProfile {
|
|
15
|
-
subaccount: Hex;
|
|
16
|
-
/** Canonical, lowercased handle, or `null` if no username has been claimed. */
|
|
17
|
-
username: string | null;
|
|
18
|
-
/** User-facing name as claimed, or `null` if no username has been claimed. */
|
|
19
|
-
displayName: string | null;
|
|
20
|
-
privateMode: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Exact count at query time rather than a cached counter, including unnamed and private accounts — Private
|
|
23
|
-
* Mode hides activity, not relationships. Requires the `followCounts` include.
|
|
24
|
-
*/
|
|
25
|
-
followerCount?: number;
|
|
26
|
-
followingCount?: number;
|
|
27
|
-
/** Requires the `followSummary` include, and is relative to that include's `viewAs`. */
|
|
28
|
-
followSummary?: MobileFollowSummary;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* The identity fields the backend attaches to a subaccount wherever it surfaces one alongside other data.
|
|
32
|
-
* Resolved at read time, so a rename shows up on the next read without any change to the surrounding record.
|
|
33
|
-
*/
|
|
34
|
-
interface MobileIdentitySummary {
|
|
35
|
-
subaccount: Hex;
|
|
36
|
-
/** `null` when the account has not claimed a username; render a local fallback label from `subaccount`. */
|
|
37
|
-
username: string | null;
|
|
38
|
-
/** `null` when the account has not claimed a username; render a local fallback label from `subaccount`. */
|
|
39
|
-
displayName: string | null;
|
|
40
|
-
/** Reserved for a future avatar source; `null` until one is implemented. */
|
|
41
|
-
avatarUrl: string | null;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* A viewer's relationship with one Profile, plus the Followed By preview: accounts the viewer follows that
|
|
45
|
-
* also follow that Profile. Every preview entry is therefore already familiar to the viewer, which is why it
|
|
46
|
-
* carries no `isFollowing` of its own.
|
|
47
|
-
*/
|
|
48
|
-
interface MobileFollowSummary {
|
|
49
|
-
/** The direct `viewer -> viewed Profile` relationship. */
|
|
50
|
-
isFollowing: boolean;
|
|
51
|
-
/** Exact size of the two-edge intersection, independent of how many previews came back. */
|
|
52
|
-
followedByCount: number;
|
|
53
|
-
/**
|
|
54
|
-
* Newest `preview -> viewed Profile` relationship first, with a bytes32 tie-break. Capped at
|
|
55
|
-
* `MOBILE_FOLLOWED_BY_PREVIEW_LIMIT` (2) by the backend and not client-configurable.
|
|
56
|
-
*/
|
|
57
|
-
followedBy: MobileIdentitySummary[];
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* One row of a Followers or Following page.
|
|
61
|
-
*/
|
|
62
|
-
interface MobileFollowListAccount {
|
|
63
|
-
identity: MobileIdentitySummary;
|
|
64
|
-
/**
|
|
65
|
-
* Whether the `viewAs` Viewer follows this account — not the listed relationship that put it in the page.
|
|
66
|
-
* The Viewer can appear in another Profile's list, and does not follow themself, so their own row is
|
|
67
|
-
* `false`. `undefined` when the request named no `viewAs`, which is a missing perspective rather than a
|
|
68
|
-
* known "not following".
|
|
69
|
-
*/
|
|
70
|
-
isFollowing?: boolean;
|
|
71
|
-
/** This account's own follower count. */
|
|
72
|
-
followerCount: number;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* A page of Followers or Following. Pagination is live rather than snapshot: a Follow or Unfollow between
|
|
76
|
-
* pages can move an account, so an account can appear twice or not at all across one session. Deduplicate by
|
|
77
|
-
* {@link MobileIdentitySummary.subaccount} and restart from `cursor: undefined` on refresh.
|
|
78
|
-
*/
|
|
79
|
-
interface MobileFollowListPage {
|
|
80
|
-
accounts: MobileFollowListAccount[];
|
|
81
|
-
/** `null` means the list is complete. */
|
|
82
|
-
nextCursor: string | null;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Post-commit state of a follow or unfollow. The mutation and its count share one database transaction, so
|
|
86
|
-
* these values are authoritative — apply them rather than re-reading.
|
|
87
|
-
*/
|
|
88
|
-
interface MobileFollowMutationResult {
|
|
89
|
-
isFollowing: boolean;
|
|
90
|
-
/** The *target's* follower count after the mutation, not the sender's. */
|
|
91
|
-
followerCount: number;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Result of a username availability check.
|
|
95
|
-
*/
|
|
96
|
-
interface MobileUsernameAvailability {
|
|
97
|
-
username: string;
|
|
98
|
-
available: boolean;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Margin of a feed trade. Branch on `mode` — do not infer isolated state from leverage presence:
|
|
102
|
-
* `estimatedLeverage` (a rounded whole-number estimate, not exact submitted leverage) is `undefined` on
|
|
103
|
-
* `cross`, and also `undefined` inside `isolated` when no estimate is available.
|
|
104
|
-
*/
|
|
105
|
-
interface MobileFeedMargin {
|
|
106
|
-
mode: MobileFeedMarginMode;
|
|
107
|
-
estimatedLeverage?: number;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* A single feed trade: one row per order digest, enriched with the trader's current identity at read time
|
|
111
|
-
* (a rename can change an already-fetched trade on the next read). Amounts are display-oriented human-unit
|
|
112
|
-
* numbers — do not use them for accounting, order construction, or exact threshold decisions.
|
|
113
|
-
*/
|
|
114
|
-
interface MobileFeedTrade extends MobileIdentitySummary {
|
|
115
|
-
/** Order digest this trade is keyed by; the stable id for reconciling live pagination. */
|
|
116
|
-
orderDigest: Hex;
|
|
117
|
-
productId: number;
|
|
118
|
-
/** Executed quantity in human units. */
|
|
119
|
-
quantity: number;
|
|
120
|
-
/** Trade notional in whole-dollar human units. */
|
|
121
|
-
notional: number;
|
|
122
|
-
/** Average execution price in human units. */
|
|
123
|
-
averagePrice: number;
|
|
124
|
-
margin: MobileFeedMargin;
|
|
125
|
-
/** Resulting position change. `position.direction` is NOT the execution buy/sell side. */
|
|
126
|
-
position: MobileFeedTradePosition;
|
|
127
|
-
/** Realized PnL of the trade in human units; can be negative. */
|
|
128
|
-
realizedPnl: number;
|
|
129
|
-
/** Fill time as a Unix timestamp (milliseconds). */
|
|
130
|
-
filledAt: number;
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* A page of feed trades. `nextCursor` is `null` when there was no additional candidate at query time.
|
|
134
|
-
* Pagination is live, not snapshot, so a later fill can move a trade between pages — deduplicate by
|
|
135
|
-
* {@link MobileFeedTrade.orderDigest} and treat the merged list as a short-lived view, not an authoritative
|
|
136
|
-
* cache (removals from Private Mode or blacklists are not signaled).
|
|
137
|
-
*/
|
|
138
|
-
interface MobileFeedPage {
|
|
139
|
-
trades: MobileFeedTrade[];
|
|
140
|
-
nextCursor: string | null;
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Scope limiting a notification category preference. Scopes are part of the wire format but rejected by the
|
|
144
|
-
* backend for the MVP — `scopes` must be empty.
|
|
145
|
-
*/
|
|
146
|
-
type MobileNotificationPreferenceScope = {
|
|
147
|
-
type: 'subaccount';
|
|
148
|
-
subaccount: Hex;
|
|
149
|
-
} | {
|
|
150
|
-
type: 'product';
|
|
151
|
-
productId: number;
|
|
152
|
-
};
|
|
153
|
-
/**
|
|
154
|
-
* A per-category push notification preference.
|
|
155
|
-
*/
|
|
156
|
-
interface MobileNotificationCategoryPreference {
|
|
157
|
-
category: MobileNotificationCategory;
|
|
158
|
-
enabled: boolean;
|
|
159
|
-
scopes: MobileNotificationPreferenceScope[];
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* A wallet's push notification preferences. The backend requires exactly one entry per known category and
|
|
163
|
-
* `schemaVersion` of 1.
|
|
164
|
-
*/
|
|
165
|
-
interface MobileNotificationPreferences {
|
|
166
|
-
/** Only `1` is accepted by the backend for the MVP. */
|
|
167
|
-
schemaVersion: 1;
|
|
168
|
-
categories: MobileNotificationCategoryPreference[];
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* The wallet an Expo push token is currently registered to, alongside the redacted metadata of the device
|
|
172
|
-
* that registered it.
|
|
173
|
-
*/
|
|
174
|
-
interface MobileRegisteredWallet {
|
|
175
|
-
/** Address of the wallet that owns the token's active registration. */
|
|
176
|
-
wallet: Hex;
|
|
177
|
-
/** Push platform the device registered under. */
|
|
178
|
-
platform: MobileNotificationPlatform;
|
|
179
|
-
/** BCP-47 locale tag reported at registration, or `null` if none was provided. */
|
|
180
|
-
locale: string | null;
|
|
181
|
-
/** App version string reported at registration, or `null` if none was provided. */
|
|
182
|
-
appVersion: string | null;
|
|
183
|
-
/**
|
|
184
|
-
* First 8 hex chars of `keccak256` over the bracket-stripped Expo token — a stable, non-reversible
|
|
185
|
-
* identifier for the device's push token. The raw token is never returned by the backend.
|
|
186
|
-
*/
|
|
187
|
-
tokenFingerprintPrefix: string;
|
|
188
|
-
/**
|
|
189
|
-
* Unix timestamp (milliseconds) of the device's last registration refresh.
|
|
190
|
-
*/
|
|
191
|
-
lastSeenAt: number;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Common params for signed requests that authenticate as a given subaccount.
|
|
195
|
-
*/
|
|
196
|
-
interface MobileSignedRequestParams extends Subaccount, SignatureParams {}
|
|
197
|
-
/**
|
|
198
|
-
* Common params for the unsigned notification requests, which name their target with an Expo push token
|
|
199
|
-
* instead of a subaccount and signature — the counterpart to {@link MobileSignedRequestParams}. The backend
|
|
200
|
-
* resolves the token's owning wallet and reads or mutates that wallet's state.
|
|
201
|
-
*/
|
|
202
|
-
interface MobileWithExpoTokenParams {
|
|
203
|
-
/** Expo push token, e.g. `ExponentPushToken[...]`. */
|
|
204
|
-
expoToken: string;
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Params for {@link MobileClient.getUsernameAvailability}.
|
|
208
|
-
*/
|
|
209
|
-
interface GetMobileUsernameAvailabilityParams {
|
|
210
|
-
displayName: string;
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* Opt-in extras for a profiles lookup. Each one adds fields that are otherwise absent from every returned
|
|
214
|
-
* profile, and costs extra rate-limit weight per profile, so ask only for what the UI shows.
|
|
215
|
-
*/
|
|
216
|
-
interface MobileProfilesInclude {
|
|
217
|
-
/** Populates `followerCount` and `followingCount`. */
|
|
218
|
-
followCounts?: boolean;
|
|
219
|
-
/**
|
|
220
|
-
* Populates `followSummary`, relative to `viewAs`. This viewer identity is an unauthenticated claim — the
|
|
221
|
-
* route takes no signature — so do not treat the result as proof of who is asking.
|
|
222
|
-
*/
|
|
223
|
-
followSummary?: {
|
|
224
|
-
viewAs: Subaccount;
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Params for {@link MobileClient.getProfiles}.
|
|
229
|
-
*/
|
|
230
|
-
interface GetMobileProfilesParams {
|
|
231
|
-
/**
|
|
232
|
-
* 1–`MOBILE_PROFILES_MAX_BATCH_SIZE` (25) distinct subaccounts. Duplicates and an empty list are rejected
|
|
233
|
-
* rather than deduplicated, and results come back in this exact order.
|
|
234
|
-
*/
|
|
235
|
-
subaccounts: Subaccount[];
|
|
236
|
-
include?: MobileProfilesInclude;
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Params for {@link MobileClient.getFeed}.
|
|
240
|
-
*/
|
|
241
|
-
interface GetMobileFeedParams {
|
|
242
|
-
/**
|
|
243
|
-
* Minimum notional filter as a whole-dollar safe integer, at least `MOBILE_FEED_MIN_NOTIONAL_FLOOR`
|
|
244
|
-
* ($1,000). Omit for the unfiltered feed.
|
|
245
|
-
*/
|
|
246
|
-
minimumNotional?: number;
|
|
247
|
-
/** Page size, 1–`MOBILE_FEED_MAX_PAGE_SIZE` (50); the backend defaults to 50 when omitted. */
|
|
248
|
-
limit?: number;
|
|
249
|
-
/**
|
|
250
|
-
* Opaque keyset cursor from a prior page's {@link MobileFeedPage.nextCursor}. Send it back unchanged with
|
|
251
|
-
* the exact same `minimumNotional` it was issued for.
|
|
252
|
-
*/
|
|
253
|
-
cursor?: string;
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* Params for {@link MobileClient.setUsername}.
|
|
257
|
-
*/
|
|
258
|
-
interface MobileSetUsernameParams extends MobileSignedRequestParams {
|
|
259
|
-
/** User-facing name to claim, preserving casing. Must match `MOBILE_DISPLAY_NAME_PATTERN`. */
|
|
260
|
-
displayName: string;
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Params for {@link MobileClient.setPrivateMode}.
|
|
264
|
-
*/
|
|
265
|
-
interface MobileSetPrivateModeParams extends MobileSignedRequestParams {
|
|
266
|
-
privateMode: boolean;
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Params for {@link MobileClient.setFollow}. The subaccount carried by {@link MobileSignedRequestParams} is
|
|
270
|
-
* the signing Follower; `target` is the Profile on the other end of the relationship.
|
|
271
|
-
*/
|
|
272
|
-
interface MobileSetFollowParams extends MobileSignedRequestParams {
|
|
273
|
-
/** The Profile being followed or unfollowed. Must not be the signing subaccount. */
|
|
274
|
-
target: Subaccount;
|
|
275
|
-
/** `true` follows the target, `false` unfollows it. Both directions are idempotent. */
|
|
276
|
-
isFollowing: boolean;
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* Common params for a Followers or Following page.
|
|
280
|
-
*/
|
|
281
|
-
interface GetMobileFollowListParams {
|
|
282
|
-
/** The Profile whose Followers or Following are being listed. */
|
|
283
|
-
target: Subaccount;
|
|
284
|
-
/**
|
|
285
|
-
* Viewer to resolve the page against, which turns on familiar-first ordering and populates every row's
|
|
286
|
-
* {@link MobileFollowListAccount.isFollowing}. Omit it for a plain recency-ordered list with no
|
|
287
|
-
* `isFollowing` at all. The route is unsigned, so this is an unauthenticated claim rather than proof of
|
|
288
|
-
* who is asking.
|
|
289
|
-
*/
|
|
290
|
-
viewAs?: Subaccount;
|
|
291
|
-
/**
|
|
292
|
-
* Opaque cursor from the previous page's {@link MobileFollowListPage.nextCursor}. Omit for the first page.
|
|
293
|
-
* A cursor is bound to its `viewAs` (including its absence), Profile, and list direction — reusing it
|
|
294
|
-
* elsewhere fails with `INVALID_FOLLOW_CURSOR`.
|
|
295
|
-
*/
|
|
296
|
-
cursor?: string;
|
|
297
|
-
/**
|
|
298
|
-
* Page size, 1–`MOBILE_FOLLOW_LIST_MAX_PAGE_SIZE` (50); the backend defaults to
|
|
299
|
-
* `MOBILE_FOLLOW_LIST_DEFAULT_PAGE_SIZE` (25) when omitted.
|
|
300
|
-
*/
|
|
301
|
-
limit?: number;
|
|
302
|
-
}
|
|
303
|
-
/**
|
|
304
|
-
* Params for {@link MobileClient.getFollowers}.
|
|
305
|
-
*/
|
|
306
|
-
type GetMobileFollowersParams = GetMobileFollowListParams;
|
|
307
|
-
/**
|
|
308
|
-
* Params for {@link MobileClient.getFollowing}.
|
|
309
|
-
*/
|
|
310
|
-
type GetMobileFollowingParams = GetMobileFollowListParams;
|
|
311
|
-
/**
|
|
312
|
-
* Params for {@link MobileClient.registerExpoToken}.
|
|
313
|
-
*/
|
|
314
|
-
interface MobileRegisterExpoTokenParams extends MobileSignedRequestParams {
|
|
315
|
-
/**
|
|
316
|
-
* Expo push token, e.g. `ExponentPushToken[...]`.
|
|
317
|
-
*/
|
|
318
|
-
expoToken: string;
|
|
319
|
-
platform: MobileNotificationPlatform;
|
|
320
|
-
/**
|
|
321
|
-
* BCP-47 locale tag, max 35 chars.
|
|
322
|
-
*/
|
|
323
|
-
locale?: string;
|
|
324
|
-
/**
|
|
325
|
-
* App version string, max 64 chars.
|
|
326
|
-
*/
|
|
327
|
-
appVersion?: string;
|
|
328
|
-
}
|
|
329
|
-
/**
|
|
330
|
-
* Params for {@link MobileClient.unregisterExpoToken}.
|
|
331
|
-
*/
|
|
332
|
-
type MobileUnregisterExpoTokenParams = MobileWithExpoTokenParams;
|
|
333
|
-
/**
|
|
334
|
-
* Params for {@link MobileClient.updateNotificationPreferences}.
|
|
335
|
-
*/
|
|
336
|
-
interface MobileUpdateNotificationPreferencesParams extends MobileWithExpoTokenParams {
|
|
337
|
-
preferences: MobileNotificationPreferences;
|
|
338
|
-
}
|
|
339
|
-
/**
|
|
340
|
-
* Params for {@link MobileClient.getNotificationPreferences}.
|
|
341
|
-
*/
|
|
342
|
-
type GetMobileNotificationPreferencesParams = MobileWithExpoTokenParams;
|
|
343
|
-
/**
|
|
344
|
-
* Params for {@link MobileClient.getRegisteredWallet}.
|
|
345
|
-
*/
|
|
346
|
-
type GetMobileRegisteredWalletParams = MobileWithExpoTokenParams;
|
|
347
|
-
//#endregion
|
|
348
|
-
export { MobileUsernameAvailability as A, MobileRegisteredWallet as C, MobileSignedRequestParams as D, MobileSetUsernameParams as E, MobileUnregisterExpoTokenParams as O, MobileRegisterExpoTokenParams as S, MobileSetPrivateModeParams as T, MobileNotificationCategoryPreference as _, GetMobileNotificationPreferencesParams as a, MobileProfilesInclude as b, GetMobileUsernameAvailabilityParams as c, MobileFeedTrade as d, MobileFollowListAccount as f, MobileIdentitySummary as g, MobileFollowSummary as h, GetMobileFollowingParams as i, MobileWithExpoTokenParams as j, MobileUpdateNotificationPreferencesParams as k, MobileFeedMargin as l, MobileFollowMutationResult as m, GetMobileFollowListParams as n, GetMobileProfilesParams as o, MobileFollowListPage as p, GetMobileFollowersParams as r, GetMobileRegisteredWalletParams as s, GetMobileFeedParams as t, MobileFeedPage as u, MobileNotificationPreferenceScope as v, MobileSetFollowParams as w, MobilePublicProfile as x, MobileNotificationPreferences as y };
|
|
349
|
-
//# sourceMappingURL=clientTypes-FaHdWkNu.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clientTypes-FaHdWkNu.d.ts","names":[],"sources":["../src/types/src/types/clientTypes.ts"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eip712MethodByType-BAqld4fP.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":"eip712MethodByType-D6edRSIs.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":"payloadHash-B7Nmf64N.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-RxkbwgTH.d.ts","names":[],"sources":["../src/signing/src/signing/payloadHash.ts"],"mappings":";;;;;;AASA;;;iBAAgB,oBAAA,CAAqB,KAAA,EAAO,iBAAA,GAAoB,GAAG"}
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import { BalanceSide } from "@nadohq/shared";
|
|
2
|
-
import { Hex } from "viem";
|
|
3
|
-
|
|
4
|
-
//#region src/types/serverModelTypes.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Platform of a device registered for push notifications.
|
|
7
|
-
*/
|
|
8
|
-
type MobileNotificationPlatform = 'ios' | 'android';
|
|
9
|
-
/**
|
|
10
|
-
* Category of push notification.
|
|
11
|
-
*/
|
|
12
|
-
type MobileNotificationCategory = 'order_fill' | 'order_update' | 'liquidation' | 'funding' | 'product_listing' | 'announcement';
|
|
13
|
-
/**
|
|
14
|
-
* Server-side identity summary (snake_case): the read-time identity fields the backend attaches to a
|
|
15
|
-
* subaccount wherever it surfaces one alongside other data. Name fields are `null` until the subaccount
|
|
16
|
-
* claims a username, and a rename shows up on the next read without any change to the surrounding record.
|
|
17
|
-
*/
|
|
18
|
-
interface MobileServerIdentitySummary {
|
|
19
|
-
subaccount: Hex;
|
|
20
|
-
username: string | null;
|
|
21
|
-
display_name: string | null;
|
|
22
|
-
/** Reserved for a future avatar source; `null` until one is implemented. */
|
|
23
|
-
avatar_url: string | null;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Server-side follow summary (snake_case), nested in a `profiles` entry when the `follow_summary` include is
|
|
27
|
-
* requested. `is_following` is the direct `view_as -> this profile` relationship; every `followed_by` entry
|
|
28
|
-
* satisfies both `view_as -> entry` and `entry -> this profile`, so each one is already familiar to the
|
|
29
|
-
* viewer and carries no `is_following` of its own.
|
|
30
|
-
*/
|
|
31
|
-
interface MobileServerFollowSummary {
|
|
32
|
-
is_following: boolean;
|
|
33
|
-
/** Exact size of the two-edge intersection, independent of how many previews came back. */
|
|
34
|
-
followed_by_count: number;
|
|
35
|
-
/** Capped at `MOBILE_FOLLOWED_BY_PREVIEW_LIMIT` (2) by the backend; not client-configurable. */
|
|
36
|
-
followed_by: MobileServerIdentitySummary[];
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Server-side public profile shape (snake_case), shared by the singular `profile` and batched `profiles`
|
|
40
|
-
* queries. Name fields are `null` until the subaccount claims a username; a subaccount with no identity row
|
|
41
|
-
* still yields an entry, with `null` names and `private_mode: false`.
|
|
42
|
-
*
|
|
43
|
-
* The three optional fields are omitted from the wire entirely unless the matching `profiles` include asked
|
|
44
|
-
* for them, which is why they are optional rather than nullable — absent means "not requested", not "none".
|
|
45
|
-
* The singular `profile` query never returns any of them.
|
|
46
|
-
*/
|
|
47
|
-
interface MobileServerProfile {
|
|
48
|
-
subaccount: Hex;
|
|
49
|
-
username: string | null;
|
|
50
|
-
display_name: string | null;
|
|
51
|
-
private_mode: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Exact count at query time — the backend counts rather than reading a cached counter. Unnamed and private
|
|
54
|
-
* accounts are included: Private Mode hides activity, not relationships. Requires `follow_counts`.
|
|
55
|
-
*/
|
|
56
|
-
follower_count?: number;
|
|
57
|
-
following_count?: number;
|
|
58
|
-
/** Requires the `follow_summary` include, and is relative to that include's `view_as`. */
|
|
59
|
-
follow_summary?: MobileServerFollowSummary;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Server-side row of a Followers or Following page (snake_case).
|
|
63
|
-
*/
|
|
64
|
-
interface MobileServerFollowListAccount {
|
|
65
|
-
identity: MobileServerIdentitySummary;
|
|
66
|
-
/**
|
|
67
|
-
* The `view_as` Viewer's relationship to this account, not the listed relationship that put it in the
|
|
68
|
-
* page, so it is `false` on the Viewer's own row. Omitted entirely when the request named no `view_as`,
|
|
69
|
-
* rather than being sent as a misleading `false`.
|
|
70
|
-
*/
|
|
71
|
-
is_following?: boolean;
|
|
72
|
-
/** The listed account's own follower count, exact at query time. */
|
|
73
|
-
follower_count: number;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Direction of the position a feed trade resulted in — for `closed`, the direction that was closed. This is
|
|
77
|
-
* NOT the execution buy/sell side, which the feed does not expose. Aliases {@link BalanceSide} so the feed's
|
|
78
|
-
* direction values stay in lockstep with the rest of the SDK.
|
|
79
|
-
*/
|
|
80
|
-
type MobileFeedTradePositionDirection = BalanceSide;
|
|
81
|
-
/**
|
|
82
|
-
* Every {@link MobileFeedTradePositionDirection} the feed can report, for callers that need the values at
|
|
83
|
-
* runtime (validation, filters, UI enumeration).
|
|
84
|
-
*/
|
|
85
|
-
declare const MOBILE_FEED_TRADE_POSITION_DIRECTIONS: readonly ["long", "short"];
|
|
86
|
-
/**
|
|
87
|
-
* Every {@link MobileFeedTradePositionEffect} the feed can report, for callers that need the values at
|
|
88
|
-
* runtime (validation, filters, UI enumeration).
|
|
89
|
-
*/
|
|
90
|
-
declare const MOBILE_FEED_TRADE_POSITION_EFFECTS: readonly ["opened", "increased", "reduced", "closed", "flipped"];
|
|
91
|
-
/**
|
|
92
|
-
* How a feed trade changed the trader's position in the product.
|
|
93
|
-
*/
|
|
94
|
-
type MobileFeedTradePositionEffect = (typeof MOBILE_FEED_TRADE_POSITION_EFFECTS)[number];
|
|
95
|
-
/**
|
|
96
|
-
* Position change of a feed trade. Both keys are single words, so the wire and client shapes are identical
|
|
97
|
-
* and this type is shared by {@link MobileServerFeedTrade} and the client-side `MobileFeedTrade`.
|
|
98
|
-
*/
|
|
99
|
-
interface MobileFeedTradePosition {
|
|
100
|
-
direction: MobileFeedTradePositionDirection;
|
|
101
|
-
effect: MobileFeedTradePositionEffect;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Every {@link MobileFeedMarginMode} the feed can report, for callers that need the values at runtime
|
|
105
|
-
* (validation, filters, UI enumeration).
|
|
106
|
-
*/
|
|
107
|
-
declare const MOBILE_FEED_MARGIN_MODES: readonly ["cross", "isolated"];
|
|
108
|
-
/**
|
|
109
|
-
* Margin mode a feed trade was executed under. Shared by the wire and client margin shapes.
|
|
110
|
-
*/
|
|
111
|
-
type MobileFeedMarginMode = (typeof MOBILE_FEED_MARGIN_MODES)[number];
|
|
112
|
-
/**
|
|
113
|
-
* Server-side margin of a feed trade. Branch on `mode` — do not infer isolated state from leverage presence:
|
|
114
|
-
* `estimated_leverage` (a rounded whole-number estimate, not exact submitted leverage) is omitted on `cross`,
|
|
115
|
-
* and also omitted inside `isolated` when no estimate is available.
|
|
116
|
-
*/
|
|
117
|
-
interface MobileServerFeedMargin {
|
|
118
|
-
mode: MobileFeedMarginMode;
|
|
119
|
-
estimated_leverage?: number;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Server-side feed trade shape (snake_case): one row per order digest, enriched at read time with the
|
|
123
|
-
* trader's current identity. Amounts are display-oriented human-unit JSON numbers — do not use them for
|
|
124
|
-
* accounting, order construction, or exact threshold decisions.
|
|
125
|
-
*/
|
|
126
|
-
interface MobileServerFeedTrade extends MobileServerIdentitySummary {
|
|
127
|
-
/** Order digest this row is keyed by; the stable id clients use to reconcile live pagination. */
|
|
128
|
-
order_digest: Hex;
|
|
129
|
-
product_id: number;
|
|
130
|
-
/** Executed quantity in human units. */
|
|
131
|
-
quantity: number;
|
|
132
|
-
/** Trade notional in whole-dollar human units. */
|
|
133
|
-
notional: number;
|
|
134
|
-
/** Average execution price in human units. */
|
|
135
|
-
average_price: number;
|
|
136
|
-
margin: MobileServerFeedMargin;
|
|
137
|
-
position: MobileFeedTradePosition;
|
|
138
|
-
/** Realized PnL of the trade in human units; can be negative. */
|
|
139
|
-
realized_pnl: number;
|
|
140
|
-
/** Fill time as JavaScript-safe integer Unix milliseconds. */
|
|
141
|
-
filled_at_ms: number;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Server-side scope limiting a notification category preference. Scopes are rejected by the backend for the
|
|
145
|
-
* MVP (`scopes` must be empty) but are part of the wire format.
|
|
146
|
-
*/
|
|
147
|
-
type MobileServerNotificationPreferenceScope = {
|
|
148
|
-
type: 'subaccount';
|
|
149
|
-
subaccount: Hex;
|
|
150
|
-
} | {
|
|
151
|
-
type: 'product';
|
|
152
|
-
product_id: number;
|
|
153
|
-
};
|
|
154
|
-
/**
|
|
155
|
-
* Server-side per-category notification preference (snake_case).
|
|
156
|
-
*/
|
|
157
|
-
interface MobileServerNotificationCategoryPreference {
|
|
158
|
-
category: MobileNotificationCategory;
|
|
159
|
-
enabled: boolean;
|
|
160
|
-
scopes: MobileServerNotificationPreferenceScope[];
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Server-side notification preferences shape (snake_case), used in both the `update_preferences` public
|
|
164
|
-
* execute and the `notification_preferences` public query response.
|
|
165
|
-
*/
|
|
166
|
-
interface MobileServerNotificationPreferences {
|
|
167
|
-
/** Only `1` is accepted by the backend for the MVP. */
|
|
168
|
-
schema_version: 1;
|
|
169
|
-
categories: MobileServerNotificationCategoryPreference[];
|
|
170
|
-
}
|
|
171
|
-
//#endregion
|
|
172
|
-
export { MobileServerNotificationPreferences as _, MobileFeedTradePosition as a, MobileNotificationCategory as c, MobileServerFeedTrade as d, MobileServerFollowListAccount as f, MobileServerNotificationPreferenceScope as g, MobileServerNotificationCategoryPreference as h, MobileFeedMarginMode as i, MobileNotificationPlatform as l, MobileServerIdentitySummary as m, MOBILE_FEED_TRADE_POSITION_DIRECTIONS as n, MobileFeedTradePositionDirection as o, MobileServerFollowSummary as p, MOBILE_FEED_TRADE_POSITION_EFFECTS as r, MobileFeedTradePositionEffect as s, MOBILE_FEED_MARGIN_MODES as t, MobileServerFeedMargin as u, MobileServerProfile as v };
|
|
173
|
-
//# sourceMappingURL=serverModelTypes-YmHqfxc8.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serverModelTypes-YmHqfxc8.d.cts","names":[],"sources":["../src/types/src/types/serverModelTypes.ts"],"mappings":";;;;;;AAMA;KAAY,0BAAA;;;AAA0B;KAK1B,0BAAA;;;;AAA0B;AAatC;UAAiB,2BAAA;EACf,UAAA,EAAY,GAAG;EACf,QAAA;EACA,YAAA;EAFY;EAIZ,UAAA;AAAA;;;AAAU;AASZ;;;UAAiB,yBAAA;EACf,YAAA;EAEA;EAAA,iBAAA;EAEa;EAAb,WAAA,EAAa,2BAA2B;AAAA;AAY1C;;;;;;;;;AAAA,UAAiB,mBAAA;EACf,UAAA,EAAY,GAAA;EACZ,QAAA;EACA,YAAA;EACA,YAAA;EAQ0C;AAM5C;;;EATE,cAAA;EACA,eAAA;EASU;EAPV,cAAA,GAAiB,yBAAyB;AAAA;;AAe5B;AAQhB;UAjBiB,6BAAA;EACf,QAAA,EAAU,2BAA2B;EAgBmB;AAAA;AAM1D;;;EAhBE,YAAA;EAmB8D;EAjB9D,cAAA;AAAA;;;AA6BQ;AAKV;;KA1BY,gCAAA,GAAmC,WAAW;;AA2Bd;AAM5C;;cA3Ba,qCAAA;;;;;cASA,kCAAA;;AAoB0B;AAOvC;KAhBY,6BAAA,WACF,kCAAkC;;;AAe0B;AAKtE;UAdiB,uBAAA;EACf,SAAA,EAAW,gCAAA;EACX,MAAA,EAAQ,6BAA6B;AAAA;AAmBvC;;;;AAAA,cAZa,wBAAA;;;;KAKD,oBAAA,WAA+B,wBAAwB;AAiBnE;;;;;AAAA,UAViB,sBAAA;EACf,IAAA,EAAM,oBAAoB;EAC1B,kBAAA;AAAA;;;;;;UAQe,qBAAA,SAA8B,2BAAA;EAS7C;EAPA,YAAA,EAAc,GAAA;EACd,UAAA;EAQA;EANA,QAAA;EAQA;EANA,QAAA;EAQY;EANZ,aAAA;EACA,MAAA,EAAQ,sBAAA;EACR,QAAA,EAAU,uBAAA;;EAEV,YAAA;EAUI;EARJ,YAAA;AAAA;;;;AAS+B;KAFrB,uCAAA;EACN,IAAA;EAAoB,UAAA,EAAY,GAAG;AAAA;EACnC,IAAA;EAAiB,UAAA;AAAA;;;;UAKN,0CAAA;EACf,QAAA,EAAU,0BAAA;EACV,OAAA;EACA,MAAA,EAAQ,uCAAuC;AAAA;;;;;UAOhC,mCAAA;;EAEf,cAAA;EACA,UAAA,EAAY,0CAA0C;AAAA"}
|