@0xmonaco/core 0.8.7-develop.5d0e403 → 0.8.7-develop.ab57a24
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/margin-accounts/api.js +2 -0
- package/dist/api/profile/api.d.ts +18 -1
- package/dist/api/profile/api.js +41 -1
- package/dist/coverage.d.ts +82 -2
- package/dist/coverage.js +82 -2
- package/package.json +3 -3
|
@@ -22,6 +22,8 @@ export class MarginAccountsAPIImpl extends BaseAPI {
|
|
|
22
22
|
body: JSON.stringify({
|
|
23
23
|
label: request?.label,
|
|
24
24
|
collateral_asset: request?.collateralAsset,
|
|
25
|
+
margin_mode: request?.marginMode,
|
|
26
|
+
selected_trading_pair_ids: request?.selectedTradingPairIds,
|
|
25
27
|
}),
|
|
26
28
|
});
|
|
27
29
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* console.log(`User: ${profile.username} (${profile.address})`);
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
import type { AccountBalance, GetPaginatedUserMovementsResponse, GetUserBalancesParams, GetUserBalancesResponse, GetUserMovementsParams, GetUserTradesParams, GetUserTradesResponse, PortfolioChartResponse, PortfolioMetric, PortfolioPeriod, PortfolioStats, ProfileAPI, UserProfile } from "@0xmonaco/types";
|
|
20
|
+
import type { AccountBalance, GetPaginatedUserMovementsResponse, GetUserBalancesParams, GetUserBalancesResponse, GetUserMovementsParams, GetUserTradesParams, GetUserTradesResponse, ListFundingPaymentsParams, ListFundingPaymentsResponse, PortfolioChartResponse, PortfolioMetric, PortfolioPeriod, PortfolioStats, ProfileAPI, UserProfile } from "@0xmonaco/types";
|
|
21
21
|
import { BaseAPI } from "../base";
|
|
22
22
|
export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
|
|
23
23
|
/**
|
|
@@ -188,4 +188,21 @@ export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
|
|
|
188
188
|
* ```
|
|
189
189
|
*/
|
|
190
190
|
getUserTrades(params?: GetUserTradesParams): Promise<GetUserTradesResponse>;
|
|
191
|
+
/**
|
|
192
|
+
* List the current user's funding payment history with pagination and filters.
|
|
193
|
+
*
|
|
194
|
+
* Fetches funding payments from the /api/v1/accounts/funding-payments endpoint.
|
|
195
|
+
* Requires a valid access token to be set.
|
|
196
|
+
*
|
|
197
|
+
* @param params - Optional query parameters for pagination and filtering
|
|
198
|
+
* @returns Promise resolving to paginated funding payments response
|
|
199
|
+
* @throws {APIError} When the request fails or user is not authenticated
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```typescript
|
|
203
|
+
* const funding = await profileAPI.listFundingPayments({ trading_pair_id: "550e8400-e29b-41d4-a716-446655440000" });
|
|
204
|
+
* console.log(`Total funding payments: ${funding.total}`);
|
|
205
|
+
* ```
|
|
206
|
+
*/
|
|
207
|
+
listFundingPayments(params?: ListFundingPaymentsParams): Promise<ListFundingPaymentsResponse>;
|
|
191
208
|
}
|
package/dist/api/profile/api.js
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* console.log(`User: ${profile.username} (${profile.address})`);
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
import { GetUserMovementsSchema, GetUserTradesSchema, validate } from "@0xmonaco/types";
|
|
20
|
+
import { GetUserMovementsSchema, GetUserTradesSchema, ListFundingPaymentsSchema, validate } from "@0xmonaco/types";
|
|
21
21
|
import { APIError } from "../../errors";
|
|
22
22
|
import { BaseAPI } from "../base";
|
|
23
23
|
export class ProfileAPIImpl extends BaseAPI {
|
|
@@ -256,4 +256,44 @@ export class ProfileAPIImpl extends BaseAPI {
|
|
|
256
256
|
const url = queryString ? `/api/v1/accounts/trades?${queryString}` : "/api/v1/accounts/trades";
|
|
257
257
|
return await this.makeAuthenticatedRequest(url);
|
|
258
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* List the current user's funding payment history with pagination and filters.
|
|
261
|
+
*
|
|
262
|
+
* Fetches funding payments from the /api/v1/accounts/funding-payments endpoint.
|
|
263
|
+
* Requires a valid access token to be set.
|
|
264
|
+
*
|
|
265
|
+
* @param params - Optional query parameters for pagination and filtering
|
|
266
|
+
* @returns Promise resolving to paginated funding payments response
|
|
267
|
+
* @throws {APIError} When the request fails or user is not authenticated
|
|
268
|
+
*
|
|
269
|
+
* @example
|
|
270
|
+
* ```typescript
|
|
271
|
+
* const funding = await profileAPI.listFundingPayments({ trading_pair_id: "550e8400-e29b-41d4-a716-446655440000" });
|
|
272
|
+
* console.log(`Total funding payments: ${funding.total}`);
|
|
273
|
+
* ```
|
|
274
|
+
*/
|
|
275
|
+
async listFundingPayments(params) {
|
|
276
|
+
if (params) {
|
|
277
|
+
validate(ListFundingPaymentsSchema, params);
|
|
278
|
+
}
|
|
279
|
+
const searchParams = new URLSearchParams();
|
|
280
|
+
if (params?.page !== undefined) {
|
|
281
|
+
searchParams.append("page", params.page.toString());
|
|
282
|
+
}
|
|
283
|
+
if (params?.page_size !== undefined) {
|
|
284
|
+
searchParams.append("page_size", params.page_size.toString());
|
|
285
|
+
}
|
|
286
|
+
if (params?.trading_pair_id !== undefined) {
|
|
287
|
+
searchParams.append("trading_pair_id", params.trading_pair_id);
|
|
288
|
+
}
|
|
289
|
+
if (params?.position_id !== undefined) {
|
|
290
|
+
searchParams.append("position_id", params.position_id);
|
|
291
|
+
}
|
|
292
|
+
if (params?.margin_account_id !== undefined) {
|
|
293
|
+
searchParams.append("margin_account_id", params.margin_account_id);
|
|
294
|
+
}
|
|
295
|
+
const queryString = searchParams.toString();
|
|
296
|
+
const url = queryString ? `/api/v1/accounts/funding-payments?${queryString}` : "/api/v1/accounts/funding-payments";
|
|
297
|
+
return await this.makeAuthenticatedRequest(url);
|
|
298
|
+
}
|
|
259
299
|
}
|
package/dist/coverage.d.ts
CHANGED
|
@@ -1,7 +1,87 @@
|
|
|
1
|
+
/** operationId → the @0xmonaco/core client method that covers it. */
|
|
2
|
+
export declare const COVERED: {
|
|
3
|
+
add_position_margin: string;
|
|
4
|
+
attach_position_tp_sl: string;
|
|
5
|
+
batch_cancel_all: string;
|
|
6
|
+
batch_cancel_all_by_pair: string;
|
|
7
|
+
batch_cancel_orders: string;
|
|
8
|
+
batch_create_orders: string;
|
|
9
|
+
batch_replace_orders: string;
|
|
10
|
+
cancel_conditional_order: string;
|
|
11
|
+
cancel_order: string;
|
|
12
|
+
close_position: string;
|
|
13
|
+
create_challenge: string;
|
|
14
|
+
create_conditional_order: string;
|
|
15
|
+
create_delegated_session: string;
|
|
16
|
+
create_order: string;
|
|
17
|
+
create_sub_account_limit: string;
|
|
18
|
+
delete_sub_account_limit: string;
|
|
19
|
+
ensure_parent_margin_account: string;
|
|
20
|
+
get_application_config: string;
|
|
21
|
+
get_application_stats: string;
|
|
22
|
+
get_available_collateral: string;
|
|
23
|
+
get_candles: string;
|
|
24
|
+
get_funding_state: string;
|
|
25
|
+
get_index_price: string;
|
|
26
|
+
get_margin_account_movements: string;
|
|
27
|
+
get_margin_account_summary: string;
|
|
28
|
+
get_mark_price: string;
|
|
29
|
+
get_market_metadata: string;
|
|
30
|
+
get_open_interest: string;
|
|
31
|
+
get_order_by_id: string;
|
|
32
|
+
get_orderbook_snapshot: string;
|
|
33
|
+
get_orders: string;
|
|
34
|
+
get_perp_market_config: string;
|
|
35
|
+
get_perp_market_summary: string;
|
|
36
|
+
get_portfolio_chart: string;
|
|
37
|
+
get_portfolio_stats: string;
|
|
38
|
+
get_position: string;
|
|
39
|
+
get_position_risk: string;
|
|
40
|
+
get_screener: string;
|
|
41
|
+
get_sub_account_limits: string;
|
|
42
|
+
get_trade_by_id: string;
|
|
43
|
+
get_trades: string;
|
|
44
|
+
get_trading_pair_by_id: string;
|
|
45
|
+
get_user_balance_by_asset: string;
|
|
46
|
+
get_user_balances: string;
|
|
47
|
+
get_user_movements: string;
|
|
48
|
+
get_user_profile: string;
|
|
49
|
+
get_user_trades: string;
|
|
50
|
+
get_withdrawal: string;
|
|
51
|
+
initiate_withdrawal: string;
|
|
52
|
+
list_application_balances: string;
|
|
53
|
+
list_application_movements: string;
|
|
54
|
+
list_application_orders: string;
|
|
55
|
+
list_application_users: string;
|
|
56
|
+
list_conditional_orders: string;
|
|
57
|
+
list_delegated_agent_owners: string;
|
|
58
|
+
list_delegated_agents: string;
|
|
59
|
+
list_funding_history: string;
|
|
60
|
+
list_funding_payments: string;
|
|
61
|
+
list_margin_accounts: string;
|
|
62
|
+
list_position_history: string;
|
|
63
|
+
list_positions: string;
|
|
64
|
+
list_sub_accounts_with_balances: string;
|
|
65
|
+
list_trading_pairs: string;
|
|
66
|
+
mint_tokens: string;
|
|
67
|
+
reduce_position_margin: string;
|
|
68
|
+
refresh_session: string;
|
|
69
|
+
replace_order: string;
|
|
70
|
+
revoke_delegated_agent: string;
|
|
71
|
+
revoke_session: string;
|
|
72
|
+
simulate_auto_margin_order_risk: string;
|
|
73
|
+
simulate_fees: string;
|
|
74
|
+
simulate_order_risk: string;
|
|
75
|
+
submit_whitelist: string;
|
|
76
|
+
transfer_collateral_from_margin_account: string;
|
|
77
|
+
transfer_collateral_to_auto_margin_account: string;
|
|
78
|
+
transfer_collateral_to_margin_account: string;
|
|
79
|
+
update_sub_account_limit: string;
|
|
80
|
+
upsert_delegated_agent: string;
|
|
81
|
+
verify_signature: string;
|
|
82
|
+
};
|
|
1
83
|
/** operationId → reason it is intentionally not covered by @0xmonaco/core. */
|
|
2
84
|
export declare const INTENTIONALLY_EXCLUDED: {
|
|
3
85
|
authenticate_backend: string;
|
|
4
86
|
health_check: string;
|
|
5
|
-
list_funding_payments: string;
|
|
6
|
-
list_user_trades: string;
|
|
7
87
|
};
|
package/dist/coverage.js
CHANGED
|
@@ -1,7 +1,87 @@
|
|
|
1
|
+
/** operationId → the @0xmonaco/core client method that covers it. */
|
|
2
|
+
export const COVERED = {
|
|
3
|
+
add_position_margin: "addPositionMargin",
|
|
4
|
+
attach_position_tp_sl: "attachPositionTpSl",
|
|
5
|
+
batch_cancel_all: "batchCancelAll",
|
|
6
|
+
batch_cancel_all_by_pair: "batchCancelAll (with tradingPairId)",
|
|
7
|
+
batch_cancel_orders: "batchCancel",
|
|
8
|
+
batch_create_orders: "batchCreate",
|
|
9
|
+
batch_replace_orders: "batchReplace",
|
|
10
|
+
cancel_conditional_order: "cancelConditionalOrder",
|
|
11
|
+
cancel_order: "cancelOrder",
|
|
12
|
+
close_position: "closePosition",
|
|
13
|
+
create_challenge: "createChallenge",
|
|
14
|
+
create_conditional_order: "createConditionalOrder",
|
|
15
|
+
create_delegated_session: "createDelegatedSession",
|
|
16
|
+
create_order: "placeLimitOrder / placeMarketOrder",
|
|
17
|
+
create_sub_account_limit: "subAccounts.createLimit",
|
|
18
|
+
delete_sub_account_limit: "subAccounts.deleteLimit",
|
|
19
|
+
ensure_parent_margin_account: "ensureParentMarginAccount",
|
|
20
|
+
get_application_config: "getApplicationConfig",
|
|
21
|
+
get_application_stats: "getApplicationStats",
|
|
22
|
+
get_available_collateral: "getAvailableCollateral",
|
|
23
|
+
get_candles: "getCandlesticks",
|
|
24
|
+
get_funding_state: "getFundingState",
|
|
25
|
+
get_index_price: "getIndexPrice",
|
|
26
|
+
get_margin_account_movements: "getMarginAccountMovements",
|
|
27
|
+
get_margin_account_summary: "getMarginAccountSummary",
|
|
28
|
+
get_mark_price: "getMarkPrice",
|
|
29
|
+
get_market_metadata: "getMarketMetadata",
|
|
30
|
+
get_open_interest: "getOpenInterest",
|
|
31
|
+
get_order_by_id: "getOrder",
|
|
32
|
+
get_orderbook_snapshot: "getOrderbook",
|
|
33
|
+
get_orders: "getPaginatedOrders",
|
|
34
|
+
get_perp_market_config: "getPerpMarketConfig",
|
|
35
|
+
get_perp_market_summary: "getPerpMarketSummary",
|
|
36
|
+
get_portfolio_chart: "getPortfolioChart",
|
|
37
|
+
get_portfolio_stats: "getPortfolioStats",
|
|
38
|
+
get_position: "getPosition",
|
|
39
|
+
get_position_risk: "getPositionRisk",
|
|
40
|
+
get_screener: "getScreener",
|
|
41
|
+
get_sub_account_limits: "subAccounts.getLimits",
|
|
42
|
+
get_trade_by_id: "getTradeById",
|
|
43
|
+
get_trades: "getTrades",
|
|
44
|
+
get_trading_pair_by_id: "getTradingPair",
|
|
45
|
+
get_user_balance_by_asset: "getUserBalanceByAssetId",
|
|
46
|
+
get_user_balances: "getUserBalances",
|
|
47
|
+
get_user_movements: "getPaginatedUserMovements",
|
|
48
|
+
get_user_profile: "getProfile",
|
|
49
|
+
get_user_trades: "getUserTrades",
|
|
50
|
+
get_withdrawal: "getWithdrawal",
|
|
51
|
+
initiate_withdrawal: "initiateWithdrawal",
|
|
52
|
+
list_application_balances: "listApplicationBalances",
|
|
53
|
+
list_application_movements: "listApplicationMovements",
|
|
54
|
+
list_application_orders: "listApplicationOrders",
|
|
55
|
+
list_application_users: "listApplicationUsers",
|
|
56
|
+
list_conditional_orders: "listConditionalOrders",
|
|
57
|
+
list_delegated_agent_owners: "listDelegatedOwners",
|
|
58
|
+
list_delegated_agents: "listDelegatedAgents",
|
|
59
|
+
list_funding_history: "listFundingHistory",
|
|
60
|
+
list_funding_payments: "listFundingPayments",
|
|
61
|
+
list_margin_accounts: "listMarginAccounts",
|
|
62
|
+
list_position_history: "listPositionHistory",
|
|
63
|
+
list_positions: "listPositions",
|
|
64
|
+
list_sub_accounts_with_balances: "subAccounts.list",
|
|
65
|
+
list_trading_pairs: "getPaginatedTradingPairs",
|
|
66
|
+
mint_tokens: "faucet.mint",
|
|
67
|
+
reduce_position_margin: "reducePositionMargin",
|
|
68
|
+
refresh_session: "refreshSession",
|
|
69
|
+
replace_order: "replaceOrder",
|
|
70
|
+
revoke_delegated_agent: "revokeDelegatedAgent",
|
|
71
|
+
revoke_session: "revokeSession",
|
|
72
|
+
simulate_auto_margin_order_risk: "simulateAutoMarginOrderRisk",
|
|
73
|
+
simulate_fees: "simulateFees",
|
|
74
|
+
simulate_order_risk: "simulateOrderRisk",
|
|
75
|
+
submit_whitelist: "whitelist.submit",
|
|
76
|
+
transfer_collateral_from_margin_account: "transferCollateralFromMarginAccount",
|
|
77
|
+
transfer_collateral_to_auto_margin_account: "transferCollateralToAutoMarginAccount",
|
|
78
|
+
transfer_collateral_to_margin_account: "transferCollateralToMarginAccount",
|
|
79
|
+
update_sub_account_limit: "subAccounts.updateLimit",
|
|
80
|
+
upsert_delegated_agent: "upsertDelegatedAgent",
|
|
81
|
+
verify_signature: "verifySignature",
|
|
82
|
+
};
|
|
1
83
|
/** operationId → reason it is intentionally not covered by @0xmonaco/core. */
|
|
2
84
|
export const INTENTIONALLY_EXCLUDED = {
|
|
3
85
|
authenticate_backend: "Backend auth is header-based via setServerKey()/the x-server-key header, not an endpoint method (MON-1486).",
|
|
4
86
|
health_check: "Infrastructure liveness probe (GET /health); not part of the data SDK surface.",
|
|
5
|
-
list_funding_payments: "gRPC-only: accounts.proto declares the HTTP annotation but api-gateway-rust has no Actix route for GET /api/v1/accounts/funding-payments, so it is unreachable from a REST client.",
|
|
6
|
-
list_user_trades: "gRPC-only: trades.proto declares the HTTP annotation but there is no Actix route; GET /api/v1/trades/user is shadowed by GET /api/v1/trades/{id}. Equivalent data is exposed via get_user_trades (GET /api/v1/accounts/trades).",
|
|
7
87
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/core",
|
|
3
|
-
"version": "0.8.7-develop.
|
|
3
|
+
"version": "0.8.7-develop.ab57a24",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"viem": "^2.45.2"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@0xmonaco/contracts": "0.8.7-develop.
|
|
27
|
-
"@0xmonaco/types": "0.8.7-develop.
|
|
26
|
+
"@0xmonaco/contracts": "0.8.7-develop.ab57a24",
|
|
27
|
+
"@0xmonaco/types": "0.8.7-develop.ab57a24",
|
|
28
28
|
"@noble/curves": "^1.9.1",
|
|
29
29
|
"@noble/hashes": "^1.8.0",
|
|
30
30
|
"http-status-codes": "^2.3.0"
|