@0xmonaco/core 1.0.72 → 1.0.73

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.
@@ -19,7 +19,7 @@
19
19
  * console.log(`Now tradeable: ${result.tradingBalance}`);
20
20
  * ```
21
21
  */
22
- import type { BuildercodesAPI, ClaimBuildercodeRewardsParams, ClaimBuildercodeRewardsResponse, GetBuildercodePayoutSummaryResponse, GetBuildercodeRewardsBalanceResponse, GetBuildercodesConfigResponse, ListBuildercodePayoutsParams, ListBuildercodePayoutsResponse } from "@0xmonaco/types";
22
+ import type { BuildercodesAPI, ClaimBuildercodeRewardsParams, ClaimBuildercodeRewardsResponse, GetBuildercodePayoutSummaryResponse, GetBuildercodeRewardsBalanceResponse, GetBuildercodesConfigResponse, ListBuildercodePayoutsParams, ListBuildercodePayoutsResponse, ListBuilderFeeChangesParams, ListBuilderFeeChangesResponse, SetBuilderFeeParams, SetBuilderFeeResponse } from "@0xmonaco/types";
23
23
  import { BaseAPI } from "../base";
24
24
  export declare class BuildercodesAPIImpl extends BaseAPI implements BuildercodesAPI {
25
25
  /**
@@ -30,11 +30,15 @@ export declare class BuildercodesAPIImpl extends BaseAPI implements Buildercodes
30
30
  * application's configured payout address.
31
31
  */
32
32
  getConfig(): Promise<GetBuildercodesConfigResponse>;
33
+ /** Set this frontend's builder fee. */
34
+ setBuilderFee(params: SetBuilderFeeParams): Promise<SetBuilderFeeResponse>;
35
+ /** List this frontend's builder-fee audit log, newest first. */
36
+ listBuilderFeeChanges(params?: ListBuilderFeeChangesParams): Promise<ListBuilderFeeChangesResponse>;
33
37
  /**
34
38
  * List this frontend's per-trade BuilderCodes credits, newest first. Each
35
- * credit carries its payout `kind`: `REVENUE_SHARE` (your share of Monaco's
36
- * fee) or `BUILDER_FEE` (your builder fee). Pass `kind` to list one stream;
37
- * `total` then counts only that stream.
39
+ * credit carries its payout `kind`. `REVENUE_SHARE` is active;
40
+ * `BUILDER_FEE` is reserved and is not currently emitted. Pass `kind` to
41
+ * filter the list; `total` then counts only that category.
38
42
  *
39
43
  * The server scopes every query to the authenticated application; neither
40
44
  * the application id nor payout wallet can be supplied by the caller.
@@ -19,7 +19,7 @@
19
19
  * console.log(`Now tradeable: ${result.tradingBalance}`);
20
20
  * ```
21
21
  */
22
- import { ClaimBuildercodeRewardsParamsSchema, ListBuildercodePayoutsParamsSchema, validate } from "@0xmonaco/types";
22
+ import { ClaimBuildercodeRewardsParamsSchema, ListBuildercodePayoutsParamsSchema, ListBuilderFeeChangesParamsSchema, SetBuilderFeeParamsSchema, validate, } from "@0xmonaco/types";
23
23
  import { APIError } from "../../errors";
24
24
  import { BaseAPI } from "../base";
25
25
  /**
@@ -102,11 +102,35 @@ export class BuildercodesAPIImpl extends BaseAPI {
102
102
  method: "GET",
103
103
  });
104
104
  }
105
+ /** Set this frontend's builder fee. */
106
+ async setBuilderFee(params) {
107
+ const validated = validate(SetBuilderFeeParamsSchema, params);
108
+ return this.makeAuthenticatedRequest("/api/v1/buildercodes/builder-fee", {
109
+ method: "PUT",
110
+ body: JSON.stringify({ bps: validated.bps }),
111
+ });
112
+ }
113
+ /** List this frontend's builder-fee audit log, newest first. */
114
+ async listBuilderFeeChanges(params) {
115
+ if (params) {
116
+ validate(ListBuilderFeeChangesParamsSchema, params);
117
+ }
118
+ const searchParams = new URLSearchParams();
119
+ if (params?.pageSize !== undefined) {
120
+ searchParams.append("pageSize", params.pageSize.toString());
121
+ }
122
+ if (params?.pageToken !== undefined) {
123
+ searchParams.append("pageToken", params.pageToken);
124
+ }
125
+ const query = searchParams.toString();
126
+ const path = query ? `/api/v1/buildercodes/builder-fee/changes?${query}` : "/api/v1/buildercodes/builder-fee/changes";
127
+ return this.makeAuthenticatedRequest(path, { method: "GET" });
128
+ }
105
129
  /**
106
130
  * List this frontend's per-trade BuilderCodes credits, newest first. Each
107
- * credit carries its payout `kind`: `REVENUE_SHARE` (your share of Monaco's
108
- * fee) or `BUILDER_FEE` (your builder fee). Pass `kind` to list one stream;
109
- * `total` then counts only that stream.
131
+ * credit carries its payout `kind`. `REVENUE_SHARE` is active;
132
+ * `BUILDER_FEE` is reserved and is not currently emitted. Pass `kind` to
133
+ * filter the list; `total` then counts only that category.
110
134
  *
111
135
  * The server scopes every query to the authenticated application; neither
112
136
  * the application id nor payout wallet can be supplied by the caller.
@@ -105,6 +105,7 @@ export declare const COVERED: {
105
105
  list_application_orders: string;
106
106
  list_application_users: string;
107
107
  list_buildercode_payouts: string;
108
+ list_builder_fee_changes: string;
108
109
  list_conditional_orders: string;
109
110
  list_delegated_agent_owners: string;
110
111
  list_delegated_agents: string;
@@ -132,6 +133,7 @@ export declare const COVERED: {
132
133
  transfer_collateral_to_parent_margin_account: string;
133
134
  transfer_collateral_to_risk_bucket: string;
134
135
  claim_buildercode_rewards: string;
136
+ set_builder_fee: string;
135
137
  transfer_rewards: string;
136
138
  update_sub_account_limit: string;
137
139
  upsert_delegated_agent: string;
package/dist/coverage.js CHANGED
@@ -105,6 +105,7 @@ export const COVERED = {
105
105
  list_application_orders: "listApplicationOrders",
106
106
  list_application_users: "listApplicationUsers",
107
107
  list_buildercode_payouts: "buildercodes.listPayouts",
108
+ list_builder_fee_changes: "buildercodes.listBuilderFeeChanges",
108
109
  list_conditional_orders: "listConditionalOrders",
109
110
  list_delegated_agent_owners: "listDelegatedOwners",
110
111
  list_delegated_agents: "listDelegatedAgents",
@@ -132,6 +133,7 @@ export const COVERED = {
132
133
  transfer_collateral_to_parent_margin_account: "transferCollateralToParentMarginAccount",
133
134
  transfer_collateral_to_risk_bucket: "transferCollateralToRiskBucket",
134
135
  claim_buildercode_rewards: "buildercodes.claimBuildercodeRewards",
136
+ set_builder_fee: "buildercodes.setBuilderFee",
135
137
  transfer_rewards: "pitpass.transferRewards",
136
138
  update_sub_account_limit: "subAccounts.updateLimit",
137
139
  upsert_delegated_agent: "upsertDelegatedAgent",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/core",
3
- "version": "1.0.72",
3
+ "version": "1.0.73",
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.72",
23
- "@0xmonaco/types": "1.0.72",
22
+ "@0xmonaco/contracts": "1.0.73",
23
+ "@0xmonaco/types": "1.0.73",
24
24
  "@noble/curves": "^1.9.1",
25
25
  "@noble/hashes": "^2.4.0",
26
26
  "http-status-codes": "^2.3.0"