@0xmonaco/types 1.0.90 → 1.0.92
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 +4 -4
- package/dist/auth/index.d.ts +14 -0
- package/dist/auth/index.js +13 -0
- package/dist/buildercodes/index.d.ts +4 -2
- package/dist/compliance/index.d.ts +32 -0
- package/dist/compliance/index.js +10 -0
- package/dist/fees/responses.d.ts +0 -2
- package/dist/fees/responses.js +0 -12
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/margin-accounts/index.d.ts +32 -0
- package/dist/portfolio/index.d.ts +6 -0
- package/dist/sdk/index.d.ts +3 -0
- package/dist/validation/margin-accounts.d.ts +7 -0
- package/dist/validation/margin-accounts.js +5 -1
- package/dist/websocket/base.d.ts +5 -2
- package/dist/wire/operations.d.ts +1 -1
- package/dist/wire/operations.js +1 -0
- package/dist/wire/schema.d.ts +91 -23
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ import { MonacoSDK, SDKConfig } from "@0xmonaco/types";
|
|
|
22
22
|
// SDK configuration
|
|
23
23
|
interface SDKConfig {
|
|
24
24
|
walletClient?: WalletClient; // Wallet client for signing operations
|
|
25
|
-
network: Network; // Use "
|
|
25
|
+
network: Network; // Use "mainnet" (Sei mainnet, production API)
|
|
26
26
|
seiRpcUrl: string; // RPC URL for Sei blockchain interactions
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -305,7 +305,7 @@ Types for network configuration:
|
|
|
305
305
|
```typescript
|
|
306
306
|
import { Network, NetworkEndpoints } from "@0xmonaco/types";
|
|
307
307
|
|
|
308
|
-
const publicNetwork: Network = "
|
|
308
|
+
const publicNetwork: Network = "mainnet";
|
|
309
309
|
|
|
310
310
|
interface NetworkEndpoints {
|
|
311
311
|
rpcUrl: string;
|
|
@@ -313,7 +313,7 @@ interface NetworkEndpoints {
|
|
|
313
313
|
}
|
|
314
314
|
```
|
|
315
315
|
|
|
316
|
-
For public integrations, use `"
|
|
316
|
+
For public integrations, use `"mainnet"`.
|
|
317
317
|
|
|
318
318
|
## Type Reference
|
|
319
319
|
|
|
@@ -321,7 +321,7 @@ For public integrations, use `"staging"` or `"mainnet"`.
|
|
|
321
321
|
|
|
322
322
|
- `MonacoSDK`: Main SDK interface with all API modules
|
|
323
323
|
- `SDKConfig`: Configuration options for the Monaco SDK
|
|
324
|
-
- `Network`: SDK network preset type. Public integrations should use `"
|
|
324
|
+
- `Network`: SDK network preset type. Public integrations should use `"mainnet"`.
|
|
325
325
|
- `AuthState`: Authentication state information
|
|
326
326
|
|
|
327
327
|
### Vault Types
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -164,3 +164,17 @@ export declare const INVITE_ERROR_CODES: {
|
|
|
164
164
|
readonly INVITE_CODE_INVALID: "INVITE_CODE_INVALID";
|
|
165
165
|
};
|
|
166
166
|
export type InviteErrorCode = (typeof INVITE_ERROR_CODES)[keyof typeof INVITE_ERROR_CODES];
|
|
167
|
+
/**
|
|
168
|
+
* Stable codes for a wallet on the OFAC sanctions list, read from
|
|
169
|
+
* `APIError.serverCode` (REST error envelope `code`, which here is also the
|
|
170
|
+
* envelope `error`; gRPC `google.rpc.ErrorInfo` reason in the
|
|
171
|
+
* `auth.0xmonaco.com` domain). Both are HTTP 403 / gRPC `PERMISSION_DENIED`,
|
|
172
|
+
* and the envelope `message` is meant to be shown to the user as-is.
|
|
173
|
+
*/
|
|
174
|
+
export declare const SANCTIONS_ERROR_CODES: {
|
|
175
|
+
/** Sign-in with a listed wallet, or a withdrawal to a listed destination. */
|
|
176
|
+
readonly ADDRESS_RESTRICTED: "ADDRESS_RESTRICTED";
|
|
177
|
+
/** A live session whose wallet (or delegated agent) is listed; returned on every signed request and on WebSocket authentication/revalidation. */
|
|
178
|
+
readonly ACCOUNT_RESTRICTED: "ACCOUNT_RESTRICTED";
|
|
179
|
+
};
|
|
180
|
+
export type SanctionsErrorCode = (typeof SANCTIONS_ERROR_CODES)[keyof typeof SANCTIONS_ERROR_CODES];
|
package/dist/auth/index.js
CHANGED
|
@@ -20,3 +20,16 @@ export const INVITE_ERROR_CODES = {
|
|
|
20
20
|
/** The invite code was not accepted (wrong, already redeemed, revoked, or issued by a deactivated wallet; deliberately indistinguishable). */
|
|
21
21
|
INVITE_CODE_INVALID: "INVITE_CODE_INVALID",
|
|
22
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* Stable codes for a wallet on the OFAC sanctions list, read from
|
|
25
|
+
* `APIError.serverCode` (REST error envelope `code`, which here is also the
|
|
26
|
+
* envelope `error`; gRPC `google.rpc.ErrorInfo` reason in the
|
|
27
|
+
* `auth.0xmonaco.com` domain). Both are HTTP 403 / gRPC `PERMISSION_DENIED`,
|
|
28
|
+
* and the envelope `message` is meant to be shown to the user as-is.
|
|
29
|
+
*/
|
|
30
|
+
export const SANCTIONS_ERROR_CODES = {
|
|
31
|
+
/** Sign-in with a listed wallet, or a withdrawal to a listed destination. */
|
|
32
|
+
ADDRESS_RESTRICTED: "ADDRESS_RESTRICTED",
|
|
33
|
+
/** A live session whose wallet (or delegated agent) is listed; returned on every signed request and on WebSocket authentication/revalidation. */
|
|
34
|
+
ACCOUNT_RESTRICTED: "ACCOUNT_RESTRICTED",
|
|
35
|
+
};
|
|
@@ -48,8 +48,10 @@ export interface BuildercodesAPI extends BaseAPI {
|
|
|
48
48
|
* The bucket is resolved from the authenticated caller's own wallet address,
|
|
49
49
|
* so a caller can only ever claim their own accrued balance. A wallet that
|
|
50
50
|
* has never been an enrolled frontend's payout address has nothing to claim.
|
|
51
|
-
*
|
|
52
|
-
*
|
|
51
|
+
* Shortly after Monaco moves a frontend's payout address to a new wallet, the
|
|
52
|
+
* unclaimed balance accrued to the old wallet moves with it. A wallet that
|
|
53
|
+
* *used to be* a payout address can still claim whatever remains in its
|
|
54
|
+
* bucket.
|
|
53
55
|
*
|
|
54
56
|
* Throws 403 when the session is a delegated agent — a permanent
|
|
55
57
|
* restriction on that session type, not a rollout state. No program switch
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compliance Types
|
|
3
|
+
*
|
|
4
|
+
* Types for the public region status endpoint. Monaco refuses callers from a
|
|
5
|
+
* restricted jurisdiction on every other endpoint with HTTP 451 and the error
|
|
6
|
+
* code `REGION_RESTRICTED`; this endpoint answers from every region so a
|
|
7
|
+
* frontend can show a region notice instead.
|
|
8
|
+
*
|
|
9
|
+
* NOTE: This endpoint is **public (unauthenticated)**.
|
|
10
|
+
*/
|
|
11
|
+
import type { BaseAPI } from "../api";
|
|
12
|
+
/** The caller's region status. */
|
|
13
|
+
export interface GetRegionStatusResponse {
|
|
14
|
+
/** True when Monaco is not available in the caller's region. */
|
|
15
|
+
restricted: boolean;
|
|
16
|
+
/** ISO 3166-1 alpha-2 country code (`T1` Tor, `XX` unknown); empty when the request carried no location. */
|
|
17
|
+
country: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Compliance API interface. The endpoint is public (no auth required).
|
|
21
|
+
*/
|
|
22
|
+
export interface ComplianceAPI extends BaseAPI {
|
|
23
|
+
/**
|
|
24
|
+
* Get the caller's region status.
|
|
25
|
+
*
|
|
26
|
+
* Public/unauthenticated and always answers 200, including from restricted
|
|
27
|
+
* regions.
|
|
28
|
+
*
|
|
29
|
+
* @returns Promise resolving to the caller's region status
|
|
30
|
+
*/
|
|
31
|
+
getRegionStatus(): Promise<GetRegionStatusResponse>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compliance Types
|
|
3
|
+
*
|
|
4
|
+
* Types for the public region status endpoint. Monaco refuses callers from a
|
|
5
|
+
* restricted jurisdiction on every other endpoint with HTTP 451 and the error
|
|
6
|
+
* code `REGION_RESTRICTED`; this endpoint answers from every region so a
|
|
7
|
+
* frontend can show a region notice instead.
|
|
8
|
+
*
|
|
9
|
+
* NOTE: This endpoint is **public (unauthenticated)**.
|
|
10
|
+
*/
|
package/dist/fees/responses.d.ts
CHANGED
|
@@ -34,10 +34,8 @@ export declare const SimulateFeeResponseSchema: z.ZodObject<{
|
|
|
34
34
|
applicationMakerFee: z.ZodOptional<z.ZodString>;
|
|
35
35
|
applicationMakerFeeBps: z.ZodOptional<z.ZodNumber>;
|
|
36
36
|
monacoMakerRebate: z.ZodString;
|
|
37
|
-
monacoMakerRebateBps: z.ZodNumber;
|
|
38
37
|
monacoMakerRebateBpsExact: z.ZodString;
|
|
39
38
|
monacoTakerFee: z.ZodString;
|
|
40
|
-
monacoTakerFeeBps: z.ZodNumber;
|
|
41
39
|
monacoTakerFeeBpsExact: z.ZodString;
|
|
42
40
|
notional: z.ZodString;
|
|
43
41
|
takerTotalPayment: z.ZodString;
|
package/dist/fees/responses.js
CHANGED
|
@@ -69,12 +69,6 @@ export const SimulateFeeResponseSchema = z.object({
|
|
|
69
69
|
applicationMakerFeeBps: z.number().optional(),
|
|
70
70
|
/** Monaco protocol maker rebate (negative = rebate) */
|
|
71
71
|
monacoMakerRebate: z.string(),
|
|
72
|
-
/**
|
|
73
|
-
* Monaco maker rebate in basis points.
|
|
74
|
-
* @deprecated Integer field cannot represent fractional tiered rebates (e.g. -1.15); it
|
|
75
|
-
* echoes the flat trading-pair column, not the tier-resolved rate. Use monacoMakerRebateBpsExact.
|
|
76
|
-
*/
|
|
77
|
-
monacoMakerRebateBps: z.number(),
|
|
78
72
|
/**
|
|
79
73
|
* Tier-resolved Monaco maker rebate as a decimal basis-points string (negative is a
|
|
80
74
|
* rebate), e.g. "-1" — the exact rate the ledger credits this caller.
|
|
@@ -82,12 +76,6 @@ export const SimulateFeeResponseSchema = z.object({
|
|
|
82
76
|
monacoMakerRebateBpsExact: z.string(),
|
|
83
77
|
/** Monaco protocol taker fee */
|
|
84
78
|
monacoTakerFee: z.string(),
|
|
85
|
-
/**
|
|
86
|
-
* Monaco taker fee in basis points.
|
|
87
|
-
* @deprecated Integer field cannot represent fractional tiered rates (e.g. 6.5); it echoes
|
|
88
|
-
* the flat trading-pair column, not the tier-resolved rate. Use monacoTakerFeeBpsExact.
|
|
89
|
-
*/
|
|
90
|
-
monacoTakerFeeBps: z.number(),
|
|
91
79
|
/**
|
|
92
80
|
* Tier-resolved Monaco taker fee as a decimal basis-points string, e.g. "6.5" — the exact
|
|
93
81
|
* rate the ledger charges this caller (equals monacoTakerFee / notional).
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -221,10 +221,26 @@ export interface TransferCollateralRequest {
|
|
|
221
221
|
* bucket, which has no trading pair and so cannot be named any other way.
|
|
222
222
|
*/
|
|
223
223
|
marginMode?: MarginMode;
|
|
224
|
+
/**
|
|
225
|
+
* Submission identity (1-64 of `A-Za-z0-9._:-`), shared with order create.
|
|
226
|
+
* Retrying the same key and request within 15 minutes returns the first
|
|
227
|
+
* transfer's result, its `movementId` included, and moves nothing again.
|
|
228
|
+
* Generate one per intended transfer and keep it across its retries; a
|
|
229
|
+
* different request under the same key fails with `IDEMPOTENCY_KEY_CONFLICT`.
|
|
230
|
+
*/
|
|
231
|
+
idempotencyKey?: string;
|
|
224
232
|
}
|
|
225
233
|
export interface TransferCollateralToParentMarginAccountRequest {
|
|
226
234
|
asset: string;
|
|
227
235
|
amount: string;
|
|
236
|
+
/**
|
|
237
|
+
* Submission identity (1-64 of `A-Za-z0-9._:-`), shared with order create.
|
|
238
|
+
* Retrying the same key and request within 15 minutes returns the first
|
|
239
|
+
* transfer's result, its `movementId` included, and moves nothing again.
|
|
240
|
+
* Generate one per intended transfer and keep it across its retries; a
|
|
241
|
+
* different request under the same key fails with `IDEMPOTENCY_KEY_CONFLICT`.
|
|
242
|
+
*/
|
|
243
|
+
idempotencyKey?: string;
|
|
228
244
|
}
|
|
229
245
|
/**
|
|
230
246
|
* Fund a pair's isolated risk bucket from the parent margin account's
|
|
@@ -289,6 +305,14 @@ export type TransferCollateralToRiskBucketRequest = TransferCollateralToIsolated
|
|
|
289
305
|
export interface TransferCollateralFromParentMarginAccountRequest {
|
|
290
306
|
asset: string;
|
|
291
307
|
amount: string;
|
|
308
|
+
/**
|
|
309
|
+
* Submission identity (1-64 of `A-Za-z0-9._:-`), shared with order create.
|
|
310
|
+
* Retrying the same key and request within 15 minutes returns the first
|
|
311
|
+
* transfer's result, its `movementId` included, and moves nothing again.
|
|
312
|
+
* Generate one per intended transfer and keep it across its retries; a
|
|
313
|
+
* different request under the same key fails with `IDEMPOTENCY_KEY_CONFLICT`.
|
|
314
|
+
*/
|
|
315
|
+
idempotencyKey?: string;
|
|
292
316
|
}
|
|
293
317
|
export interface TransferCollateralResponse {
|
|
294
318
|
movementId: string;
|
|
@@ -582,6 +606,14 @@ export interface TransferMarginCollateralRequest {
|
|
|
582
606
|
amount: string;
|
|
583
607
|
from: CollateralTransferEndpoint;
|
|
584
608
|
to: CollateralTransferEndpoint;
|
|
609
|
+
/**
|
|
610
|
+
* Submission identity (1-64 of `A-Za-z0-9._:-`), shared with order create.
|
|
611
|
+
* Retrying the same key and request within 15 minutes returns the first
|
|
612
|
+
* transfer's result, its `movementId` included, and moves nothing again.
|
|
613
|
+
* Generate one per intended transfer and keep it across its retries; a
|
|
614
|
+
* different request under the same key fails with `IDEMPOTENCY_KEY_CONFLICT`.
|
|
615
|
+
*/
|
|
616
|
+
idempotencyKey?: string;
|
|
585
617
|
}
|
|
586
618
|
export interface TransferMarginCollateralResponse {
|
|
587
619
|
movementId: string;
|
|
@@ -28,6 +28,12 @@ export interface PortfolioSummaryCurrent {
|
|
|
28
28
|
spotEquity?: string;
|
|
29
29
|
perpsEquity: string;
|
|
30
30
|
unrealizedPnl?: string;
|
|
31
|
+
/**
|
|
32
|
+
* What the user can spend or withdraw now: USDC available on spot plus the
|
|
33
|
+
* parent margin account's `withdrawableCollateral`. Other spot assets and
|
|
34
|
+
* unrealized margin gains are not counted. Served even when the valuation
|
|
35
|
+
* is partial.
|
|
36
|
+
*/
|
|
31
37
|
availableValue?: string;
|
|
32
38
|
}
|
|
33
39
|
export interface PortfolioSummaryActivity {
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Address, PublicClient, TransactionReceipt, WalletClient } from "vi
|
|
|
2
2
|
import type { ApplicationsAPI } from "../applications";
|
|
3
3
|
import type { AuthAPI, AuthState } from "../auth/index";
|
|
4
4
|
import type { BuildercodesAPI } from "../buildercodes";
|
|
5
|
+
import type { ComplianceAPI } from "../compliance";
|
|
5
6
|
import type { CopyTradingAPI } from "../copy-trading";
|
|
6
7
|
import type { DelegatedAgentsAPI } from "../delegated-agents";
|
|
7
8
|
import type { FaucetAPI } from "../faucet";
|
|
@@ -130,6 +131,8 @@ export interface MonacoSDK {
|
|
|
130
131
|
profile: ProfileAPI;
|
|
131
132
|
/** Public market-pulse news feed API (cached, hourly-refreshed) */
|
|
132
133
|
pulse: PulseAPI;
|
|
134
|
+
/** Public region status API: whether Monaco is available in the caller's region */
|
|
135
|
+
compliance: ComplianceAPI;
|
|
133
136
|
/** Orderbook REST API for fetching orderbook snapshots */
|
|
134
137
|
orderbook: {
|
|
135
138
|
getOrderbook: (tradingPairId: string, options?: {
|
|
@@ -30,12 +30,14 @@ export declare const TransferCollateralSchema: z.ZodObject<{
|
|
|
30
30
|
ISOLATED: "ISOLATED";
|
|
31
31
|
CROSS: "CROSS";
|
|
32
32
|
}>>;
|
|
33
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
33
34
|
}, z.core.$strip>;
|
|
34
35
|
}, z.core.$strip>;
|
|
35
36
|
export declare const TransferCollateralToParentMarginAccountSchema: z.ZodObject<{
|
|
36
37
|
request: z.ZodObject<{
|
|
37
38
|
asset: z.ZodString;
|
|
38
39
|
amount: z.ZodString;
|
|
40
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
39
41
|
}, z.core.$strip>;
|
|
40
42
|
}, z.core.$strip>;
|
|
41
43
|
export declare const TransferCollateralToRiskBucketSchema: z.ZodObject<{
|
|
@@ -48,6 +50,7 @@ export declare const TransferCollateralToRiskBucketSchema: z.ZodObject<{
|
|
|
48
50
|
}, z.core.$loose>, z.ZodUnion<readonly [z.ZodObject<{
|
|
49
51
|
asset: z.ZodString;
|
|
50
52
|
amount: z.ZodString;
|
|
53
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
51
54
|
tradingPairId: z.ZodUUID;
|
|
52
55
|
strategyKey: z.ZodOptional<z.ZodString>;
|
|
53
56
|
marginMode: z.ZodOptional<z.ZodLiteral<"ISOLATED">>;
|
|
@@ -57,6 +60,7 @@ export declare const TransferCollateralToRiskBucketSchema: z.ZodObject<{
|
|
|
57
60
|
}, z.core.$strict>, z.ZodObject<{
|
|
58
61
|
asset: z.ZodString;
|
|
59
62
|
amount: z.ZodString;
|
|
63
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
60
64
|
marginMode: z.ZodLiteral<"CROSS">;
|
|
61
65
|
marginAccountId: z.ZodOptional<z.ZodUUID>;
|
|
62
66
|
selectedTradingPairIds: z.ZodOptional<z.ZodNever>;
|
|
@@ -68,6 +72,7 @@ export declare const TransferCollateralFromParentMarginAccountSchema: z.ZodObjec
|
|
|
68
72
|
request: z.ZodObject<{
|
|
69
73
|
asset: z.ZodString;
|
|
70
74
|
amount: z.ZodString;
|
|
75
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
71
76
|
}, z.core.$strip>;
|
|
72
77
|
}, z.core.$strip>;
|
|
73
78
|
export declare const GetMarginAccountMovementsSchema: z.ZodObject<{
|
|
@@ -200,6 +205,7 @@ export declare const CloseMarginSubAccountSchema: z.ZodObject<{
|
|
|
200
205
|
export declare const SubAccountCollateralTransferSchema: z.ZodObject<{
|
|
201
206
|
marginAccountId: z.ZodUUID;
|
|
202
207
|
amount: z.ZodString;
|
|
208
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
203
209
|
}, z.core.$strip>;
|
|
204
210
|
export declare const GetMarginAccountPnlSchema: z.ZodObject<{
|
|
205
211
|
marginAccountId: z.ZodUUID;
|
|
@@ -220,5 +226,6 @@ export declare const TransferMarginCollateralSchema: z.ZodObject<{
|
|
|
220
226
|
marginAccountId: z.ZodUUID;
|
|
221
227
|
riskBucketId: z.ZodOptional<z.ZodUUID>;
|
|
222
228
|
}, z.core.$strict>]>;
|
|
229
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
223
230
|
}, z.core.$strict>;
|
|
224
231
|
}, z.core.$strip>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Margin Account API Validation Schemas
|
|
3
3
|
*/
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
import { MarketSlippageToleranceBpsSchema, OrderSideSchema, OrderTypeSchema, PositionSideSchema, PositiveDecimalStringSchema, UUIDSchema } from "./trading";
|
|
5
|
+
import { MarketSlippageToleranceBpsSchema, OrderIdempotencyKeySchema, OrderSideSchema, OrderTypeSchema, PositionSideSchema, PositiveDecimalStringSchema, UUIDSchema, } from "./trading";
|
|
6
6
|
const CursorPaginationSchema = z.object({
|
|
7
7
|
/**
|
|
8
8
|
* Rejected, not ignored. A non-strict object would let a JS or `any` caller
|
|
@@ -41,6 +41,7 @@ const TransferCollateralRequestSchema = z
|
|
|
41
41
|
// A cross risk bucket has no trading pair, so CROSS is the only way to name
|
|
42
42
|
// one on the way out (0XM-2420). The two never combine.
|
|
43
43
|
marginMode: z.enum(["ISOLATED", "CROSS"]).optional(),
|
|
44
|
+
idempotencyKey: OrderIdempotencyKeySchema.optional(),
|
|
44
45
|
})
|
|
45
46
|
.refine((request) => !(request.marginMode === "CROSS" && request.tradingPairId !== undefined), {
|
|
46
47
|
message: "tradingPairId is not supported for CROSS risk buckets",
|
|
@@ -49,6 +50,7 @@ const TransferCollateralRequestSchema = z
|
|
|
49
50
|
const ParentMarginAccountCollateralRequestSchema = z.object({
|
|
50
51
|
asset: z.string().trim().min(1, "Asset cannot be empty"),
|
|
51
52
|
amount: PositiveDecimalStringSchema,
|
|
53
|
+
idempotencyKey: OrderIdempotencyKeySchema.optional(),
|
|
52
54
|
});
|
|
53
55
|
const RiskBucketRequestSchema = z.object({
|
|
54
56
|
tradingPairId: UUIDSchema,
|
|
@@ -256,6 +258,7 @@ export const CloseMarginSubAccountSchema = z.object({
|
|
|
256
258
|
export const SubAccountCollateralTransferSchema = z.object({
|
|
257
259
|
marginAccountId: UUIDSchema,
|
|
258
260
|
amount: PositiveDecimalStringSchema,
|
|
261
|
+
idempotencyKey: OrderIdempotencyKeySchema.optional(),
|
|
259
262
|
});
|
|
260
263
|
export const GetMarginAccountPnlSchema = z.object({
|
|
261
264
|
marginAccountId: UUIDSchema,
|
|
@@ -271,6 +274,7 @@ export const TransferMarginCollateralSchema = z.object({
|
|
|
271
274
|
amount: PositiveDecimalStringSchema,
|
|
272
275
|
from: CollateralTransferEndpointSchema,
|
|
273
276
|
to: CollateralTransferEndpointSchema,
|
|
277
|
+
idempotencyKey: OrderIdempotencyKeySchema.optional(),
|
|
274
278
|
})
|
|
275
279
|
.strict(),
|
|
276
280
|
});
|
package/dist/websocket/base.d.ts
CHANGED
|
@@ -106,6 +106,8 @@ export type WebSocketErrorCode =
|
|
|
106
106
|
| "AUTH_FAILED"
|
|
107
107
|
/** The account is deactivated; the connection closes and must not automatically reconnect. */
|
|
108
108
|
| "ACCOUNT_DEACTIVATED"
|
|
109
|
+
/** The session's wallet is on the OFAC sanctions list; the connection closes and must not automatically reconnect. */
|
|
110
|
+
| "ACCOUNT_RESTRICTED"
|
|
109
111
|
/** The per-user concurrent-connection cap was reached; this connection is closed after the frame. */
|
|
110
112
|
| "CONNECTION_LIMIT"
|
|
111
113
|
/** The per-connection subscription-cardinality cap was reached. */
|
|
@@ -170,9 +172,10 @@ export interface WebSocketReauthenticationInfo {
|
|
|
170
172
|
/**
|
|
171
173
|
* The `Error` frame code that ended the connection: `SESSION_INVALID` (the
|
|
172
174
|
* session was revoked or expired after the handshake) or `AUTH_FAILED` (the
|
|
173
|
-
* `Authenticate` handshake itself was rejected),
|
|
175
|
+
* `Authenticate` handshake itself was rejected), `ACCOUNT_DEACTIVATED`, or
|
|
176
|
+
* `ACCOUNT_RESTRICTED` (the wallet is on the OFAC sanctions list).
|
|
174
177
|
*/
|
|
175
|
-
code: "SESSION_INVALID" | "AUTH_FAILED" | "ACCOUNT_DEACTIVATED";
|
|
178
|
+
code: "SESSION_INVALID" | "AUTH_FAILED" | "ACCOUNT_DEACTIVATED" | "ACCOUNT_RESTRICTED";
|
|
176
179
|
/** Human-readable description from the `Error` frame; for logging and display, never for branching. */
|
|
177
180
|
message: string;
|
|
178
181
|
/** WebSocket close code of the connection that was lost (1008 for `SESSION_INVALID`). */
|
|
@@ -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 ["add_follow_position_margin", "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_all_copy_positions", "close_follow_positions", "close_position", "close_sub_account", "create_challenge", "create_delegated_session", "create_order", "create_sub_account", "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_follow", "get_funding_state", "get_index_price", "get_lead_trader", "get_liquidation_metrics", "get_margin_account_movements", "get_margin_account_pnl", "get_margin_account_summary", "get_mark_price", "get_market_metadata", "get_market_stats", "get_my_fee_tier", "get_my_lead_trader", "get_my_referral_downline", "get_my_referral_position", "get_my_referral_tree", "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_sweeper_deposit_status", "get_trade_by_id", "get_trade_flow", "get_trader_code_info", "get_trader_metrics", "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_builder_fee_changes", "list_buildercode_payouts", "list_conditional_orders", "list_delegated_agent_owners", "list_delegated_agents", "list_follow_leader_positions", "list_funding_history", "list_funding_payments", "list_invite_codes", "list_lead_trader_closed_trades", "list_lead_trader_open_positions", "list_lead_traders", "list_liquidation_events", "list_managed_market_assignments", "list_margin_accounts", "list_my_followers", "list_my_follows", "list_pending_withdrawals", "list_position_history", "list_positions", "list_sub_accounts_with_balances", "list_sweeper_deposits", "list_trading_pairs", "list_twap_order_slices", "list_twap_orders", "mint_tokens", "preview_follow", "refresh_managed_market_quotes", "refresh_session", "register_deposit_address", "replace_order", "request_invite_codes", "revoke_delegated_agent", "revoke_session", "set_builder_fee", "set_self_trade_prevention_default", "set_trader_code", "simulate_fees", "simulate_order_risk", "simulate_parent_margin_order_risk", "simulate_risk_bucket_order_risk", "stop_follow", "submit_whitelist", "transfer_collateral", "transfer_collateral_from_margin_account", "transfer_collateral_from_parent_margin_account", "transfer_collateral_from_sub_account", "transfer_collateral_to_margin_account", "transfer_collateral_to_parent_margin_account", "transfer_collateral_to_risk_bucket", "transfer_collateral_to_sub_account", "transfer_rewards", "update_sub_account_limit", "upsert_delegated_agent", "upsert_follow", "upsert_lead_trader", "verify_signature"];
|
|
13
|
+
export declare const OPERATION_IDS: readonly ["add_follow_position_margin", "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_all_copy_positions", "close_follow_positions", "close_position", "close_sub_account", "create_challenge", "create_delegated_session", "create_order", "create_sub_account", "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_follow", "get_funding_state", "get_index_price", "get_lead_trader", "get_liquidation_metrics", "get_margin_account_movements", "get_margin_account_pnl", "get_margin_account_summary", "get_mark_price", "get_market_metadata", "get_market_stats", "get_my_fee_tier", "get_my_lead_trader", "get_my_referral_downline", "get_my_referral_position", "get_my_referral_tree", "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_region_status", "get_rewards_balance", "get_screener", "get_self_trade_prevention_default", "get_sub_account_limits", "get_sweeper_chains", "get_sweeper_deposit_status", "get_trade_by_id", "get_trade_flow", "get_trader_code_info", "get_trader_metrics", "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_builder_fee_changes", "list_buildercode_payouts", "list_conditional_orders", "list_delegated_agent_owners", "list_delegated_agents", "list_follow_leader_positions", "list_funding_history", "list_funding_payments", "list_invite_codes", "list_lead_trader_closed_trades", "list_lead_trader_open_positions", "list_lead_traders", "list_liquidation_events", "list_managed_market_assignments", "list_margin_accounts", "list_my_followers", "list_my_follows", "list_pending_withdrawals", "list_position_history", "list_positions", "list_sub_accounts_with_balances", "list_sweeper_deposits", "list_trading_pairs", "list_twap_order_slices", "list_twap_orders", "mint_tokens", "preview_follow", "refresh_managed_market_quotes", "refresh_session", "register_deposit_address", "replace_order", "request_invite_codes", "revoke_delegated_agent", "revoke_session", "set_builder_fee", "set_self_trade_prevention_default", "set_trader_code", "simulate_fees", "simulate_order_risk", "simulate_parent_margin_order_risk", "simulate_risk_bucket_order_risk", "stop_follow", "submit_whitelist", "transfer_collateral", "transfer_collateral_from_margin_account", "transfer_collateral_from_parent_margin_account", "transfer_collateral_from_sub_account", "transfer_collateral_to_margin_account", "transfer_collateral_to_parent_margin_account", "transfer_collateral_to_risk_bucket", "transfer_collateral_to_sub_account", "transfer_rewards", "update_sub_account_limit", "upsert_delegated_agent", "upsert_follow", "upsert_lead_trader", "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
|
@@ -904,10 +904,12 @@ export interface paths {
|
|
|
904
904
|
* The bucket is resolved from the AUTHENTICATED caller's own wallet address,
|
|
905
905
|
* never from the request body, so a caller can only ever claim their own
|
|
906
906
|
* accrued balance. A wallet that has never been an enrolled frontend's payout
|
|
907
|
-
* address simply has an empty bucket.
|
|
908
|
-
*
|
|
909
|
-
*
|
|
910
|
-
*
|
|
907
|
+
* address simply has an empty bucket. Shortly after Monaco moves a
|
|
908
|
+
* frontend's payout address to a new wallet, the unclaimed balance accrued
|
|
909
|
+
* to the old wallet moves to the new wallet. A wallet several frontends paid
|
|
910
|
+
* into before each payout wallet was limited to one frontend is not moved.
|
|
911
|
+
* Current enrollment is deliberately not required, so a wallet that used to
|
|
912
|
+
* be a payout address can still claim whatever remains in its bucket.
|
|
911
913
|
*
|
|
912
914
|
* The payout wallet may be an EOA or a smart-contract wallet. An EOA answers
|
|
913
915
|
* Monaco's signature challenge directly. A contract wallet — a multisig such
|
|
@@ -966,6 +968,37 @@ export interface paths {
|
|
|
966
968
|
patch?: never;
|
|
967
969
|
trace?: never;
|
|
968
970
|
};
|
|
971
|
+
"/api/v1/compliance/region": {
|
|
972
|
+
parameters: {
|
|
973
|
+
query?: never;
|
|
974
|
+
header?: never;
|
|
975
|
+
path?: never;
|
|
976
|
+
cookie?: never;
|
|
977
|
+
};
|
|
978
|
+
/**
|
|
979
|
+
* Get the caller's region status
|
|
980
|
+
* @description Get the caller's region status.
|
|
981
|
+
*
|
|
982
|
+
* Reports whether Monaco is available in the caller's region, so a
|
|
983
|
+
* frontend can show a region notice instead of failing on the next call.
|
|
984
|
+
* Public endpoint — no authentication required — and always answers 200.
|
|
985
|
+
* Over REST it answers from restricted regions too: GET on this path is
|
|
986
|
+
* the one request the production edge lets through. Over gRPC the edge
|
|
987
|
+
* refuses a restricted caller with HTTP 451 before it reaches this RPC,
|
|
988
|
+
* so clients that need the notice should call the REST endpoint. Every
|
|
989
|
+
* other endpoint refuses callers from a restricted region with 451
|
|
990
|
+
* REGION_RESTRICTED (gRPC: PERMISSION_DENIED with a google.rpc.ErrorInfo
|
|
991
|
+
* reason REGION_RESTRICTED).
|
|
992
|
+
*/
|
|
993
|
+
get: operations["get_region_status"];
|
|
994
|
+
put?: never;
|
|
995
|
+
post?: never;
|
|
996
|
+
delete?: never;
|
|
997
|
+
options?: never;
|
|
998
|
+
head?: never;
|
|
999
|
+
patch?: never;
|
|
1000
|
+
trace?: never;
|
|
1001
|
+
};
|
|
969
1002
|
"/api/v1/copy-trading/follows": {
|
|
970
1003
|
parameters: {
|
|
971
1004
|
query?: never;
|
|
@@ -7233,6 +7266,18 @@ export interface components {
|
|
|
7233
7266
|
/** @description Pulse items, pre-sorted: watchlist order first, MARKET last, most-recent-first within each asset. Items with unverified figures are removed server-side. */
|
|
7234
7267
|
items?: components["schemas"]["PulseItem"][] | null;
|
|
7235
7268
|
};
|
|
7269
|
+
GetRegionStatusResponse: {
|
|
7270
|
+
/**
|
|
7271
|
+
* @description True when Monaco is not available in the caller's region; every other endpoint then answers 451 REGION_RESTRICTED
|
|
7272
|
+
* @example false
|
|
7273
|
+
*/
|
|
7274
|
+
restricted?: boolean | null;
|
|
7275
|
+
/**
|
|
7276
|
+
* @description The caller's ISO 3166-1 alpha-2 country code as the edge geolocated it (T1 for Tor, XX for unknown); empty when the request carried no location
|
|
7277
|
+
* @example JP
|
|
7278
|
+
*/
|
|
7279
|
+
country?: string | null;
|
|
7280
|
+
};
|
|
7236
7281
|
GetRewardsBalanceResponse: {
|
|
7237
7282
|
/** @description One entry per reward token that has a non-zero available balance. */
|
|
7238
7283
|
balances?: components["schemas"]["RewardsBalanceEntry"][] | null;
|
|
@@ -9147,6 +9192,7 @@ export interface components {
|
|
|
9147
9192
|
spotEquity?: string | null;
|
|
9148
9193
|
perpsEquity?: string | null;
|
|
9149
9194
|
unrealizedPnl?: string | null;
|
|
9195
|
+
/** @description What the user can spend or withdraw now, in USD: the quote asset (USDC) available on spot, at face value, plus the parent margin account's withdrawableCollateral, the same figure the portfolio margin endpoint serves. Other spot assets and unrealized margin gains are equity, not availability, and are not counted. Prices nothing, so it is served even when valuationStatus is partial. */
|
|
9150
9196
|
availableValue?: string | null;
|
|
9151
9197
|
};
|
|
9152
9198
|
PortfolioWindow: {
|
|
@@ -10332,20 +10378,6 @@ export interface components {
|
|
|
10332
10378
|
* @example 20030.00
|
|
10333
10379
|
*/
|
|
10334
10380
|
buyOrderLockAmount?: string | null;
|
|
10335
|
-
/**
|
|
10336
|
-
* Format: int32
|
|
10337
|
-
* @deprecated
|
|
10338
|
-
* @description DEPRECATED: whole-basis-points taker rate. An integer cannot represent fractional tiered rates (e.g. 6.5), so this echoes the flat trading_pairs column, NOT the tier-resolved rate the ledger charges. Kept for backward compatibility. Use monaco_taker_fee_bps_exact (or GET /api/v1/fees/tier).
|
|
10339
|
-
* @example 10
|
|
10340
|
-
*/
|
|
10341
|
-
monacoTakerFeeBps?: number | null;
|
|
10342
|
-
/**
|
|
10343
|
-
* Format: int32
|
|
10344
|
-
* @deprecated
|
|
10345
|
-
* @description DEPRECATED: whole-basis-points maker rebate. An integer cannot represent fractional tiered rebates (e.g. -1.15), so this echoes the flat trading_pairs column, NOT the tier-resolved rate. Kept for backward compatibility. Use monaco_maker_rebate_bps_exact (or GET /api/v1/fees/tier).
|
|
10346
|
-
* @example -2
|
|
10347
|
-
*/
|
|
10348
|
-
monacoMakerRebateBps?: number | null;
|
|
10349
10381
|
/**
|
|
10350
10382
|
* Format: int32
|
|
10351
10383
|
* @description Application taker fee rate in basis points
|
|
@@ -10374,12 +10406,12 @@ export interface components {
|
|
|
10374
10406
|
*/
|
|
10375
10407
|
slippageToleranceBps?: number | null;
|
|
10376
10408
|
/**
|
|
10377
|
-
* @description Tier-resolved Monaco taker fee rate as a decimal basis-points string — the exact rate the ledger charges this caller (equals monaco_taker_fee / notional). Fractional and per-tier, e.g. "6.5".
|
|
10409
|
+
* @description Tier-resolved Monaco taker fee rate as a decimal basis-points string — the exact rate the ledger charges this caller (equals monaco_taker_fee / notional). Fractional and per-tier, e.g. "6.5".
|
|
10378
10410
|
* @example 6.5
|
|
10379
10411
|
*/
|
|
10380
10412
|
monacoTakerFeeBpsExact?: string | null;
|
|
10381
10413
|
/**
|
|
10382
|
-
* @description Tier-resolved Monaco maker rebate as a decimal basis-points string (negative is a rebate) — the exact rate the ledger credits this caller. Fractional and per-tier, e.g. "-1".
|
|
10414
|
+
* @description Tier-resolved Monaco maker rebate as a decimal basis-points string (negative is a rebate) — the exact rate the ledger credits this caller. Fractional and per-tier, e.g. "-1".
|
|
10383
10415
|
* @example -1
|
|
10384
10416
|
*/
|
|
10385
10417
|
monacoMakerRebateBpsExact?: string | null;
|
|
@@ -11156,6 +11188,8 @@ export interface components {
|
|
|
11156
11188
|
* trading pair and so cannot be named any other way. Values: ISOLATED, CROSS.
|
|
11157
11189
|
*/
|
|
11158
11190
|
marginMode?: string | null;
|
|
11191
|
+
/** @description Optional submission identity, shared with order create (same 1-64 characters from [A-Za-z0-9._:-], same per user and application namespace). Retrying the same key and request within 15 minutes of the original acceptance returns the original transfer result, including its movementId, without moving money again; balance figures in a replayed response are as of the retry. The same key with a different request, or a key already used on another endpoint, returns IDEMPOTENCY_KEY_CONFLICT (HTTP 409 / gRPC ALREADY_EXISTS). ORDER_SUBMISSION_UNAVAILABLE and ORDER_SUBMISSION_CAPACITY_EXCEEDED (HTTP 503 / gRPC UNAVAILABLE) mean the outcome is held but cannot be read, or no new key can be accepted: retry with the same key and request. The window does not extend on retries; after it the key moves money again. Generate a fresh key for each intended transfer and keep it across retries of that transfer. */
|
|
11192
|
+
idempotencyKey?: string | null;
|
|
11159
11193
|
};
|
|
11160
11194
|
TransferCollateralFromMarginAccountResponse: {
|
|
11161
11195
|
movementId?: string | null;
|
|
@@ -11177,11 +11211,15 @@ export interface components {
|
|
|
11177
11211
|
TransferCollateralFromParentMarginAccountRequest: {
|
|
11178
11212
|
asset?: string | null;
|
|
11179
11213
|
amount?: string | null;
|
|
11214
|
+
/** @description Optional submission identity, shared with order create (same 1-64 characters from [A-Za-z0-9._:-], same per user and application namespace). Retrying the same key and request within 15 minutes of the original acceptance returns the original transfer result, including its movementId, without moving money again; balance figures in a replayed response are as of the retry. The same key with a different request, or a key already used on another endpoint, returns IDEMPOTENCY_KEY_CONFLICT (HTTP 409 / gRPC ALREADY_EXISTS). ORDER_SUBMISSION_UNAVAILABLE and ORDER_SUBMISSION_CAPACITY_EXCEEDED (HTTP 503 / gRPC UNAVAILABLE) mean the outcome is held but cannot be read, or no new key can be accepted: retry with the same key and request. The window does not extend on retries; after it the key moves money again. Generate a fresh key for each intended transfer and keep it across retries of that transfer. */
|
|
11215
|
+
idempotencyKey?: string | null;
|
|
11180
11216
|
};
|
|
11181
11217
|
TransferCollateralFromSubAccountRequest: {
|
|
11182
11218
|
/** @description The caller's sub-account the collateral leaves. */
|
|
11183
11219
|
marginAccountId?: string | null;
|
|
11184
11220
|
amount?: string | null;
|
|
11221
|
+
/** @description Optional submission identity, shared with order create (same 1-64 characters from [A-Za-z0-9._:-], same per user and application namespace). Retrying the same key and request within 15 minutes of the original acceptance returns the original transfer result, including its movementId, without moving money again; balance figures in a replayed response are as of the retry. The same key with a different request, or a key already used on another endpoint, returns IDEMPOTENCY_KEY_CONFLICT (HTTP 409 / gRPC ALREADY_EXISTS). ORDER_SUBMISSION_UNAVAILABLE and ORDER_SUBMISSION_CAPACITY_EXCEEDED (HTTP 503 / gRPC UNAVAILABLE) mean the outcome is held but cannot be read, or no new key can be accepted: retry with the same key and request. The window does not extend on retries; after it the key moves money again. Generate a fresh key for each intended transfer and keep it across retries of that transfer. */
|
|
11222
|
+
idempotencyKey?: string | null;
|
|
11185
11223
|
};
|
|
11186
11224
|
TransferCollateralRequest: {
|
|
11187
11225
|
/** @description Collateral asset symbol or address. */
|
|
@@ -11191,6 +11229,8 @@ export interface components {
|
|
|
11191
11229
|
from?: components["schemas"]["CollateralTransferEndpoint"] | null;
|
|
11192
11230
|
/** @description Where the collateral goes. */
|
|
11193
11231
|
to?: components["schemas"]["CollateralTransferEndpoint"] | null;
|
|
11232
|
+
/** @description Optional submission identity, shared with order create (same 1-64 characters from [A-Za-z0-9._:-], same per user and application namespace). Retrying the same key and request within 15 minutes of the original acceptance returns the original transfer result, including its movementId, without moving money again; balance figures in a replayed response are as of the retry. The same key with a different request, or a key already used on another endpoint, returns IDEMPOTENCY_KEY_CONFLICT (HTTP 409 / gRPC ALREADY_EXISTS). ORDER_SUBMISSION_UNAVAILABLE and ORDER_SUBMISSION_CAPACITY_EXCEEDED (HTTP 503 / gRPC UNAVAILABLE) mean the outcome is held but cannot be read, or no new key can be accepted: retry with the same key and request. The window does not extend on retries; after it the key moves money again. Generate a fresh key for each intended transfer and keep it across retries of that transfer. */
|
|
11233
|
+
idempotencyKey?: string | null;
|
|
11194
11234
|
};
|
|
11195
11235
|
TransferCollateralResponse: {
|
|
11196
11236
|
movementId?: string | null;
|
|
@@ -11216,6 +11256,8 @@ export interface components {
|
|
|
11216
11256
|
tradingPairId?: string | null;
|
|
11217
11257
|
/** @description Optional strategy key echoed in responses when callers scope a risk bucket. */
|
|
11218
11258
|
strategyKey?: string | null;
|
|
11259
|
+
/** @description Optional submission identity, shared with order create (same 1-64 characters from [A-Za-z0-9._:-], same per user and application namespace). Retrying the same key and request within 15 minutes of the original acceptance returns the original transfer result, including its movementId, without moving money again; balance figures in a replayed response are as of the retry. The same key with a different request, or a key already used on another endpoint, returns IDEMPOTENCY_KEY_CONFLICT (HTTP 409 / gRPC ALREADY_EXISTS). ORDER_SUBMISSION_UNAVAILABLE and ORDER_SUBMISSION_CAPACITY_EXCEEDED (HTTP 503 / gRPC UNAVAILABLE) mean the outcome is held but cannot be read, or no new key can be accepted: retry with the same key and request. The window does not extend on retries; after it the key moves money again. Generate a fresh key for each intended transfer and keep it across retries of that transfer. */
|
|
11260
|
+
idempotencyKey?: string | null;
|
|
11219
11261
|
};
|
|
11220
11262
|
TransferCollateralToMarginAccountResponse: {
|
|
11221
11263
|
movementId?: string | null;
|
|
@@ -11259,6 +11301,8 @@ export interface components {
|
|
|
11259
11301
|
TransferCollateralToParentMarginAccountRequest: {
|
|
11260
11302
|
asset?: string | null;
|
|
11261
11303
|
amount?: string | null;
|
|
11304
|
+
/** @description Optional submission identity, shared with order create (same 1-64 characters from [A-Za-z0-9._:-], same per user and application namespace). Retrying the same key and request within 15 minutes of the original acceptance returns the original transfer result, including its movementId, without moving money again; balance figures in a replayed response are as of the retry. The same key with a different request, or a key already used on another endpoint, returns IDEMPOTENCY_KEY_CONFLICT (HTTP 409 / gRPC ALREADY_EXISTS). ORDER_SUBMISSION_UNAVAILABLE and ORDER_SUBMISSION_CAPACITY_EXCEEDED (HTTP 503 / gRPC UNAVAILABLE) mean the outcome is held but cannot be read, or no new key can be accepted: retry with the same key and request. The window does not extend on retries; after it the key moves money again. Generate a fresh key for each intended transfer and keep it across retries of that transfer. */
|
|
11305
|
+
idempotencyKey?: string | null;
|
|
11262
11306
|
};
|
|
11263
11307
|
TransferCollateralToRiskBucketRequest: {
|
|
11264
11308
|
asset?: string | null;
|
|
@@ -11314,11 +11358,15 @@ export interface components {
|
|
|
11314
11358
|
* sub-account's buckets belong to its follow and are refused.
|
|
11315
11359
|
*/
|
|
11316
11360
|
marginAccountId?: string | null;
|
|
11361
|
+
/** @description Optional submission identity, shared with order create (same 1-64 characters from [A-Za-z0-9._:-], same per user and application namespace). Retrying the same key and request within 15 minutes of the original acceptance returns the original transfer result, including its movementId, without moving money again; balance figures in a replayed response are as of the retry. The same key with a different request, or a key already used on another endpoint, returns IDEMPOTENCY_KEY_CONFLICT (HTTP 409 / gRPC ALREADY_EXISTS). ORDER_SUBMISSION_UNAVAILABLE and ORDER_SUBMISSION_CAPACITY_EXCEEDED (HTTP 503 / gRPC UNAVAILABLE) mean the outcome is held but cannot be read, or no new key can be accepted: retry with the same key and request. The window does not extend on retries; after it the key moves money again. Generate a fresh key for each intended transfer and keep it across retries of that transfer. */
|
|
11362
|
+
idempotencyKey?: string | null;
|
|
11317
11363
|
};
|
|
11318
11364
|
TransferCollateralToSubAccountRequest: {
|
|
11319
11365
|
/** @description The caller's sub-account that receives the collateral. */
|
|
11320
11366
|
marginAccountId?: string | null;
|
|
11321
11367
|
amount?: string | null;
|
|
11368
|
+
/** @description Optional submission identity, shared with order create (same 1-64 characters from [A-Za-z0-9._:-], same per user and application namespace). Retrying the same key and request within 15 minutes of the original acceptance returns the original transfer result, including its movementId, without moving money again; balance figures in a replayed response are as of the retry. The same key with a different request, or a key already used on another endpoint, returns IDEMPOTENCY_KEY_CONFLICT (HTTP 409 / gRPC ALREADY_EXISTS). ORDER_SUBMISSION_UNAVAILABLE and ORDER_SUBMISSION_CAPACITY_EXCEEDED (HTTP 503 / gRPC UNAVAILABLE) mean the outcome is held but cannot be read, or no new key can be accepted: retry with the same key and request. The window does not extend on retries; after it the key moves money again. Generate a fresh key for each intended transfer and keep it across retries of that transfer. */
|
|
11369
|
+
idempotencyKey?: string | null;
|
|
11322
11370
|
};
|
|
11323
11371
|
TransferRewardsRequest: {
|
|
11324
11372
|
/**
|
|
@@ -13646,7 +13694,7 @@ export interface operations {
|
|
|
13646
13694
|
};
|
|
13647
13695
|
content?: never;
|
|
13648
13696
|
};
|
|
13649
|
-
/** @description Origin not allowed for this application */
|
|
13697
|
+
/** @description Origin not allowed for this application; or the wallet is on the OFAC sanctions list, refused with code ADDRESS_RESTRICTED (REST error envelope error and code; gRPC google.rpc.ErrorInfo reason, domain auth.0xmonaco.com) and the message "This wallet can't be used on Monaco." */
|
|
13650
13698
|
403: {
|
|
13651
13699
|
headers: {
|
|
13652
13700
|
[name: string]: unknown;
|
|
@@ -13809,7 +13857,7 @@ export interface operations {
|
|
|
13809
13857
|
};
|
|
13810
13858
|
content?: never;
|
|
13811
13859
|
};
|
|
13812
|
-
/** @description Origin not allowed for this application; the account or wallet is deactivated; or Mainnet Invite Mode is on and the wallet has no access grant and supplied no valid invite code. Auth refusals carry a stable code (REST error envelope code; gRPC google.rpc.ErrorInfo reason, domain auth.0xmonaco.com): ACCOUNT_DEACTIVATED for a deactivated signing account, INVITE_CODE_REQUIRED when no code was supplied, and INVITE_CODE_INVALID for a wrong, already redeemed or revoked code, or an unused code whose issuer is deactivated. No account identity or administrative deactivation reason is disclosed. Unused invites become usable again after issuer reactivation */
|
|
13860
|
+
/** @description Origin not allowed for this application; the account or wallet is deactivated; or Mainnet Invite Mode is on and the wallet has no access grant and supplied no valid invite code. Auth refusals carry a stable code (REST error envelope code; gRPC google.rpc.ErrorInfo reason, domain auth.0xmonaco.com): ACCOUNT_DEACTIVATED for a deactivated signing account, INVITE_CODE_REQUIRED when no code was supplied, and INVITE_CODE_INVALID for a wrong, already redeemed or revoked code, or an unused code whose issuer is deactivated. A wallet on the OFAC sanctions list is refused with ADDRESS_RESTRICTED. No account identity or administrative deactivation reason is disclosed. Unused invites become usable again after issuer reactivation */
|
|
13813
13861
|
403: {
|
|
13814
13862
|
headers: {
|
|
13815
13863
|
[name: string]: unknown;
|
|
@@ -14285,6 +14333,26 @@ export interface operations {
|
|
|
14285
14333
|
};
|
|
14286
14334
|
};
|
|
14287
14335
|
};
|
|
14336
|
+
get_region_status: {
|
|
14337
|
+
parameters: {
|
|
14338
|
+
query?: never;
|
|
14339
|
+
header?: never;
|
|
14340
|
+
path?: never;
|
|
14341
|
+
cookie?: never;
|
|
14342
|
+
};
|
|
14343
|
+
requestBody?: never;
|
|
14344
|
+
responses: {
|
|
14345
|
+
/** @description OK */
|
|
14346
|
+
200: {
|
|
14347
|
+
headers: {
|
|
14348
|
+
[name: string]: unknown;
|
|
14349
|
+
};
|
|
14350
|
+
content: {
|
|
14351
|
+
"application/json": components["schemas"]["GetRegionStatusResponse"];
|
|
14352
|
+
};
|
|
14353
|
+
};
|
|
14354
|
+
};
|
|
14355
|
+
};
|
|
14288
14356
|
list_my_follows: {
|
|
14289
14357
|
parameters: {
|
|
14290
14358
|
query?: {
|
|
@@ -19904,7 +19972,7 @@ export interface operations {
|
|
|
19904
19972
|
};
|
|
19905
19973
|
content?: never;
|
|
19906
19974
|
};
|
|
19907
|
-
/** @description Caller lacks the withdraw permission */
|
|
19975
|
+
/** @description Caller lacks the withdraw permission; or the destination is on the OFAC sanctions list, refused with code ADDRESS_RESTRICTED (REST error envelope error and code; gRPC google.rpc.ErrorInfo reason, domain auth.0xmonaco.com) and the message "Withdrawals to this address aren't supported." */
|
|
19908
19976
|
403: {
|
|
19909
19977
|
headers: {
|
|
19910
19978
|
[name: string]: unknown;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.92",
|
|
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.92",
|
|
20
20
|
"zod": "^4.1.12"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|