@0xmonaco/types 1.0.61 → 1.0.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/applications/requests.d.ts +2 -2
- package/dist/applications/responses.d.ts +20 -4
- package/dist/auth/responses.d.ts +15 -0
- package/dist/pitpass/index.d.ts +27 -3
- package/dist/pitpass/index.js +1 -1
- package/dist/pitpass/responses.d.ts +75 -0
- package/dist/pitpass/responses.js +78 -0
- package/dist/trading/responses.d.ts +20 -14
- package/dist/websocket/events/account-events.d.ts +40 -14
- package/dist/websocket/events/account-events.js +16 -0
- package/dist/wire/operations.d.ts +1 -1
- package/dist/wire/operations.js +2 -0
- package/dist/wire/schema.d.ts +323 -15
- package/package.json +2 -2
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Query parameters for listing application orders.
|
|
10
10
|
*/
|
|
11
11
|
export interface ListAppOrdersParams {
|
|
12
|
-
/** Page number (starts from 1) */
|
|
12
|
+
/** Page number (starts from 1, at most 10,000 — the last page the listing counts towards) */
|
|
13
13
|
page?: number;
|
|
14
14
|
/** Items per page (max 100) */
|
|
15
15
|
pageSize?: number;
|
|
@@ -43,7 +43,7 @@ export interface ListAppUsersParams {
|
|
|
43
43
|
* Query parameters for listing application movements.
|
|
44
44
|
*/
|
|
45
45
|
export interface ListAppMovementsParams {
|
|
46
|
-
/** Page number (starts from 1) */
|
|
46
|
+
/** Page number (starts from 1, at most 10,000 — the last page the listing counts towards) */
|
|
47
47
|
page?: number;
|
|
48
48
|
/** Items per page (max 100) */
|
|
49
49
|
pageSize?: number;
|
|
@@ -162,13 +162,21 @@ export interface AppBalance {
|
|
|
162
162
|
*/
|
|
163
163
|
export interface ListAppOrdersResponse {
|
|
164
164
|
orders: AppOrder[];
|
|
165
|
-
/**
|
|
165
|
+
/**
|
|
166
|
+
* Matching orders. Exact up to 10,000 pages of the requested page size
|
|
167
|
+
* (`pageSize` x 10,000 rows) and saturates there, so an application with
|
|
168
|
+
* more matching orders than the listing can page through reads the cap,
|
|
169
|
+
* not its lifetime total.
|
|
170
|
+
*/
|
|
166
171
|
total: number;
|
|
167
172
|
/** Current page number */
|
|
168
173
|
page: number;
|
|
169
174
|
/** Items per page */
|
|
170
175
|
pageSize: number;
|
|
171
|
-
/**
|
|
176
|
+
/**
|
|
177
|
+
* Number of pages at the requested page size. Exact up to 10,000 and
|
|
178
|
+
* saturates there, the last page this listing can reach.
|
|
179
|
+
*/
|
|
172
180
|
totalPages: number;
|
|
173
181
|
}
|
|
174
182
|
/**
|
|
@@ -190,13 +198,21 @@ export interface ListAppUsersResponse {
|
|
|
190
198
|
*/
|
|
191
199
|
export interface ListAppMovementsResponse {
|
|
192
200
|
movements: AppMovement[];
|
|
193
|
-
/**
|
|
201
|
+
/**
|
|
202
|
+
* Matching movements. Exact up to 10,000 pages of the requested page size
|
|
203
|
+
* (`pageSize` x 10,000 rows) and saturates there, so an application with
|
|
204
|
+
* more matching movements than the listing can page through reads the cap,
|
|
205
|
+
* not its lifetime total.
|
|
206
|
+
*/
|
|
194
207
|
total: number;
|
|
195
208
|
/** Current page number */
|
|
196
209
|
page: number;
|
|
197
210
|
/** Items per page */
|
|
198
211
|
pageSize: number;
|
|
199
|
-
/**
|
|
212
|
+
/**
|
|
213
|
+
* Number of pages at the requested page size. Exact up to 10,000 and
|
|
214
|
+
* saturates there, the last page this listing can reach.
|
|
215
|
+
*/
|
|
200
216
|
totalPages: number;
|
|
201
217
|
}
|
|
202
218
|
/**
|
package/dist/auth/responses.d.ts
CHANGED
|
@@ -43,6 +43,21 @@ export interface AuthState {
|
|
|
43
43
|
expiresAt: number;
|
|
44
44
|
/** Information about the authenticated user */
|
|
45
45
|
user: User;
|
|
46
|
+
/**
|
|
47
|
+
* True when this verify created the user — the wallet's first-ever sign-in on
|
|
48
|
+
* this application. Gate first-time UX (e.g. the optional "have a referral
|
|
49
|
+
* code?" input) on it. Absent on responses from a server that predates the
|
|
50
|
+
* field.
|
|
51
|
+
*/
|
|
52
|
+
isNewUser?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* True when a PitPass referral relationship was recorded on this verify: a
|
|
55
|
+
* valid, non-self TraderCode was presented on the wallet's first-ever sign-in
|
|
56
|
+
* and resolved to a known referrer. Use it to confirm the referral landed on
|
|
57
|
+
* the signup-success screen. Absent on responses from a server that predates
|
|
58
|
+
* the field.
|
|
59
|
+
*/
|
|
60
|
+
referralApplied?: boolean;
|
|
46
61
|
}
|
|
47
62
|
export interface ApplicationInfo {
|
|
48
63
|
/** Unique identifier for the application */
|
package/dist/pitpass/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Types for PitPass TraderCode API: code lookup, rewards balance, and transfer.
|
|
5
5
|
*/
|
|
6
6
|
import type { BaseAPI } from "../api";
|
|
7
|
-
import type { GetRewardsBalanceResponse, TraderCodeAvailabilityResponse, TraderCodeInfoResponse, TraderCodeResponse, TransferRewardsParams, TransferRewardsResponse } from "./responses";
|
|
7
|
+
import type { GetMyReferralDownlineResponse, GetMyReferralPositionResponse, GetRewardsBalanceResponse, TraderCodeAvailabilityResponse, TraderCodeInfoResponse, TraderCodeResponse, TransferRewardsParams, TransferRewardsResponse } from "./responses";
|
|
8
8
|
/**
|
|
9
9
|
* PitPass TraderCode API interface.
|
|
10
10
|
*
|
|
@@ -91,6 +91,30 @@ export interface PitpassAPI extends BaseAPI {
|
|
|
91
91
|
* @returns Promise resolving to the post-transfer rewards and trading balances
|
|
92
92
|
*/
|
|
93
93
|
transferRewards(params: TransferRewardsParams): Promise<TransferRewardsResponse>;
|
|
94
|
+
/**
|
|
95
|
+
* Read your own referral position: your direct (L1) referrer, total earned,
|
|
96
|
+
* and most recent reward rows.
|
|
97
|
+
*
|
|
98
|
+
* Self-scoped — the server derives your identity from the session, so you can
|
|
99
|
+
* only ever read your own chain. `referrer` is the empty string when you were
|
|
100
|
+
* not referred (use it to gate the "already referred" UX). Every other user is
|
|
101
|
+
* identified by their public wallet address (with a `display` handle-or-wallet
|
|
102
|
+
* variant), never an internal id.
|
|
103
|
+
*
|
|
104
|
+
* @returns Promise resolving to your referrer, total earned, and recent rewards
|
|
105
|
+
*/
|
|
106
|
+
getMyReferralPosition(): Promise<GetMyReferralPositionResponse>;
|
|
107
|
+
/**
|
|
108
|
+
* Read your own downline: who you earn from and how much (earnings by source
|
|
109
|
+
* across L1/L2/L3), your L1 direct-referee roster (including referees who have
|
|
110
|
+
* not traded yet), and a per-level earnings summary.
|
|
111
|
+
*
|
|
112
|
+
* Self-scoped and read-only. Every source and referee is a public wallet
|
|
113
|
+
* address plus a `display` handle-or-wallet variant, never an internal id.
|
|
114
|
+
*
|
|
115
|
+
* @returns Promise resolving to earnings-by-source, the direct-referee roster, and a summary
|
|
116
|
+
*/
|
|
117
|
+
getMyReferralDownline(): Promise<GetMyReferralDownlineResponse>;
|
|
94
118
|
}
|
|
95
|
-
export type { GetRewardsBalanceResponse, RewardsBalanceEntry, SetTraderCodeParams, TraderCodeAvailabilityReason, TraderCodeAvailabilityResponse, TraderCodeInfoResponse, TraderCodeResponse, TransferRewardsParams, TransferRewardsResponse, } from "./responses";
|
|
96
|
-
export { GetRewardsBalanceResponseSchema, RewardsBalanceEntrySchema, SetTraderCodeParamsSchema, TraderCodeAvailabilityReasonSchema, TraderCodeAvailabilityResponseSchema, TraderCodeInfoResponseSchema, TraderCodeResponseSchema, TransferRewardsParamsSchema, TransferRewardsResponseSchema, } from "./responses";
|
|
119
|
+
export type { GetMyReferralDownlineResponse, GetMyReferralPositionResponse, GetRewardsBalanceResponse, ReferralDirectReferee, ReferralEarningsSource, ReferralEarningsSummary, ReferralRewardEntry, RewardsBalanceEntry, SetTraderCodeParams, TraderCodeAvailabilityReason, TraderCodeAvailabilityResponse, TraderCodeInfoResponse, TraderCodeResponse, TransferRewardsParams, TransferRewardsResponse, } from "./responses";
|
|
120
|
+
export { GetMyReferralDownlineResponseSchema, GetMyReferralPositionResponseSchema, GetRewardsBalanceResponseSchema, ReferralDirectRefereeSchema, ReferralEarningsSourceSchema, ReferralEarningsSummarySchema, ReferralRewardEntrySchema, RewardsBalanceEntrySchema, SetTraderCodeParamsSchema, TraderCodeAvailabilityReasonSchema, TraderCodeAvailabilityResponseSchema, TraderCodeInfoResponseSchema, TraderCodeResponseSchema, TransferRewardsParamsSchema, TransferRewardsResponseSchema, } from "./responses";
|
package/dist/pitpass/index.js
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Types for PitPass TraderCode API: code lookup, rewards balance, and transfer.
|
|
5
5
|
*/
|
|
6
|
-
export { GetRewardsBalanceResponseSchema, RewardsBalanceEntrySchema, SetTraderCodeParamsSchema, TraderCodeAvailabilityReasonSchema, TraderCodeAvailabilityResponseSchema, TraderCodeInfoResponseSchema, TraderCodeResponseSchema, TransferRewardsParamsSchema, TransferRewardsResponseSchema, } from "./responses";
|
|
6
|
+
export { GetMyReferralDownlineResponseSchema, GetMyReferralPositionResponseSchema, GetRewardsBalanceResponseSchema, ReferralDirectRefereeSchema, ReferralEarningsSourceSchema, ReferralEarningsSummarySchema, ReferralRewardEntrySchema, RewardsBalanceEntrySchema, SetTraderCodeParamsSchema, TraderCodeAvailabilityReasonSchema, TraderCodeAvailabilityResponseSchema, TraderCodeInfoResponseSchema, TraderCodeResponseSchema, TransferRewardsParamsSchema, TransferRewardsResponseSchema, } from "./responses";
|
|
@@ -67,6 +67,75 @@ export declare const TransferRewardsResponseSchema: z.ZodObject<{
|
|
|
67
67
|
rewardsBalance: z.ZodString;
|
|
68
68
|
tradingBalance: z.ZodString;
|
|
69
69
|
}, z.core.$strip>;
|
|
70
|
+
/** A single reward the caller has earned (one row per referred trade × level). */
|
|
71
|
+
export declare const ReferralRewardEntrySchema: z.ZodObject<{
|
|
72
|
+
source: z.ZodString;
|
|
73
|
+
sourceDisplay: z.ZodString;
|
|
74
|
+
level: z.ZodNumber;
|
|
75
|
+
amount: z.ZodString;
|
|
76
|
+
token: z.ZodString;
|
|
77
|
+
rateApplied: z.ZodString;
|
|
78
|
+
createdAt: z.ZodString;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
/** The caller's own referral position: who referred them and what they've earned. */
|
|
81
|
+
export declare const GetMyReferralPositionResponseSchema: z.ZodObject<{
|
|
82
|
+
referrer: z.ZodString;
|
|
83
|
+
referrerDisplay: z.ZodString;
|
|
84
|
+
totalEarned: z.ZodString;
|
|
85
|
+
rewards: z.ZodArray<z.ZodObject<{
|
|
86
|
+
source: z.ZodString;
|
|
87
|
+
sourceDisplay: z.ZodString;
|
|
88
|
+
level: z.ZodNumber;
|
|
89
|
+
amount: z.ZodString;
|
|
90
|
+
token: z.ZodString;
|
|
91
|
+
rateApplied: z.ZodString;
|
|
92
|
+
createdAt: z.ZodString;
|
|
93
|
+
}, z.core.$strip>>;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
/** One aggregated earnings row per (source trader, level, token) the caller earns from. */
|
|
96
|
+
export declare const ReferralEarningsSourceSchema: z.ZodObject<{
|
|
97
|
+
source: z.ZodString;
|
|
98
|
+
sourceDisplay: z.ZodString;
|
|
99
|
+
level: z.ZodNumber;
|
|
100
|
+
totalEarned: z.ZodString;
|
|
101
|
+
token: z.ZodString;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
/** One direct (L1) referee of the caller, whether or not they have traded yet. */
|
|
104
|
+
export declare const ReferralDirectRefereeSchema: z.ZodObject<{
|
|
105
|
+
wallet: z.ZodString;
|
|
106
|
+
display: z.ZodString;
|
|
107
|
+
referredAt: z.ZodString;
|
|
108
|
+
totalEarned: z.ZodString;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
/** Per-level breakdown of the caller's total referral earnings. */
|
|
111
|
+
export declare const ReferralEarningsSummarySchema: z.ZodObject<{
|
|
112
|
+
totalEarned: z.ZodString;
|
|
113
|
+
level1Earned: z.ZodString;
|
|
114
|
+
level2Earned: z.ZodString;
|
|
115
|
+
level3Earned: z.ZodString;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
/** The caller's own downline: who they earn from, their L1 roster, and a summary. */
|
|
118
|
+
export declare const GetMyReferralDownlineResponseSchema: z.ZodObject<{
|
|
119
|
+
earningsBySource: z.ZodArray<z.ZodObject<{
|
|
120
|
+
source: z.ZodString;
|
|
121
|
+
sourceDisplay: z.ZodString;
|
|
122
|
+
level: z.ZodNumber;
|
|
123
|
+
totalEarned: z.ZodString;
|
|
124
|
+
token: z.ZodString;
|
|
125
|
+
}, z.core.$strip>>;
|
|
126
|
+
directReferees: z.ZodArray<z.ZodObject<{
|
|
127
|
+
wallet: z.ZodString;
|
|
128
|
+
display: z.ZodString;
|
|
129
|
+
referredAt: z.ZodString;
|
|
130
|
+
totalEarned: z.ZodString;
|
|
131
|
+
}, z.core.$strip>>;
|
|
132
|
+
summary: z.ZodObject<{
|
|
133
|
+
totalEarned: z.ZodString;
|
|
134
|
+
level1Earned: z.ZodString;
|
|
135
|
+
level2Earned: z.ZodString;
|
|
136
|
+
level3Earned: z.ZodString;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
}, z.core.$strip>;
|
|
70
139
|
export type RewardsBalanceEntry = z.infer<typeof RewardsBalanceEntrySchema>;
|
|
71
140
|
export type GetRewardsBalanceResponse = z.infer<typeof GetRewardsBalanceResponseSchema>;
|
|
72
141
|
export type TraderCodeResponse = z.infer<typeof TraderCodeResponseSchema>;
|
|
@@ -76,3 +145,9 @@ export type SetTraderCodeParams = z.infer<typeof SetTraderCodeParamsSchema>;
|
|
|
76
145
|
export type TraderCodeInfoResponse = z.infer<typeof TraderCodeInfoResponseSchema>;
|
|
77
146
|
export type TransferRewardsParams = z.infer<typeof TransferRewardsParamsSchema>;
|
|
78
147
|
export type TransferRewardsResponse = z.infer<typeof TransferRewardsResponseSchema>;
|
|
148
|
+
export type ReferralRewardEntry = z.infer<typeof ReferralRewardEntrySchema>;
|
|
149
|
+
export type GetMyReferralPositionResponse = z.infer<typeof GetMyReferralPositionResponseSchema>;
|
|
150
|
+
export type ReferralEarningsSource = z.infer<typeof ReferralEarningsSourceSchema>;
|
|
151
|
+
export type ReferralDirectReferee = z.infer<typeof ReferralDirectRefereeSchema>;
|
|
152
|
+
export type ReferralEarningsSummary = z.infer<typeof ReferralEarningsSummarySchema>;
|
|
153
|
+
export type GetMyReferralDownlineResponse = z.infer<typeof GetMyReferralDownlineResponseSchema>;
|
|
@@ -101,3 +101,81 @@ export const TransferRewardsResponseSchema = z.object({
|
|
|
101
101
|
/** Your trading balance for the token after the transfer, RAW atomic units. */
|
|
102
102
|
tradingBalance: z.string(),
|
|
103
103
|
});
|
|
104
|
+
/** A single reward the caller has earned (one row per referred trade × level). */
|
|
105
|
+
export const ReferralRewardEntrySchema = z.object({
|
|
106
|
+
/** Public wallet address of the trader (taker) whose trade generated this reward. */
|
|
107
|
+
source: z.string(),
|
|
108
|
+
/** Human-facing name for the source: their custom handle if claimed, else the wallet. */
|
|
109
|
+
sourceDisplay: z.string(),
|
|
110
|
+
/** Referral level (1 = direct/30%, 2 = 15%, 3 = 5%). */
|
|
111
|
+
level: z.number(),
|
|
112
|
+
/** Reward amount, in RAW atomic units of the token. */
|
|
113
|
+
amount: z.string(),
|
|
114
|
+
/** Reward token contract address (0x-prefixed). */
|
|
115
|
+
token: z.string(),
|
|
116
|
+
/** The referral rate applied, as a decimal fraction (e.g. `0.30` for L1). */
|
|
117
|
+
rateApplied: z.string(),
|
|
118
|
+
/** RFC 3339 timestamp when the reward row was recorded. */
|
|
119
|
+
createdAt: z.string(),
|
|
120
|
+
});
|
|
121
|
+
/** The caller's own referral position: who referred them and what they've earned. */
|
|
122
|
+
export const GetMyReferralPositionResponseSchema = z.object({
|
|
123
|
+
/**
|
|
124
|
+
* Public wallet address of the caller's direct (L1) referrer. Empty string
|
|
125
|
+
* when the caller was not referred. Only the direct referrer is exposed.
|
|
126
|
+
*/
|
|
127
|
+
referrer: z.string(),
|
|
128
|
+
/** Human-facing name for the referrer: their custom handle if claimed, else the wallet (empty when not referred). */
|
|
129
|
+
referrerDisplay: z.string(),
|
|
130
|
+
/** Total reward amount earned across every level and token, in RAW atomic units. */
|
|
131
|
+
totalEarned: z.string(),
|
|
132
|
+
/** The caller's most recent reward rows, newest first (bounded server-side). */
|
|
133
|
+
rewards: z.array(ReferralRewardEntrySchema),
|
|
134
|
+
});
|
|
135
|
+
/** One aggregated earnings row per (source trader, level, token) the caller earns from. */
|
|
136
|
+
export const ReferralEarningsSourceSchema = z.object({
|
|
137
|
+
/** Public wallet address of the trader (taker) the caller earns from. */
|
|
138
|
+
source: z.string(),
|
|
139
|
+
/** Human-facing name for the source: their custom handle if claimed, else the wallet. */
|
|
140
|
+
sourceDisplay: z.string(),
|
|
141
|
+
/** Referral level the caller earns from this source at (1/2/3). */
|
|
142
|
+
level: z.number(),
|
|
143
|
+
/** Total earned from this source at this level and token, in RAW atomic units. */
|
|
144
|
+
totalEarned: z.string(),
|
|
145
|
+
/** Reward token contract address (0x-prefixed). */
|
|
146
|
+
token: z.string(),
|
|
147
|
+
});
|
|
148
|
+
/** One direct (L1) referee of the caller, whether or not they have traded yet. */
|
|
149
|
+
export const ReferralDirectRefereeSchema = z.object({
|
|
150
|
+
/** Public wallet address of the direct referee. */
|
|
151
|
+
wallet: z.string(),
|
|
152
|
+
/** Human-facing name for the referee: their custom handle if claimed, else the wallet. */
|
|
153
|
+
display: z.string(),
|
|
154
|
+
/** RFC 3339 timestamp when the referral relationship was recorded. */
|
|
155
|
+
referredAt: z.string(),
|
|
156
|
+
/** Total the caller has earned from this referee's own (L1) trades, RAW units. `0` if they haven't traded. */
|
|
157
|
+
totalEarned: z.string(),
|
|
158
|
+
});
|
|
159
|
+
/** Per-level breakdown of the caller's total referral earnings. */
|
|
160
|
+
export const ReferralEarningsSummarySchema = z.object({
|
|
161
|
+
/** Total earned across all levels and tokens, in RAW atomic units. */
|
|
162
|
+
totalEarned: z.string(),
|
|
163
|
+
/** Total earned from direct (L1) referees, in RAW atomic units. */
|
|
164
|
+
level1Earned: z.string(),
|
|
165
|
+
/** Total earned from L2 downline, in RAW atomic units. */
|
|
166
|
+
level2Earned: z.string(),
|
|
167
|
+
/** Total earned from L3 downline, in RAW atomic units. */
|
|
168
|
+
level3Earned: z.string(),
|
|
169
|
+
});
|
|
170
|
+
/** The caller's own downline: who they earn from, their L1 roster, and a summary. */
|
|
171
|
+
export const GetMyReferralDownlineResponseSchema = z.object({
|
|
172
|
+
/** One row per (source trader, level, token) the caller earns from, across L1/L2/L3. */
|
|
173
|
+
earningsBySource: z.array(ReferralEarningsSourceSchema),
|
|
174
|
+
/** The caller's direct (L1) referees, newest first, including those who haven't traded. */
|
|
175
|
+
directReferees: z.array(ReferralDirectRefereeSchema),
|
|
176
|
+
/**
|
|
177
|
+
* Total earned broken down by level (L1/L2/L3). The server always populates
|
|
178
|
+
* this — even a brand-new user gets a zeroed summary — so it is required.
|
|
179
|
+
*/
|
|
180
|
+
summary: ReferralEarningsSummarySchema,
|
|
181
|
+
});
|
|
@@ -170,12 +170,13 @@ export interface GetPaginatedOrdersParams {
|
|
|
170
170
|
* - Non-empty: an opaque cursor from a previous response's
|
|
171
171
|
* `nextPageToken`; results resume immediately after that position.
|
|
172
172
|
*
|
|
173
|
-
* In either cursor-walk state (empty or non-empty), `page` is ignored
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* unlike page-number mode, which
|
|
177
|
-
*
|
|
178
|
-
* start, then follow `nextPageToken`)
|
|
173
|
+
* In either cursor-walk state (empty or non-empty), `page` is ignored (it
|
|
174
|
+
* comes back as 0), but `total` and `totalPages` ARE populated — bounded by
|
|
175
|
+
* the server count ceiling, see `totalCapped`. Results cover full order
|
|
176
|
+
* history — hot and archived rows merged — unlike page-number mode, which
|
|
177
|
+
* only ever sees recent history. Clients that need complete order history
|
|
178
|
+
* must use the cursor form (pass `""` to start, then follow `nextPageToken`)
|
|
179
|
+
* rather than `page`.
|
|
179
180
|
*/
|
|
180
181
|
pageToken?: string;
|
|
181
182
|
}
|
|
@@ -186,10 +187,9 @@ export interface GetPaginatedOrdersResponse {
|
|
|
186
187
|
/** Array of historical orders from PostgreSQL (paginated) */
|
|
187
188
|
orders: Order[];
|
|
188
189
|
/**
|
|
189
|
-
* Total number of orders matching the query
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
* cursor mode, which has no exact total. Walk `nextPageToken` instead.
|
|
190
|
+
* Total number of orders matching the query, populated in BOTH pagination
|
|
191
|
+
* modes and bounded by the server count ceiling — see `totalCapped`. When
|
|
192
|
+
* `totalCapped` is `true` this is a lower bound (at least this many exist).
|
|
193
193
|
*/
|
|
194
194
|
total: number;
|
|
195
195
|
/**
|
|
@@ -202,10 +202,9 @@ export interface GetPaginatedOrdersResponse {
|
|
|
202
202
|
/** Number of orders per page */
|
|
203
203
|
pageSize: number;
|
|
204
204
|
/**
|
|
205
|
-
* Total number of pages
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
* cursor mode, which has no exact total. Walk `nextPageToken` instead.
|
|
205
|
+
* Total number of pages at this `pageSize`, populated in BOTH pagination
|
|
206
|
+
* modes and bounded by the server count ceiling — see `totalCapped`. A lower
|
|
207
|
+
* bound when `totalCapped` is `true`.
|
|
209
208
|
*/
|
|
210
209
|
totalPages: number;
|
|
211
210
|
/**
|
|
@@ -223,6 +222,13 @@ export interface GetPaginatedOrdersResponse {
|
|
|
223
222
|
* history.
|
|
224
223
|
*/
|
|
225
224
|
nextPageToken: string;
|
|
225
|
+
/**
|
|
226
|
+
* `true` when MORE than the server ceiling of orders matched, so the count
|
|
227
|
+
* stopped at the ceiling and `total` / `totalPages` are a lower bound (more
|
|
228
|
+
* than `total` orders exist). `false` when `total` is the exact count —
|
|
229
|
+
* including exactly the ceiling, which is still reported exactly.
|
|
230
|
+
*/
|
|
231
|
+
totalCapped: boolean;
|
|
226
232
|
}
|
|
227
233
|
/**
|
|
228
234
|
* Response from getting a single order by ID
|
|
@@ -9,6 +9,22 @@
|
|
|
9
9
|
* A lost key or terminal update need not have a later replacement. Each
|
|
10
10
|
* frame carries the account's full current health, so consume it as a
|
|
11
11
|
* terminal-state snapshot per margin account, never as an additive delta.
|
|
12
|
+
*
|
|
13
|
+
* A subscribe-time snapshot arrives ahead of the live diffs, carrying one row
|
|
14
|
+
* per margin account you own IN THE APPLICATION YOU AUTHENTICATED UNDER -
|
|
15
|
+
* including FLAT accounts, which the live producer never emits for. Live
|
|
16
|
+
* delivery is wider: it is per user and carries no application filter, so if
|
|
17
|
+
* the same wallet trades through more than one application you also receive
|
|
18
|
+
* live frames for those accounts. Do NOT treat an account absent from the
|
|
19
|
+
* snapshot as deleted - merge per `marginAccountId` rather than replacing your
|
|
20
|
+
* whole map. Snapshot rows are this same payload with `sequence` absent; see
|
|
21
|
+
* that field.
|
|
22
|
+
*
|
|
23
|
+
* Live frames emitted before your subscription activated are buffered during
|
|
24
|
+
* the snapshot read and delivered after it, so one can supersede a newer
|
|
25
|
+
* snapshot row. A later frame normally corrects that within the ~30s
|
|
26
|
+
* keepalive; if the account went flat in that window and its final frame never
|
|
27
|
+
* arrived, reconnect to re-seed.
|
|
12
28
|
*/
|
|
13
29
|
/**
|
|
14
30
|
* Account event data carrying the current margin health of a single account.
|
|
@@ -17,23 +33,33 @@ export interface AccountEventData {
|
|
|
17
33
|
/** Margin account this update describes (UUID) */
|
|
18
34
|
marginAccountId: string;
|
|
19
35
|
/**
|
|
20
|
-
* Monotonic per-account counter within one producer run
|
|
21
|
-
* published frames, may SKIP values (at-most-once
|
|
22
|
-
* resets to zero when the producer restarts —
|
|
23
|
-
* WebSocket stays connected, because the socket
|
|
24
|
-
* service. It is therefore never a gap detector and
|
|
25
|
-
* total order.
|
|
36
|
+
* Monotonic per-account counter within one producer run, on LIVE frames
|
|
37
|
+
* only. It advances only on published frames, may SKIP values (at-most-once
|
|
38
|
+
* publishing/delivery), and resets to zero when the producer restarts —
|
|
39
|
+
* which can happen while your WebSocket stays connected, because the socket
|
|
40
|
+
* is owned by a different service. It is therefore never a gap detector and
|
|
41
|
+
* never a cross-restart total order.
|
|
42
|
+
*
|
|
43
|
+
* Dedupe rule, LIVE FRAMES ONLY: order them per account by `updatedAt`,
|
|
44
|
+
* newest wins, and use `sequence` only to break ties between frames carrying
|
|
45
|
+
* the SAME `updatedAt` (those come from the same producer run). A snapshot
|
|
46
|
+
* row is not ranked this way — see below.
|
|
26
47
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
48
|
+
* **Absent on a subscribe-time snapshot row.** The counter belongs to the
|
|
49
|
+
* matching engine's own producer process and the snapshot is served by a
|
|
50
|
+
* different service, which cannot mint one; a `0` would be worse than
|
|
51
|
+
* absent, because it is indistinguishable from a restarted producer's first
|
|
52
|
+
* frame and would make you drop live frames behind the baseline.
|
|
30
53
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
54
|
+
* A snapshot row's `updatedAt` is the instant that account's state was
|
|
55
|
+
* PERSISTED (a database write), while a live frame's is when the engine
|
|
56
|
+
* SAMPLED it. Those clocks are not comparable under persistence lag, so the
|
|
57
|
+
* rule is simply that **a live frame always supersedes a snapshot row for the
|
|
58
|
+
* same `marginAccountId`** — rank `updatedAt` only between live frames, with
|
|
59
|
+
* `sequence` breaking ties inside one producer run, which a snapshot is not
|
|
60
|
+
* part of. Treat `undefined` as "unknown", never as zero.
|
|
35
61
|
*/
|
|
36
|
-
sequence
|
|
62
|
+
sequence?: number;
|
|
37
63
|
/** Mark-inclusive account equity: collateral + unrealized PnL + funding (decimal string) */
|
|
38
64
|
equity: string;
|
|
39
65
|
/** Raw deposited collateral in USD (decimal string) */
|
|
@@ -9,4 +9,20 @@
|
|
|
9
9
|
* A lost key or terminal update need not have a later replacement. Each
|
|
10
10
|
* frame carries the account's full current health, so consume it as a
|
|
11
11
|
* terminal-state snapshot per margin account, never as an additive delta.
|
|
12
|
+
*
|
|
13
|
+
* A subscribe-time snapshot arrives ahead of the live diffs, carrying one row
|
|
14
|
+
* per margin account you own IN THE APPLICATION YOU AUTHENTICATED UNDER -
|
|
15
|
+
* including FLAT accounts, which the live producer never emits for. Live
|
|
16
|
+
* delivery is wider: it is per user and carries no application filter, so if
|
|
17
|
+
* the same wallet trades through more than one application you also receive
|
|
18
|
+
* live frames for those accounts. Do NOT treat an account absent from the
|
|
19
|
+
* snapshot as deleted - merge per `marginAccountId` rather than replacing your
|
|
20
|
+
* whole map. Snapshot rows are this same payload with `sequence` absent; see
|
|
21
|
+
* that field.
|
|
22
|
+
*
|
|
23
|
+
* Live frames emitted before your subscription activated are buffered during
|
|
24
|
+
* the snapshot read and delivered after it, so one can supersede a newer
|
|
25
|
+
* snapshot row. A later frame normally corrects that within the ~30s
|
|
26
|
+
* keepalive; if the account went flat in that window and its final frame never
|
|
27
|
+
* arrived, reconnect to re-seed.
|
|
12
28
|
*/
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
* hand-written SDK surface. CI regenerates it and fails on a diff, identical to
|
|
11
11
|
* the `schema.ts` wire-types tripwire (MON-1476), so it can never go stale.
|
|
12
12
|
*/
|
|
13
|
-
export declare const OPERATION_IDS: readonly ["attach_position_tp_sl", "batch_cancel_all", "batch_cancel_all_by_pair", "batch_cancel_orders", "batch_close_all_positions", "batch_create_orders", "batch_replace_orders", "cancel_conditional_order", "cancel_order", "cancel_twap_order", "check_trader_code_availability", "claim_buildercode_rewards", "claim_managed_market_lease", "clear_trader_code", "close_position", "create_challenge", "create_delegated_session", "create_order", "create_sub_account_limit", "create_twap_order", "delete_sub_account_limit", "get_application_config", "get_application_stats", "get_available_collateral", "get_buildercode_payout_summary", "get_buildercode_rewards_balance", "get_buildercodes_config", "get_candles", "get_conditional_order", "get_faucet_info", "get_funding_state", "get_index_price", "get_margin_account_movements", "get_margin_account_summary", "get_mark_price", "get_market_metadata", "get_market_stats", "get_my_fee_tier", "get_my_trader_code", "get_open_interest", "get_order_by_id", "get_orderbook_snapshot", "get_orders", "get_parent_margin_account_movements", "get_parent_margin_account_summary", "get_perp_market_config", "get_perp_market_summary", "get_portfolio_assets", "get_portfolio_chart", "get_portfolio_margin", "get_portfolio_performance", "get_portfolio_realized_pnl", "get_portfolio_stats", "get_portfolio_summary", "get_position", "get_position_pnl_history", "get_position_risk", "get_pulse", "get_rewards_balance", "get_screener", "get_self_trade_prevention_default", "get_sub_account_limits", "get_sweeper_chains", "get_trade_by_id", "get_trader_code_info", "get_trades", "get_trading_pair_by_id", "get_twap_order", "get_twap_order_tca", "get_user_balance_by_asset", "get_user_balances", "get_user_movements", "get_user_profile", "get_user_trades", "get_withdrawal", "health_check", "initiate_withdrawal", "list_all_funding_history", "list_application_balances", "list_application_movements", "list_application_orders", "list_application_users", "list_buildercode_payouts", "list_conditional_orders", "list_delegated_agent_owners", "list_delegated_agents", "list_funding_history", "list_funding_payments", "list_managed_market_assignments", "list_margin_accounts", "list_pending_withdrawals", "list_position_history", "list_positions", "list_sub_accounts_with_balances", "list_trading_pairs", "list_twap_orders", "mint_tokens", "refresh_managed_market_quotes", "refresh_session", "register_deposit_address", "replace_order", "revoke_delegated_agent", "revoke_session", "set_self_trade_prevention_default", "set_trader_code", "simulate_fees", "simulate_order_risk", "simulate_parent_margin_order_risk", "simulate_risk_bucket_order_risk", "submit_whitelist", "transfer_collateral_from_margin_account", "transfer_collateral_from_parent_margin_account", "transfer_collateral_to_margin_account", "transfer_collateral_to_parent_margin_account", "transfer_collateral_to_risk_bucket", "transfer_rewards", "update_sub_account_limit", "upsert_delegated_agent", "verify_signature"];
|
|
13
|
+
export declare const OPERATION_IDS: readonly ["attach_position_tp_sl", "batch_cancel_all", "batch_cancel_all_by_pair", "batch_cancel_orders", "batch_close_all_positions", "batch_create_orders", "batch_replace_orders", "cancel_conditional_order", "cancel_order", "cancel_twap_order", "check_trader_code_availability", "claim_buildercode_rewards", "claim_managed_market_lease", "clear_trader_code", "close_position", "create_challenge", "create_delegated_session", "create_order", "create_sub_account_limit", "create_twap_order", "delete_sub_account_limit", "get_application_config", "get_application_stats", "get_available_collateral", "get_buildercode_payout_summary", "get_buildercode_rewards_balance", "get_buildercodes_config", "get_candles", "get_conditional_order", "get_faucet_info", "get_funding_state", "get_index_price", "get_margin_account_movements", "get_margin_account_summary", "get_mark_price", "get_market_metadata", "get_market_stats", "get_my_fee_tier", "get_my_referral_downline", "get_my_referral_position", "get_my_trader_code", "get_open_interest", "get_order_by_id", "get_orderbook_snapshot", "get_orders", "get_parent_margin_account_movements", "get_parent_margin_account_summary", "get_perp_market_config", "get_perp_market_summary", "get_portfolio_assets", "get_portfolio_chart", "get_portfolio_margin", "get_portfolio_performance", "get_portfolio_realized_pnl", "get_portfolio_stats", "get_portfolio_summary", "get_position", "get_position_pnl_history", "get_position_risk", "get_pulse", "get_rewards_balance", "get_screener", "get_self_trade_prevention_default", "get_sub_account_limits", "get_sweeper_chains", "get_trade_by_id", "get_trader_code_info", "get_trades", "get_trading_pair_by_id", "get_twap_order", "get_twap_order_tca", "get_user_balance_by_asset", "get_user_balances", "get_user_movements", "get_user_profile", "get_user_trades", "get_withdrawal", "health_check", "initiate_withdrawal", "list_all_funding_history", "list_application_balances", "list_application_movements", "list_application_orders", "list_application_users", "list_buildercode_payouts", "list_conditional_orders", "list_delegated_agent_owners", "list_delegated_agents", "list_funding_history", "list_funding_payments", "list_managed_market_assignments", "list_margin_accounts", "list_pending_withdrawals", "list_position_history", "list_positions", "list_sub_accounts_with_balances", "list_trading_pairs", "list_twap_orders", "mint_tokens", "refresh_managed_market_quotes", "refresh_session", "register_deposit_address", "replace_order", "revoke_delegated_agent", "revoke_session", "set_self_trade_prevention_default", "set_trader_code", "simulate_fees", "simulate_order_risk", "simulate_parent_margin_order_risk", "simulate_risk_bucket_order_risk", "submit_whitelist", "transfer_collateral_from_margin_account", "transfer_collateral_from_parent_margin_account", "transfer_collateral_to_margin_account", "transfer_collateral_to_parent_margin_account", "transfer_collateral_to_risk_bucket", "transfer_rewards", "update_sub_account_limit", "upsert_delegated_agent", "verify_signature"];
|
|
14
14
|
/** Union of every OpenAPI operationId in the spec. */
|
|
15
15
|
export type OperationId = (typeof OPERATION_IDS)[number];
|
package/dist/wire/operations.js
CHANGED
package/dist/wire/schema.d.ts
CHANGED
|
@@ -2166,6 +2166,61 @@ export interface paths {
|
|
|
2166
2166
|
patch?: never;
|
|
2167
2167
|
trace?: never;
|
|
2168
2168
|
};
|
|
2169
|
+
"/api/v1/pitpass/referrals/me": {
|
|
2170
|
+
parameters: {
|
|
2171
|
+
query?: never;
|
|
2172
|
+
header?: never;
|
|
2173
|
+
path?: never;
|
|
2174
|
+
cookie?: never;
|
|
2175
|
+
};
|
|
2176
|
+
/**
|
|
2177
|
+
* Get your referral position
|
|
2178
|
+
* @description Read your own referral position (self-scoped).
|
|
2179
|
+
*
|
|
2180
|
+
* Return the authenticated caller's referral position: their direct (L1)
|
|
2181
|
+
* referrer, the total rewards they have earned, and their most recent reward
|
|
2182
|
+
* rows. Self-scoped — identity comes only from the session, never a path id,
|
|
2183
|
+
* so a caller can only ever read their own chain. Every other user is
|
|
2184
|
+
* identified by their public wallet address, never an internal id. An empty
|
|
2185
|
+
* `referrer` means the caller was not referred.
|
|
2186
|
+
*/
|
|
2187
|
+
get: operations["get_my_referral_position"];
|
|
2188
|
+
put?: never;
|
|
2189
|
+
post?: never;
|
|
2190
|
+
delete?: never;
|
|
2191
|
+
options?: never;
|
|
2192
|
+
head?: never;
|
|
2193
|
+
patch?: never;
|
|
2194
|
+
trace?: never;
|
|
2195
|
+
};
|
|
2196
|
+
"/api/v1/pitpass/referrals/me/downline": {
|
|
2197
|
+
parameters: {
|
|
2198
|
+
query?: never;
|
|
2199
|
+
header?: never;
|
|
2200
|
+
path?: never;
|
|
2201
|
+
cookie?: never;
|
|
2202
|
+
};
|
|
2203
|
+
/**
|
|
2204
|
+
* Get your referral downline and earnings
|
|
2205
|
+
* @description Read your own downline earnings (self-scoped).
|
|
2206
|
+
*
|
|
2207
|
+
* Return who the authenticated caller earns from and how much: an
|
|
2208
|
+
* earnings-by-source breakdown aggregated from the caller's reward rows across
|
|
2209
|
+
* all three reward levels (L1/L2/L3), their L1 direct-referee roster (including
|
|
2210
|
+
* referees who have not traded yet), and a per-level earnings summary.
|
|
2211
|
+
* Self-scoped — identity comes only from the session, never a path id. Every
|
|
2212
|
+
* source and referee is identified by their public wallet address, never an
|
|
2213
|
+
* internal id.
|
|
2214
|
+
*/
|
|
2215
|
+
get: operations["get_my_referral_downline"];
|
|
2216
|
+
put?: never;
|
|
2217
|
+
post?: never;
|
|
2218
|
+
delete?: never;
|
|
2219
|
+
options?: never;
|
|
2220
|
+
head?: never;
|
|
2221
|
+
patch?: never;
|
|
2222
|
+
trace?: never;
|
|
2223
|
+
};
|
|
2169
2224
|
"/api/v1/pitpass/rewards/balance": {
|
|
2170
2225
|
parameters: {
|
|
2171
2226
|
query?: never;
|
|
@@ -4811,6 +4866,33 @@ export interface components {
|
|
|
4811
4866
|
/** @description Six-row fee schedule for the requested pair, ascending by tier */
|
|
4812
4867
|
feeSchedule?: components["schemas"]["FeeTierScheduleRow"][] | null;
|
|
4813
4868
|
};
|
|
4869
|
+
GetMyReferralDownlineResponse: {
|
|
4870
|
+
/** @description One row per (source trader, level, token) the caller earns from, across all three reward levels. Comes straight from the caller's reward rows — no tree walk. */
|
|
4871
|
+
earningsBySource?: components["schemas"]["ReferralEarningsSource"][] | null;
|
|
4872
|
+
/** @description The caller's direct (L1) referees, newest first, including referees who have not traded yet (0 earned). Bounded to the most recent 500 EFFECTIVE referees (after per-wallet dedupe and the winning-edge filter). The earnings views (`earnings_by_source` and the summary) are unbounded and count every level, so a caller past the roster cap still sees their full earnings; only this roster listing is capped. */
|
|
4873
|
+
directReferees?: components["schemas"]["ReferralDirectReferee"][] | null;
|
|
4874
|
+
/** @description Total earned broken down by level (L1/L2/L3). */
|
|
4875
|
+
summary?: components["schemas"]["ReferralEarningsSummary"] | null;
|
|
4876
|
+
};
|
|
4877
|
+
GetMyReferralPositionResponse: {
|
|
4878
|
+
/**
|
|
4879
|
+
* @description Public wallet address of the caller's direct (L1) referrer — who referred them. Empty when the caller was not referred. Never exposes L2/L3 upline or any internal id.
|
|
4880
|
+
* @example 0x0000000000000000000000000000000000000002
|
|
4881
|
+
*/
|
|
4882
|
+
referrer?: string | null;
|
|
4883
|
+
/**
|
|
4884
|
+
* @description Total reward amount the caller has earned, summed across every level and token, in RAW atomic units.
|
|
4885
|
+
* @example 1400000
|
|
4886
|
+
*/
|
|
4887
|
+
totalEarned?: string | null;
|
|
4888
|
+
/**
|
|
4889
|
+
* @description Human-facing name for the referrer: their custom TraderCode handle when they have claimed one, otherwise the wallet address (same as `referrer`). Empty when the caller was not referred. Render this instead of raw hex.
|
|
4890
|
+
* @example cooltrader123
|
|
4891
|
+
*/
|
|
4892
|
+
referrerDisplay?: string | null;
|
|
4893
|
+
/** @description The caller's most recent reward rows, newest first. Bounded server-side — not the full history. */
|
|
4894
|
+
rewards?: components["schemas"]["ReferralRewardEntry"][] | null;
|
|
4895
|
+
};
|
|
4814
4896
|
/** @description Latest public open interest for a trading pair. */
|
|
4815
4897
|
GetOpenInterestResponse: {
|
|
4816
4898
|
/**
|
|
@@ -6028,7 +6110,7 @@ export interface components {
|
|
|
6028
6110
|
movements?: components["schemas"]["ApplicationMovement"][] | null;
|
|
6029
6111
|
/**
|
|
6030
6112
|
* Format: uint32
|
|
6031
|
-
* @description
|
|
6113
|
+
* @description Matching movements. Exact up to 10,000 pages of the requested page size (page_size x 10,000 rows) and saturates there, so an application with more matching movements than the listing can page through reads the cap, not its lifetime total.
|
|
6032
6114
|
* @example 150
|
|
6033
6115
|
*/
|
|
6034
6116
|
total?: number | null;
|
|
@@ -6046,7 +6128,7 @@ export interface components {
|
|
|
6046
6128
|
pageSize?: number | null;
|
|
6047
6129
|
/**
|
|
6048
6130
|
* Format: uint32
|
|
6049
|
-
* @description
|
|
6131
|
+
* @description Number of pages at the requested page size. Exact up to 10,000 and saturates there, the last page this listing can reach.
|
|
6050
6132
|
* @example 8
|
|
6051
6133
|
*/
|
|
6052
6134
|
totalPages?: number | null;
|
|
@@ -6055,7 +6137,7 @@ export interface components {
|
|
|
6055
6137
|
orders?: components["schemas"]["ApplicationOrder"][] | null;
|
|
6056
6138
|
/**
|
|
6057
6139
|
* Format: uint32
|
|
6058
|
-
* @description
|
|
6140
|
+
* @description Matching orders. Exact up to 10,000 pages of the requested page size (page_size x 10,000 rows) and saturates there, so an application with more matching orders than the listing can page through reads the cap, not its lifetime total.
|
|
6059
6141
|
* @example 150
|
|
6060
6142
|
*/
|
|
6061
6143
|
total?: number | null;
|
|
@@ -6073,7 +6155,7 @@ export interface components {
|
|
|
6073
6155
|
pageSize?: number | null;
|
|
6074
6156
|
/**
|
|
6075
6157
|
* Format: uint32
|
|
6076
|
-
* @description
|
|
6158
|
+
* @description Number of pages at the requested page size. Exact up to 10,000 and saturates there, the last page this listing can reach.
|
|
6077
6159
|
* @example 8
|
|
6078
6160
|
*/
|
|
6079
6161
|
totalPages?: number | null;
|
|
@@ -6206,8 +6288,7 @@ export interface components {
|
|
|
6206
6288
|
orders?: components["schemas"]["GetOrderResponse"][] | null;
|
|
6207
6289
|
/**
|
|
6208
6290
|
* Format: uint32
|
|
6209
|
-
* @
|
|
6210
|
-
* @description Deprecated: total number of orders matching the filter (legacy offset mode only; 0 in cursor mode)
|
|
6291
|
+
* @description Total number of orders matching the filter, populated in both pagination modes; bounded by the server ceiling — a lower bound when totalCapped is true.
|
|
6211
6292
|
* @example 150
|
|
6212
6293
|
*/
|
|
6213
6294
|
total?: number | null;
|
|
@@ -6226,8 +6307,7 @@ export interface components {
|
|
|
6226
6307
|
pageSize?: number | null;
|
|
6227
6308
|
/**
|
|
6228
6309
|
* Format: uint32
|
|
6229
|
-
* @
|
|
6230
|
-
* @description Deprecated: total number of pages (legacy offset mode only; 0 in cursor mode)
|
|
6310
|
+
* @description Total number of pages at this pageSize, populated in both pagination modes; bounded by the server ceiling — a lower bound when totalCapped is true.
|
|
6231
6311
|
* @example 8
|
|
6232
6312
|
*/
|
|
6233
6313
|
totalPages?: number | null;
|
|
@@ -6247,6 +6327,11 @@ export interface components {
|
|
|
6247
6327
|
* means page-number mode does not participate in cursor continuation.
|
|
6248
6328
|
*/
|
|
6249
6329
|
nextPageToken?: string | null;
|
|
6330
|
+
/**
|
|
6331
|
+
* @description True when more than the server ceiling of orders matched, so the count stopped at the ceiling and total/totalPages are a lower bound (more than total exist). False when total is the exact count, including exactly the ceiling.
|
|
6332
|
+
* @example false
|
|
6333
|
+
*/
|
|
6334
|
+
totalCapped?: boolean | null;
|
|
6250
6335
|
};
|
|
6251
6336
|
ListPendingWithdrawalsResponse: {
|
|
6252
6337
|
withdrawals?: components["schemas"]["PendingWithdrawal"][] | null;
|
|
@@ -7295,6 +7380,136 @@ export interface components {
|
|
|
7295
7380
|
*/
|
|
7296
7381
|
relevance?: number | null;
|
|
7297
7382
|
};
|
|
7383
|
+
/** @description One direct (L1) referee of the caller, whether or not they have traded yet. */
|
|
7384
|
+
ReferralDirectReferee: {
|
|
7385
|
+
/**
|
|
7386
|
+
* @description Public wallet address of the direct referee. Never an internal id.
|
|
7387
|
+
* @example 0x0000000000000000000000000000000000000002
|
|
7388
|
+
*/
|
|
7389
|
+
wallet?: string | null;
|
|
7390
|
+
/**
|
|
7391
|
+
* @description RFC 3339 timestamp when the referral relationship was recorded (the referee's sign-up under the caller).
|
|
7392
|
+
* @example 2026-07-07T18:00:00Z
|
|
7393
|
+
*/
|
|
7394
|
+
referredAt?: string | null;
|
|
7395
|
+
/**
|
|
7396
|
+
* @description Total the caller has earned from this referee's own (L1) trades, in RAW atomic units. `0` for a referee who has not traded yet.
|
|
7397
|
+
* @example 900000
|
|
7398
|
+
*/
|
|
7399
|
+
totalEarned?: string | null;
|
|
7400
|
+
/**
|
|
7401
|
+
* @description Human-facing name for the referee: their custom TraderCode handle when they have claimed one, otherwise the wallet address (same as `wallet`). Render this instead of raw hex.
|
|
7402
|
+
* @example cooltrader123
|
|
7403
|
+
*/
|
|
7404
|
+
display?: string | null;
|
|
7405
|
+
};
|
|
7406
|
+
/**
|
|
7407
|
+
* @description One aggregated earnings row per (source trader, level, token) the caller
|
|
7408
|
+
* earns from.
|
|
7409
|
+
*/
|
|
7410
|
+
ReferralEarningsSource: {
|
|
7411
|
+
/**
|
|
7412
|
+
* @description Public wallet address of the trader (taker) the caller earns from. Never an internal id.
|
|
7413
|
+
* @example 0x0000000000000000000000000000000000000002
|
|
7414
|
+
*/
|
|
7415
|
+
source?: string | null;
|
|
7416
|
+
/**
|
|
7417
|
+
* Format: int32
|
|
7418
|
+
* @description Referral level the caller earns from this source at: 1 (direct), 2, or 3.
|
|
7419
|
+
* @example 1
|
|
7420
|
+
*/
|
|
7421
|
+
level?: number | null;
|
|
7422
|
+
/**
|
|
7423
|
+
* @description Total earned from this source at this level and token, in RAW atomic units.
|
|
7424
|
+
* @example 900000
|
|
7425
|
+
*/
|
|
7426
|
+
totalEarned?: string | null;
|
|
7427
|
+
/**
|
|
7428
|
+
* @description Reward token contract address (0x-prefixed).
|
|
7429
|
+
* @example 0x0000000000000000000000000000000000000002
|
|
7430
|
+
*/
|
|
7431
|
+
token?: string | null;
|
|
7432
|
+
/**
|
|
7433
|
+
* @description Human-facing name for the source: their custom TraderCode handle when they have claimed one, otherwise the wallet address (same as `source`). Render this instead of raw hex.
|
|
7434
|
+
* @example cooltrader123
|
|
7435
|
+
*/
|
|
7436
|
+
sourceDisplay?: string | null;
|
|
7437
|
+
};
|
|
7438
|
+
/**
|
|
7439
|
+
* @description Per-level breakdown of the caller's total referral earnings.
|
|
7440
|
+
*
|
|
7441
|
+
* These are ALL-TIME CREDITED earnings — a raw sum of the immutable
|
|
7442
|
+
* `referral_rewards` audit rows — and match the `total_earned` on the referral
|
|
7443
|
+
* position. They are NOT the caller's current spendable rewards balance:
|
|
7444
|
+
* `GetRewardsBalance` reports the live bucket, which `TransferRewards` draws
|
|
7445
|
+
* down, so the two diverge after any transfer. Read the rewards balance for
|
|
7446
|
+
* current availability. Denominated in the single reward token's atomic units
|
|
7447
|
+
* (Monaco pays PitPass rewards in one token — the quote asset); if a deployment
|
|
7448
|
+
* ever pays in more than one reward token, atomic units across tokens are not
|
|
7449
|
+
* additive, so read the per-token `earnings_by_source` rows for a correct
|
|
7450
|
+
* breakdown.
|
|
7451
|
+
*/
|
|
7452
|
+
ReferralEarningsSummary: {
|
|
7453
|
+
/**
|
|
7454
|
+
* @description All-time credited earnings across all levels, in the reward token's RAW atomic units (see the message note — this is not the spendable rewards balance).
|
|
7455
|
+
* @example 1400000
|
|
7456
|
+
*/
|
|
7457
|
+
totalEarned?: string | null;
|
|
7458
|
+
/**
|
|
7459
|
+
* @description Total earned from direct (L1) referees, in RAW atomic units.
|
|
7460
|
+
* @example 900000
|
|
7461
|
+
*/
|
|
7462
|
+
level1Earned?: string | null;
|
|
7463
|
+
/**
|
|
7464
|
+
* @description Total earned from L2 downline, in RAW atomic units.
|
|
7465
|
+
* @example 400000
|
|
7466
|
+
*/
|
|
7467
|
+
level2Earned?: string | null;
|
|
7468
|
+
/**
|
|
7469
|
+
* @description Total earned from L3 downline, in RAW atomic units.
|
|
7470
|
+
* @example 100000
|
|
7471
|
+
*/
|
|
7472
|
+
level3Earned?: string | null;
|
|
7473
|
+
};
|
|
7474
|
+
/** @description A single reward the caller has earned, one row per referred trade × level. */
|
|
7475
|
+
ReferralRewardEntry: {
|
|
7476
|
+
/**
|
|
7477
|
+
* @description Public wallet address of the trader (taker) whose trade generated this reward. Never an internal id.
|
|
7478
|
+
* @example 0x0000000000000000000000000000000000000002
|
|
7479
|
+
*/
|
|
7480
|
+
source?: string | null;
|
|
7481
|
+
/**
|
|
7482
|
+
* Format: int32
|
|
7483
|
+
* @description Referral level this reward was paid at: 1 (direct, 30%), 2 (15%), or 3 (5%).
|
|
7484
|
+
* @example 1
|
|
7485
|
+
*/
|
|
7486
|
+
level?: number | null;
|
|
7487
|
+
/**
|
|
7488
|
+
* @description Reward amount, in RAW atomic units of the token.
|
|
7489
|
+
* @example 1200000
|
|
7490
|
+
*/
|
|
7491
|
+
amount?: string | null;
|
|
7492
|
+
/**
|
|
7493
|
+
* @description Reward token contract address (0x-prefixed).
|
|
7494
|
+
* @example 0x0000000000000000000000000000000000000002
|
|
7495
|
+
*/
|
|
7496
|
+
token?: string | null;
|
|
7497
|
+
/**
|
|
7498
|
+
* @description The referral rate applied to the source's fee for this reward, as a decimal fraction (e.g. `0.30` for L1).
|
|
7499
|
+
* @example 0.30
|
|
7500
|
+
*/
|
|
7501
|
+
rateApplied?: string | null;
|
|
7502
|
+
/**
|
|
7503
|
+
* @description RFC 3339 timestamp when the reward row was recorded.
|
|
7504
|
+
* @example 2026-07-07T18:00:00Z
|
|
7505
|
+
*/
|
|
7506
|
+
createdAt?: string | null;
|
|
7507
|
+
/**
|
|
7508
|
+
* @description Human-facing name for the source: their custom TraderCode handle when they have claimed one, otherwise the wallet address (same as `source`). Render this instead of raw hex.
|
|
7509
|
+
* @example cooltrader123
|
|
7510
|
+
*/
|
|
7511
|
+
sourceDisplay?: string | null;
|
|
7512
|
+
};
|
|
7298
7513
|
RefreshManagedMarketQuotesRequest: {
|
|
7299
7514
|
launchId?: string | null;
|
|
7300
7515
|
ownerId?: string | null;
|
|
@@ -8853,6 +9068,16 @@ export interface components {
|
|
|
8853
9068
|
*/
|
|
8854
9069
|
expiresAt?: number | null;
|
|
8855
9070
|
user?: components["schemas"]["UserInfo"];
|
|
9071
|
+
/**
|
|
9072
|
+
* @description True when this verify created the user row — the wallet's first sign-in to THIS application. Identity is per `(wallet, application)`, so a wallet already registered on another application is still `is_new_user` on its first sign-in to a new one. Use it to gate first-time UX (e.g. showing the optional "have a referral code?" input only to new users) and to confirm a fresh sign-up. False for every returning verify on this application.
|
|
9073
|
+
* @example true
|
|
9074
|
+
*/
|
|
9075
|
+
isNewUser?: boolean | null;
|
|
9076
|
+
/**
|
|
9077
|
+
* @description True when a PitPass referral relationship was recorded on this verify: a valid, non-self TraderCode presented on the wallet's first sign-in to THIS application resolved to a known referrer. Scoped like `is_new_user` (per `(wallet, application)`), so a wallet already registered on another application can still see this on its first sign-in to a new one. False for a returning user of this application, an absent or unknown code, or a self-referral. Confirms the referral landed for the signup success screen.
|
|
9078
|
+
* @example true
|
|
9079
|
+
*/
|
|
9080
|
+
referralApplied?: boolean | null;
|
|
8856
9081
|
};
|
|
8857
9082
|
Withdrawal: {
|
|
8858
9083
|
/**
|
|
@@ -12428,13 +12653,14 @@ export interface operations {
|
|
|
12428
12653
|
* - Non-empty: an opaque cursor from a previous response's
|
|
12429
12654
|
* `next_page_token`; results resume immediately after that position.
|
|
12430
12655
|
*
|
|
12431
|
-
* In either cursor-walk state (empty or non-empty), `page` is ignored
|
|
12432
|
-
*
|
|
12433
|
-
*
|
|
12434
|
-
*
|
|
12435
|
-
*
|
|
12436
|
-
*
|
|
12437
|
-
*
|
|
12656
|
+
* In either cursor-walk state (empty or non-empty), `page` is ignored (it
|
|
12657
|
+
* comes back as 0), but `total` and `total_pages` ARE populated — bounded by
|
|
12658
|
+
* the server count ceiling, see `total_capped`. Results cover full order
|
|
12659
|
+
* history — hot and archived rows merged — unlike page-number mode, which
|
|
12660
|
+
* only ever sees recent history. Clients that need complete order history
|
|
12661
|
+
* must use the cursor form (start with an empty string, then follow
|
|
12662
|
+
* next_page_token) rather than `page`. Filters and orderBy must match the
|
|
12663
|
+
* request that produced the token.
|
|
12438
12664
|
*/
|
|
12439
12665
|
pageToken?: string;
|
|
12440
12666
|
};
|
|
@@ -13600,6 +13826,88 @@ export interface operations {
|
|
|
13600
13826
|
};
|
|
13601
13827
|
};
|
|
13602
13828
|
};
|
|
13829
|
+
get_my_referral_position: {
|
|
13830
|
+
parameters: {
|
|
13831
|
+
query?: never;
|
|
13832
|
+
header?: never;
|
|
13833
|
+
path?: never;
|
|
13834
|
+
cookie?: never;
|
|
13835
|
+
};
|
|
13836
|
+
requestBody?: never;
|
|
13837
|
+
responses: {
|
|
13838
|
+
/** @description OK */
|
|
13839
|
+
200: {
|
|
13840
|
+
headers: {
|
|
13841
|
+
[name: string]: unknown;
|
|
13842
|
+
};
|
|
13843
|
+
content: {
|
|
13844
|
+
"application/json": components["schemas"]["GetMyReferralPositionResponse"];
|
|
13845
|
+
};
|
|
13846
|
+
};
|
|
13847
|
+
/** @description Authentication required */
|
|
13848
|
+
401: {
|
|
13849
|
+
headers: {
|
|
13850
|
+
[name: string]: unknown;
|
|
13851
|
+
};
|
|
13852
|
+
content?: never;
|
|
13853
|
+
};
|
|
13854
|
+
/** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
|
|
13855
|
+
429: {
|
|
13856
|
+
headers: {
|
|
13857
|
+
[name: string]: unknown;
|
|
13858
|
+
};
|
|
13859
|
+
content?: never;
|
|
13860
|
+
};
|
|
13861
|
+
/** @description Internal server error */
|
|
13862
|
+
500: {
|
|
13863
|
+
headers: {
|
|
13864
|
+
[name: string]: unknown;
|
|
13865
|
+
};
|
|
13866
|
+
content?: never;
|
|
13867
|
+
};
|
|
13868
|
+
};
|
|
13869
|
+
};
|
|
13870
|
+
get_my_referral_downline: {
|
|
13871
|
+
parameters: {
|
|
13872
|
+
query?: never;
|
|
13873
|
+
header?: never;
|
|
13874
|
+
path?: never;
|
|
13875
|
+
cookie?: never;
|
|
13876
|
+
};
|
|
13877
|
+
requestBody?: never;
|
|
13878
|
+
responses: {
|
|
13879
|
+
/** @description OK */
|
|
13880
|
+
200: {
|
|
13881
|
+
headers: {
|
|
13882
|
+
[name: string]: unknown;
|
|
13883
|
+
};
|
|
13884
|
+
content: {
|
|
13885
|
+
"application/json": components["schemas"]["GetMyReferralDownlineResponse"];
|
|
13886
|
+
};
|
|
13887
|
+
};
|
|
13888
|
+
/** @description Authentication required */
|
|
13889
|
+
401: {
|
|
13890
|
+
headers: {
|
|
13891
|
+
[name: string]: unknown;
|
|
13892
|
+
};
|
|
13893
|
+
content?: never;
|
|
13894
|
+
};
|
|
13895
|
+
/** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
|
|
13896
|
+
429: {
|
|
13897
|
+
headers: {
|
|
13898
|
+
[name: string]: unknown;
|
|
13899
|
+
};
|
|
13900
|
+
content?: never;
|
|
13901
|
+
};
|
|
13902
|
+
/** @description Internal server error */
|
|
13903
|
+
500: {
|
|
13904
|
+
headers: {
|
|
13905
|
+
[name: string]: unknown;
|
|
13906
|
+
};
|
|
13907
|
+
content?: never;
|
|
13908
|
+
};
|
|
13909
|
+
};
|
|
13910
|
+
};
|
|
13603
13911
|
get_rewards_balance: {
|
|
13604
13912
|
parameters: {
|
|
13605
13913
|
query?: never;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.64",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"homepage": "https://docs.0xmonaco.com/sdk/typescript",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"lint": "biome lint ."
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@0xmonaco/contracts": "1.0.
|
|
19
|
+
"@0xmonaco/contracts": "1.0.64",
|
|
20
20
|
"zod": "^4.1.12"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|