@0xmonaco/core 1.0.59 → 1.0.60
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/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/managed-markets/index.d.ts +8 -0
- package/dist/api/managed-markets/index.js +24 -0
- package/dist/api/margin-accounts/api.js +3 -1
- package/dist/coverage.d.ts +3 -0
- package/dist/coverage.js +3 -0
- package/dist/sdk.d.ts +2 -1
- package/dist/sdk.js +5 -0
- package/package.json +3 -3
package/dist/api/index.d.ts
CHANGED
package/dist/api/index.js
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ClaimManagedMarketLeaseRequest, ListManagedMarketAssignmentsRequest, ListManagedMarketAssignmentsResponse, ManagedMarketLease, ManagedMarketQuoteStatus, ManagedMarketsAPI, RefreshManagedMarketQuotesRequest } from "@0xmonaco/types";
|
|
2
|
+
import { BaseAPI } from "../base";
|
|
3
|
+
/** Managed quote intents use the existing wallet session and never move funding. */
|
|
4
|
+
export declare class ManagedMarketsAPIImpl extends BaseAPI implements ManagedMarketsAPI {
|
|
5
|
+
listAssignments(request?: ListManagedMarketAssignmentsRequest): Promise<ListManagedMarketAssignmentsResponse>;
|
|
6
|
+
claimLease(launchId: string, request: ClaimManagedMarketLeaseRequest): Promise<ManagedMarketLease>;
|
|
7
|
+
refreshQuotes(launchId: string, request: RefreshManagedMarketQuotesRequest): Promise<ManagedMarketQuoteStatus>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseAPI } from "../base";
|
|
2
|
+
/** Managed quote intents use the existing wallet session and never move funding. */
|
|
3
|
+
export class ManagedMarketsAPIImpl extends BaseAPI {
|
|
4
|
+
async listAssignments(request = {}) {
|
|
5
|
+
const query = new URLSearchParams();
|
|
6
|
+
if (request.page !== undefined)
|
|
7
|
+
query.set("page", String(request.page));
|
|
8
|
+
if (request.pageSize !== undefined)
|
|
9
|
+
query.set("pageSize", String(request.pageSize));
|
|
10
|
+
return this.makeAuthenticatedRequest(`/api/v1/managed-markets/assignments${query.size ? `?${query}` : ""}`);
|
|
11
|
+
}
|
|
12
|
+
async claimLease(launchId, request) {
|
|
13
|
+
return this.makeAuthenticatedRequest(`/api/v1/managed-markets/${encodeURIComponent(launchId)}/lease`, {
|
|
14
|
+
method: "POST",
|
|
15
|
+
body: JSON.stringify(request),
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
async refreshQuotes(launchId, request) {
|
|
19
|
+
return this.makeAuthenticatedRequest(`/api/v1/managed-markets/${encodeURIComponent(launchId)}/quotes`, {
|
|
20
|
+
method: "POST",
|
|
21
|
+
body: JSON.stringify(request),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -150,7 +150,9 @@ export class MarginAccountsAPIImpl extends BaseAPI {
|
|
|
150
150
|
tradingPairId: request.tradingPairId,
|
|
151
151
|
strategyKey: request.strategyKey,
|
|
152
152
|
marginMode: request.marginMode,
|
|
153
|
-
selectedTradingPairIds:
|
|
153
|
+
// No selectedTradingPairIds: cross scope is derived from trading, and
|
|
154
|
+
// the server ignores the deprecated field. Not sending it keeps a
|
|
155
|
+
// pre-upgrade caller's stale list from reaching the wire at all.
|
|
154
156
|
side: request.side,
|
|
155
157
|
positionSide: request.positionSide,
|
|
156
158
|
orderType: request.orderType,
|
package/dist/coverage.d.ts
CHANGED
|
@@ -38,6 +38,9 @@ export declare const COVERED: {
|
|
|
38
38
|
get_market_stats: string;
|
|
39
39
|
get_my_fee_tier: string;
|
|
40
40
|
get_pulse: string;
|
|
41
|
+
list_managed_market_assignments: string;
|
|
42
|
+
claim_managed_market_lease: string;
|
|
43
|
+
refresh_managed_market_quotes: string;
|
|
41
44
|
get_sweeper_chains: string;
|
|
42
45
|
get_my_trader_code: string;
|
|
43
46
|
get_rewards_balance: string;
|
package/dist/coverage.js
CHANGED
|
@@ -38,6 +38,9 @@ export const COVERED = {
|
|
|
38
38
|
get_market_stats: "getMarketStats",
|
|
39
39
|
get_my_fee_tier: "getMyFeeTier",
|
|
40
40
|
get_pulse: "pulse.getPulse",
|
|
41
|
+
list_managed_market_assignments: "managedMarkets.listAssignments",
|
|
42
|
+
claim_managed_market_lease: "managedMarkets.claimLease",
|
|
43
|
+
refresh_managed_market_quotes: "managedMarkets.refreshQuotes",
|
|
41
44
|
get_sweeper_chains: "sweeper.getChains",
|
|
42
45
|
get_my_trader_code: "pitpass.getMyTraderCode",
|
|
43
46
|
get_rewards_balance: "pitpass.getRewardsBalance",
|
package/dist/sdk.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApplicationsAPI, AuthAPI, AuthState, BuildercodesAPI, DelegatedAgentsAPI, FaucetAPI, FeesAPI, MarginAccountsAPI, MarketAPI, MonacoSDK, Network, PitpassAPI, PortfolioAPI, PositionsAPI, ProfileAPI, PulseAPI, SDKConfig, SubAccountsAPI, SweeperAPI, TradingAPI, VaultAPI, WhitelistAPI, WithdrawalsAPI } from "@0xmonaco/types";
|
|
1
|
+
import type { ApplicationsAPI, AuthAPI, AuthState, BuildercodesAPI, DelegatedAgentsAPI, FaucetAPI, FeesAPI, ManagedMarketsAPI, MarginAccountsAPI, MarketAPI, MonacoSDK, Network, PitpassAPI, PortfolioAPI, PositionsAPI, ProfileAPI, PulseAPI, SDKConfig, SubAccountsAPI, SweeperAPI, TradingAPI, VaultAPI, WhitelistAPI, WithdrawalsAPI } from "@0xmonaco/types";
|
|
2
2
|
import { type Address, type PublicClient, type TransactionReceipt, type WalletClient } from "viem";
|
|
3
3
|
import { type MonacoWebSocket, OrderbookAPIImpl, TradesAPIImpl } from "./api";
|
|
4
4
|
export declare class MonacoSDKImpl implements MonacoSDK {
|
|
@@ -18,6 +18,7 @@ export declare class MonacoSDKImpl implements MonacoSDK {
|
|
|
18
18
|
subAccounts: SubAccountsAPI;
|
|
19
19
|
faucet: FaucetAPI;
|
|
20
20
|
sweeper: SweeperAPI;
|
|
21
|
+
managedMarkets: ManagedMarketsAPI;
|
|
21
22
|
whitelist: WhitelistAPI;
|
|
22
23
|
profile: ProfileAPI;
|
|
23
24
|
pulse: PulseAPI;
|
package/dist/sdk.js
CHANGED
|
@@ -7,6 +7,7 @@ import { BuildercodesAPIImpl } from "./api/buildercodes";
|
|
|
7
7
|
import { DelegatedAgentsAPIImpl } from "./api/delegated-agents";
|
|
8
8
|
import { FaucetAPIImpl } from "./api/faucet";
|
|
9
9
|
import { FeesAPIImpl } from "./api/fees";
|
|
10
|
+
import { ManagedMarketsAPIImpl } from "./api/managed-markets";
|
|
10
11
|
import { MarginAccountsAPIImpl } from "./api/margin-accounts";
|
|
11
12
|
import { MarketAPIImpl } from "./api/market";
|
|
12
13
|
import { PitpassAPIImpl } from "./api/pitpass";
|
|
@@ -57,6 +58,7 @@ export class MonacoSDKImpl {
|
|
|
57
58
|
subAccounts;
|
|
58
59
|
faucet;
|
|
59
60
|
sweeper;
|
|
61
|
+
managedMarkets;
|
|
60
62
|
whitelist;
|
|
61
63
|
profile;
|
|
62
64
|
pulse;
|
|
@@ -89,6 +91,7 @@ export class MonacoSDKImpl {
|
|
|
89
91
|
this.subAccounts.setSessionKeypair(credentials);
|
|
90
92
|
this.faucet.setSessionKeypair(credentials);
|
|
91
93
|
this.sweeper.setSessionKeypair(credentials);
|
|
94
|
+
this.managedMarkets.setSessionKeypair(credentials);
|
|
92
95
|
this.whitelist.setSessionKeypair(credentials);
|
|
93
96
|
this.pulse.setSessionKeypair(credentials);
|
|
94
97
|
this.profile.setSessionKeypair(credentials);
|
|
@@ -130,6 +133,7 @@ export class MonacoSDKImpl {
|
|
|
130
133
|
this.subAccounts.setServerKey(serverKey);
|
|
131
134
|
this.faucet.setServerKey(serverKey);
|
|
132
135
|
this.sweeper.setServerKey(serverKey);
|
|
136
|
+
this.managedMarkets.setServerKey(serverKey);
|
|
133
137
|
this.whitelist.setServerKey(serverKey);
|
|
134
138
|
this.pulse.setServerKey(serverKey);
|
|
135
139
|
this.profile.setServerKey(serverKey);
|
|
@@ -197,6 +201,7 @@ export class MonacoSDKImpl {
|
|
|
197
201
|
this.subAccounts = configureSigning(new SubAccountsAPIImpl(apiUrl));
|
|
198
202
|
this.faucet = configureSigning(new FaucetAPIImpl(apiUrl));
|
|
199
203
|
this.sweeper = configureSigning(new SweeperAPIImpl(apiUrl));
|
|
204
|
+
this.managedMarkets = configureSigning(new ManagedMarketsAPIImpl(apiUrl));
|
|
200
205
|
this.whitelist = configureSigning(new WhitelistAPIImpl(apiUrl));
|
|
201
206
|
this.pulse = configureSigning(new PulseAPIImpl(apiUrl));
|
|
202
207
|
this.auth = configureSigning(new AuthAPIImpl(this.walletClient, this.chain, apiUrl));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.60",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"homepage": "https://docs.0xmonaco.com/sdk/typescript",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"viem": "^2.45.2"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@0xmonaco/contracts": "1.0.
|
|
23
|
-
"@0xmonaco/types": "1.0.
|
|
22
|
+
"@0xmonaco/contracts": "1.0.60",
|
|
23
|
+
"@0xmonaco/types": "1.0.60",
|
|
24
24
|
"@noble/curves": "^1.9.1",
|
|
25
25
|
"@noble/hashes": "^2.4.0",
|
|
26
26
|
"http-status-codes": "^2.3.0"
|