@0xmonaco/core 1.1.2-develop.3a25169 → 1.1.5-develop.129b2c6
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/analytics/api.d.ts +40 -0
- package/dist/api/analytics/api.js +107 -0
- package/dist/api/analytics/index.d.ts +1 -0
- package/dist/api/analytics/index.js +1 -0
- package/dist/api/applications/api.d.ts +5 -5
- package/dist/api/applications/api.js +5 -5
- package/dist/api/buildercodes/api.d.ts +18 -11
- package/dist/api/buildercodes/api.js +31 -15
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.js +2 -0
- package/dist/api/market/api.d.ts +3 -1
- package/dist/api/market/api.js +9 -0
- package/dist/api/orderbook/api.d.ts +5 -2
- package/dist/api/orderbook/api.js +2 -0
- package/dist/api/perp/routes.d.ts +68 -0
- package/dist/api/perp/routes.js +22 -0
- package/dist/api/rfq/api.d.ts +69 -0
- package/dist/api/rfq/api.js +129 -0
- package/dist/api/rfq/index.d.ts +6 -0
- package/dist/api/rfq/index.js +6 -0
- package/dist/api/trades/api.d.ts +24 -0
- package/dist/api/trades/api.js +28 -1
- package/dist/api/trading/api.d.ts +35 -3
- package/dist/api/trading/api.js +49 -7
- package/dist/api/websocket/local-book.d.ts +112 -0
- package/dist/api/websocket/local-book.js +423 -0
- package/dist/api/websocket/websocket.js +790 -38
- package/dist/coverage.d.ts +28 -0
- package/dist/coverage.js +28 -0
- package/dist/sdk.d.ts +3 -1
- package/dist/sdk.js +8 -0
- package/dist/utils/magnitude.d.ts +5 -2
- package/dist/utils/magnitude.js +6 -3
- package/package.json +3 -3
package/dist/coverage.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare const COVERED: {
|
|
|
3
3
|
attach_position_tp_sl: string;
|
|
4
4
|
batch_cancel_all: string;
|
|
5
5
|
batch_cancel_all_by_pair: string;
|
|
6
|
+
cancel_all_after: string;
|
|
6
7
|
batch_cancel_orders: string;
|
|
7
8
|
batch_close_all_positions: string;
|
|
8
9
|
batch_create_orders: string;
|
|
@@ -26,6 +27,14 @@ export declare const COVERED: {
|
|
|
26
27
|
get_follow: string;
|
|
27
28
|
list_follow_leader_positions: string;
|
|
28
29
|
preview_follow: string;
|
|
30
|
+
get_rfq_capabilities: string;
|
|
31
|
+
create_rfq: string;
|
|
32
|
+
get_rfq: string;
|
|
33
|
+
accept_rfq: string;
|
|
34
|
+
cancel_rfq: string;
|
|
35
|
+
upsert_rfq_quote: string;
|
|
36
|
+
withdraw_rfq_quote: string;
|
|
37
|
+
respond_rfq_last_look: string;
|
|
29
38
|
cancel_twap_order: string;
|
|
30
39
|
create_twap_order: string;
|
|
31
40
|
get_twap_order: string;
|
|
@@ -59,6 +68,22 @@ export declare const COVERED: {
|
|
|
59
68
|
get_fee_schedule: string;
|
|
60
69
|
get_pulse: string;
|
|
61
70
|
get_region_status: string;
|
|
71
|
+
get_protocol_totals: string;
|
|
72
|
+
get_protocol_series: string;
|
|
73
|
+
list_market_volumes: string;
|
|
74
|
+
get_treasury_net_fees: string;
|
|
75
|
+
list_builders: string;
|
|
76
|
+
get_builder: string;
|
|
77
|
+
get_builder_totals: string;
|
|
78
|
+
get_builder_series: string;
|
|
79
|
+
list_builder_leaderboard: string;
|
|
80
|
+
list_wallet_leaderboard: string;
|
|
81
|
+
get_wallet_summary: string;
|
|
82
|
+
list_wallet_liquidations: string;
|
|
83
|
+
list_token_custody: string;
|
|
84
|
+
get_token_custody: string;
|
|
85
|
+
list_vault_deposits: string;
|
|
86
|
+
list_vault_withdrawals: string;
|
|
62
87
|
list_managed_market_assignments: string;
|
|
63
88
|
claim_managed_market_lease: string;
|
|
64
89
|
refresh_managed_market_quotes: string;
|
|
@@ -98,6 +123,7 @@ export declare const COVERED: {
|
|
|
98
123
|
get_sub_account_limits: string;
|
|
99
124
|
get_trade_by_id: string;
|
|
100
125
|
get_trades: string;
|
|
126
|
+
list_trades: string;
|
|
101
127
|
get_trade_flow: string;
|
|
102
128
|
get_trader_metrics: string;
|
|
103
129
|
get_liquidation_metrics: string;
|
|
@@ -122,6 +148,8 @@ export declare const COVERED: {
|
|
|
122
148
|
list_delegated_agents: string;
|
|
123
149
|
list_funding_history: string;
|
|
124
150
|
list_liquidation_events: string;
|
|
151
|
+
list_all_liquidation_events: string;
|
|
152
|
+
list_insurance_funds: string;
|
|
125
153
|
list_funding_payments: string;
|
|
126
154
|
list_margin_accounts: string;
|
|
127
155
|
list_position_history: string;
|
package/dist/coverage.js
CHANGED
|
@@ -3,6 +3,7 @@ export const COVERED = {
|
|
|
3
3
|
attach_position_tp_sl: "attachPositionTpSl",
|
|
4
4
|
batch_cancel_all: "batchCancelAll",
|
|
5
5
|
batch_cancel_all_by_pair: "batchCancelAll (with tradingPairId)",
|
|
6
|
+
cancel_all_after: "cancelAllAfter",
|
|
6
7
|
batch_cancel_orders: "batchCancel",
|
|
7
8
|
batch_close_all_positions: "batchCloseAllPositions",
|
|
8
9
|
batch_create_orders: "batchCreate",
|
|
@@ -26,6 +27,14 @@ export const COVERED = {
|
|
|
26
27
|
get_follow: "copyTrading.getFollow",
|
|
27
28
|
list_follow_leader_positions: "copyTrading.listFollowLeaderPositions",
|
|
28
29
|
preview_follow: "copyTrading.previewFollow",
|
|
30
|
+
get_rfq_capabilities: "rfq.getCapabilities",
|
|
31
|
+
create_rfq: "rfq.createRfq",
|
|
32
|
+
get_rfq: "rfq.getRfq",
|
|
33
|
+
accept_rfq: "rfq.acceptRfq",
|
|
34
|
+
cancel_rfq: "rfq.cancelRfq",
|
|
35
|
+
upsert_rfq_quote: "rfq.upsertQuote",
|
|
36
|
+
withdraw_rfq_quote: "rfq.withdrawQuote",
|
|
37
|
+
respond_rfq_last_look: "rfq.respondLastLook",
|
|
29
38
|
cancel_twap_order: "cancelTwapOrder",
|
|
30
39
|
create_twap_order: "createTwapOrder",
|
|
31
40
|
get_twap_order: "getTwapOrder",
|
|
@@ -59,6 +68,22 @@ export const COVERED = {
|
|
|
59
68
|
get_fee_schedule: "getFeeSchedule",
|
|
60
69
|
get_pulse: "pulse.getPulse",
|
|
61
70
|
get_region_status: "compliance.getRegionStatus",
|
|
71
|
+
get_protocol_totals: "analytics.getProtocolTotals",
|
|
72
|
+
get_protocol_series: "analytics.getProtocolSeries",
|
|
73
|
+
list_market_volumes: "analytics.listMarketVolumes",
|
|
74
|
+
get_treasury_net_fees: "analytics.getTreasuryNetFees",
|
|
75
|
+
list_builders: "analytics.listBuilders",
|
|
76
|
+
get_builder: "analytics.getBuilder",
|
|
77
|
+
get_builder_totals: "analytics.getBuilderTotals",
|
|
78
|
+
get_builder_series: "analytics.getBuilderSeries",
|
|
79
|
+
list_builder_leaderboard: "analytics.listBuilderLeaderboard",
|
|
80
|
+
list_wallet_leaderboard: "analytics.listWalletLeaderboard",
|
|
81
|
+
get_wallet_summary: "analytics.getWalletSummary",
|
|
82
|
+
list_wallet_liquidations: "analytics.listWalletLiquidations",
|
|
83
|
+
list_token_custody: "analytics.listTokenCustody",
|
|
84
|
+
get_token_custody: "analytics.getTokenCustody",
|
|
85
|
+
list_vault_deposits: "analytics.listVaultDeposits",
|
|
86
|
+
list_vault_withdrawals: "analytics.listVaultWithdrawals",
|
|
62
87
|
list_managed_market_assignments: "managedMarkets.listAssignments",
|
|
63
88
|
claim_managed_market_lease: "managedMarkets.claimLease",
|
|
64
89
|
refresh_managed_market_quotes: "managedMarkets.refreshQuotes",
|
|
@@ -98,6 +123,7 @@ export const COVERED = {
|
|
|
98
123
|
get_sub_account_limits: "subAccounts.getLimits",
|
|
99
124
|
get_trade_by_id: "getTradeById",
|
|
100
125
|
get_trades: "getTrades",
|
|
126
|
+
list_trades: "listTrades",
|
|
101
127
|
get_trade_flow: "getTradeFlow",
|
|
102
128
|
get_trader_metrics: "getTraderMetrics",
|
|
103
129
|
get_liquidation_metrics: "getLiquidationMetrics",
|
|
@@ -122,6 +148,8 @@ export const COVERED = {
|
|
|
122
148
|
list_delegated_agents: "listDelegatedAgents",
|
|
123
149
|
list_funding_history: "listFundingHistory",
|
|
124
150
|
list_liquidation_events: "listLiquidationEvents",
|
|
151
|
+
list_all_liquidation_events: "listAllLiquidationEvents",
|
|
152
|
+
list_insurance_funds: "listInsuranceFunds",
|
|
125
153
|
list_funding_payments: "listFundingPayments",
|
|
126
154
|
list_margin_accounts: "listMarginAccounts",
|
|
127
155
|
list_position_history: "listPositionHistory",
|
package/dist/sdk.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApplicationsAPI, AuthAPI, AuthState, BuildercodesAPI, ComplianceAPI, CopyTradingAPI, DelegatedAgentsAPI, FaucetAPI, FeesAPI, ManagedMarketsAPI, MarginAccountsAPI, MarketAPI, MonacoSDK, Network, PortfolioAPI, PositionsAPI, ProfileAPI, PulseAPI, SDKConfig, SubAccountsAPI, SweeperAPI, TraderCodesAPI, TradingAPI, VaultAPI, WithdrawalsAPI } from "@0xmonaco/types";
|
|
1
|
+
import type { AnalyticsAPI, ApplicationsAPI, AuthAPI, AuthState, BuildercodesAPI, ComplianceAPI, CopyTradingAPI, DelegatedAgentsAPI, FaucetAPI, FeesAPI, ManagedMarketsAPI, MarginAccountsAPI, MarketAPI, MonacoSDK, Network, PortfolioAPI, PositionsAPI, ProfileAPI, PulseAPI, RfqAPI, SDKConfig, SubAccountsAPI, SweeperAPI, TraderCodesAPI, TradingAPI, VaultAPI, 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 {
|
|
@@ -8,6 +8,7 @@ export declare class MonacoSDKImpl implements MonacoSDK {
|
|
|
8
8
|
fees: FeesAPI;
|
|
9
9
|
buildercodes: BuildercodesAPI;
|
|
10
10
|
copyTrading: CopyTradingAPI;
|
|
11
|
+
rfq: RfqAPI;
|
|
11
12
|
tradercodes: TraderCodesAPI;
|
|
12
13
|
vault: VaultAPI;
|
|
13
14
|
withdrawals: WithdrawalsAPI;
|
|
@@ -23,6 +24,7 @@ export declare class MonacoSDKImpl implements MonacoSDK {
|
|
|
23
24
|
profile: ProfileAPI;
|
|
24
25
|
pulse: PulseAPI;
|
|
25
26
|
compliance: ComplianceAPI;
|
|
27
|
+
analytics: AnalyticsAPI;
|
|
26
28
|
orderbook: OrderbookAPIImpl;
|
|
27
29
|
trades: TradesAPIImpl;
|
|
28
30
|
ws: MonacoWebSocket;
|
package/dist/sdk.js
CHANGED
|
@@ -2,6 +2,7 @@ import { StatusCodes } from "http-status-codes";
|
|
|
2
2
|
import { createPublicClient, http } from "viem";
|
|
3
3
|
import { sei, seiTestnet } from "viem/chains";
|
|
4
4
|
import { ApplicationsAPIImpl, createMonacoWebSocket, OrderbookAPIImpl, TradesAPIImpl } from "./api";
|
|
5
|
+
import { AnalyticsAPIImpl } from "./api/analytics";
|
|
5
6
|
import { AuthAPIImpl } from "./api/auth";
|
|
6
7
|
import { BuildercodesAPIImpl } from "./api/buildercodes";
|
|
7
8
|
import { ComplianceAPIImpl } from "./api/compliance";
|
|
@@ -16,6 +17,7 @@ import { PortfolioAPIImpl } from "./api/portfolio";
|
|
|
16
17
|
import { PositionsAPIImpl } from "./api/positions";
|
|
17
18
|
import { ProfileAPIImpl } from "./api/profile";
|
|
18
19
|
import { PulseAPIImpl } from "./api/pulse";
|
|
20
|
+
import { RfqAPIImpl } from "./api/rfq";
|
|
19
21
|
import { SubAccountsAPIImpl } from "./api/sub-accounts";
|
|
20
22
|
import { SweeperAPIImpl } from "./api/sweeper";
|
|
21
23
|
import { TraderCodesAPIImpl } from "./api/tradercodes";
|
|
@@ -49,6 +51,7 @@ export class MonacoSDKImpl {
|
|
|
49
51
|
fees;
|
|
50
52
|
buildercodes;
|
|
51
53
|
copyTrading;
|
|
54
|
+
rfq;
|
|
52
55
|
tradercodes;
|
|
53
56
|
vault;
|
|
54
57
|
withdrawals;
|
|
@@ -64,6 +67,7 @@ export class MonacoSDKImpl {
|
|
|
64
67
|
profile;
|
|
65
68
|
pulse;
|
|
66
69
|
compliance;
|
|
70
|
+
analytics;
|
|
67
71
|
orderbook;
|
|
68
72
|
trades;
|
|
69
73
|
ws;
|
|
@@ -83,6 +87,7 @@ export class MonacoSDKImpl {
|
|
|
83
87
|
this.fees.setSessionKeypair(credentials);
|
|
84
88
|
this.buildercodes.setSessionKeypair(credentials);
|
|
85
89
|
this.copyTrading.setSessionKeypair(credentials);
|
|
90
|
+
this.rfq.setSessionKeypair(credentials);
|
|
86
91
|
this.tradercodes.setSessionKeypair(credentials);
|
|
87
92
|
this.vault.setSessionKeypair(credentials);
|
|
88
93
|
this.withdrawals.setSessionKeypair(credentials);
|
|
@@ -97,6 +102,7 @@ export class MonacoSDKImpl {
|
|
|
97
102
|
this.managedMarkets.setSessionKeypair(credentials);
|
|
98
103
|
this.pulse.setSessionKeypair(credentials);
|
|
99
104
|
this.compliance.setSessionKeypair(credentials);
|
|
105
|
+
this.analytics.setSessionKeypair(credentials);
|
|
100
106
|
this.profile.setSessionKeypair(credentials);
|
|
101
107
|
this.orderbook.setSessionKeypair(credentials);
|
|
102
108
|
this.trades.setSessionKeypair(credentials);
|
|
@@ -168,11 +174,13 @@ export class MonacoSDKImpl {
|
|
|
168
174
|
this.managedMarkets = configureSigning(new ManagedMarketsAPIImpl(apiUrl));
|
|
169
175
|
this.pulse = configureSigning(new PulseAPIImpl(apiUrl));
|
|
170
176
|
this.compliance = configureSigning(new ComplianceAPIImpl(apiUrl));
|
|
177
|
+
this.analytics = configureSigning(new AnalyticsAPIImpl(apiUrl));
|
|
171
178
|
this.auth = configureSigning(new AuthAPIImpl(this.walletClient, this.chain, apiUrl));
|
|
172
179
|
this.delegatedAgents = configureSigning(new DelegatedAgentsAPIImpl(apiUrl));
|
|
173
180
|
this.fees = configureSigning(new FeesAPIImpl(apiUrl));
|
|
174
181
|
this.buildercodes = configureSigning(new BuildercodesAPIImpl(apiUrl));
|
|
175
182
|
this.copyTrading = configureSigning(new CopyTradingAPIImpl(apiUrl));
|
|
183
|
+
this.rfq = configureSigning(new RfqAPIImpl(apiUrl));
|
|
176
184
|
this.tradercodes = configureSigning(new TraderCodesAPIImpl(apiUrl));
|
|
177
185
|
this.profile = configureSigning(new ProfileAPIImpl(apiUrl));
|
|
178
186
|
this.vault = configureSigning(new VaultAPIImpl(this.publicClient, this.walletClient, this.chain, this.applications, this.profile, apiUrl));
|
|
@@ -7,7 +7,10 @@ export declare const MIN_BUCKETS_ALLOWED = 10;
|
|
|
7
7
|
*/
|
|
8
8
|
export declare const MAX_BUCKETS_ALLOWED = 10000000;
|
|
9
9
|
/**
|
|
10
|
-
* All possible magnitude values we support (from 0.
|
|
10
|
+
* All possible magnitude values we support (from 0.000001 to 10000).
|
|
11
|
+
*
|
|
12
|
+
* The finest grouping is the 6-decimal USDC unit, so every pair's tick has a
|
|
13
|
+
* grouping at its own precision (the SEI and FARTCOIN perps trade on 0.00001).
|
|
11
14
|
*/
|
|
12
15
|
export declare const ALL_MAGNITUDES: number[];
|
|
13
16
|
/**
|
|
@@ -21,6 +24,6 @@ export declare const ALL_MAGNITUDES: number[];
|
|
|
21
24
|
* @example
|
|
22
25
|
* calculateValidMagnitudes(112000); // [0.1, 1, 10, 100, 1000, 10000]
|
|
23
26
|
* calculateValidMagnitudes(4200); // [0.001, 0.01, 0.1, 1, 10, 100]
|
|
24
|
-
* calculateValidMagnitudes(0.5); // [0.0001, 0.001, 0.01]
|
|
27
|
+
* calculateValidMagnitudes(0.5); // [0.000001, 0.00001, 0.0001, 0.001, 0.01]
|
|
25
28
|
*/
|
|
26
29
|
export declare const calculateValidMagnitudes: (currentPrice: number) => number[];
|
package/dist/utils/magnitude.js
CHANGED
|
@@ -7,9 +7,12 @@ export const MIN_BUCKETS_ALLOWED = 10;
|
|
|
7
7
|
*/
|
|
8
8
|
export const MAX_BUCKETS_ALLOWED = 10_000_000;
|
|
9
9
|
/**
|
|
10
|
-
* All possible magnitude values we support (from 0.
|
|
10
|
+
* All possible magnitude values we support (from 0.000001 to 10000).
|
|
11
|
+
*
|
|
12
|
+
* The finest grouping is the 6-decimal USDC unit, so every pair's tick has a
|
|
13
|
+
* grouping at its own precision (the SEI and FARTCOIN perps trade on 0.00001).
|
|
11
14
|
*/
|
|
12
|
-
export const ALL_MAGNITUDES = [0.0001, 0.001, 0.01, 0.1, 1, 10, 100, 1000, 10000];
|
|
15
|
+
export const ALL_MAGNITUDES = [0.000001, 0.00001, 0.0001, 0.001, 0.01, 0.1, 1, 10, 100, 1000, 10000];
|
|
13
16
|
/**
|
|
14
17
|
* Calculate which magnitude levels are valid for a given price.
|
|
15
18
|
*
|
|
@@ -21,7 +24,7 @@ export const ALL_MAGNITUDES = [0.0001, 0.001, 0.01, 0.1, 1, 10, 100, 1000, 10000
|
|
|
21
24
|
* @example
|
|
22
25
|
* calculateValidMagnitudes(112000); // [0.1, 1, 10, 100, 1000, 10000]
|
|
23
26
|
* calculateValidMagnitudes(4200); // [0.001, 0.01, 0.1, 1, 10, 100]
|
|
24
|
-
* calculateValidMagnitudes(0.5); // [0.0001, 0.001, 0.01]
|
|
27
|
+
* calculateValidMagnitudes(0.5); // [0.000001, 0.00001, 0.0001, 0.001, 0.01]
|
|
25
28
|
*/
|
|
26
29
|
export const calculateValidMagnitudes = (currentPrice) => {
|
|
27
30
|
return ALL_MAGNITUDES.filter((magnitude) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5-develop.129b2c6",
|
|
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.1.
|
|
23
|
-
"@0xmonaco/types": "1.1.
|
|
22
|
+
"@0xmonaco/contracts": "1.1.5-develop.129b2c6",
|
|
23
|
+
"@0xmonaco/types": "1.1.5-develop.129b2c6",
|
|
24
24
|
"@noble/curves": "^2.4.0",
|
|
25
25
|
"@noble/hashes": "^2.4.0",
|
|
26
26
|
"http-status-codes": "^2.3.0"
|