@0xmonaco/core 1.0.58 → 1.0.59

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.
@@ -75,10 +75,24 @@ export declare class AuthAPIImpl extends BaseAPI implements AuthAPI {
75
75
  /**
76
76
  * Signs a challenge message using the wallet client.
77
77
  *
78
- * Signs the provided message using the wallet's private key.
79
- * This is used in the authentication flow to prove ownership of the wallet.
80
- *
81
- * @param message - The message to sign
78
+ * Asks the connected wallet to authorize the message, proving control of the
79
+ * address. An EOA signs it with its private key (EIP-191 `personal_sign`). A
80
+ * smart-contract wallet such as a Safe has no private key and returns a
81
+ * signature its own contract will accept, which the server checks under
82
+ * EIP-1271; the wallet client handles that difference, and the returned value
83
+ * is submitted unchanged either way.
84
+ *
85
+ * The returned signature is therefore not guaranteed to be 65 bytes — a
86
+ * contract signature is usually longer — so callers must not assume the EOA
87
+ * shape.
88
+ *
89
+ * Note the scope. Server-side EIP-1271 verification is deliberately narrow:
90
+ * it is offered only to a wallet holding a BuilderCodes payout bucket, on a
91
+ * deployment with the contract-wallet flag on and a chain RPC endpoint
92
+ * configured. An ordinary smart-contract trading account is not covered — it
93
+ * still takes the recovery path, which it cannot satisfy.
94
+ *
95
+ * @param message - The message to authorize
82
96
  * @returns Promise resolving to the signature
83
97
  * @throws {InvalidConfigError} When wallet account is not available
84
98
  * @throws {APIError} When signing fails
@@ -102,10 +102,24 @@ export class AuthAPIImpl extends BaseAPI {
102
102
  /**
103
103
  * Signs a challenge message using the wallet client.
104
104
  *
105
- * Signs the provided message using the wallet's private key.
106
- * This is used in the authentication flow to prove ownership of the wallet.
105
+ * Asks the connected wallet to authorize the message, proving control of the
106
+ * address. An EOA signs it with its private key (EIP-191 `personal_sign`). A
107
+ * smart-contract wallet such as a Safe has no private key and returns a
108
+ * signature its own contract will accept, which the server checks under
109
+ * EIP-1271; the wallet client handles that difference, and the returned value
110
+ * is submitted unchanged either way.
107
111
  *
108
- * @param message - The message to sign
112
+ * The returned signature is therefore not guaranteed to be 65 bytes — a
113
+ * contract signature is usually longer — so callers must not assume the EOA
114
+ * shape.
115
+ *
116
+ * Note the scope. Server-side EIP-1271 verification is deliberately narrow:
117
+ * it is offered only to a wallet holding a BuilderCodes payout bucket, on a
118
+ * deployment with the contract-wallet flag on and a chain RPC endpoint
119
+ * configured. An ordinary smart-contract trading account is not covered — it
120
+ * still takes the recovery path, which it cannot satisfy.
121
+ *
122
+ * @param message - The message to authorize
109
123
  * @returns Promise resolving to the signature
110
124
  * @throws {InvalidConfigError} When wallet account is not available
111
125
  * @throws {APIError} When signing fails
@@ -0,0 +1,81 @@
1
+ /**
2
+ * BuilderCodes API Implementation
3
+ *
4
+ * Provides authenticated reads of an enrolled frontend's BuilderCodes program,
5
+ * earnings, and reserved balance, plus the claim into a tradeable balance.
6
+ *
7
+ * `claimBuildercodeRewards` requires authentication: the payout bucket is
8
+ * resolved from the authenticated caller's own wallet address, so a caller can
9
+ * only ever claim their own accrued balance.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * // Claim accrued payout balance into a trading balance (authenticated)
14
+ * const result = await sdk.buildercodes.claimBuildercodeRewards({
15
+ * token: "0x0000000000000000000000000000000000000002",
16
+ * amount: "1000000",
17
+ * });
18
+ * console.log(`Payout remaining: ${result.payoutBalance}`);
19
+ * console.log(`Now tradeable: ${result.tradingBalance}`);
20
+ * ```
21
+ */
22
+ import type { BuildercodesAPI, ClaimBuildercodeRewardsParams, ClaimBuildercodeRewardsResponse, GetBuildercodePayoutSummaryResponse, GetBuildercodeRewardsBalanceResponse, GetBuildercodesConfigResponse, ListBuildercodePayoutsParams, ListBuildercodePayoutsResponse } from "@0xmonaco/types";
23
+ import { BaseAPI } from "../base";
24
+ export declare class BuildercodesAPIImpl extends BaseAPI implements BuildercodesAPI {
25
+ /**
26
+ * Read this frontend's current BuilderCodes program state.
27
+ *
28
+ * The application comes from the authenticated session; callers cannot
29
+ * select another application. The authenticated wallet must match the
30
+ * application's configured payout address.
31
+ */
32
+ getConfig(): Promise<GetBuildercodesConfigResponse>;
33
+ /**
34
+ * List this frontend's per-trade BuilderCodes credits, newest first.
35
+ *
36
+ * The server scopes every query to the authenticated application; neither
37
+ * the application id nor payout wallet can be supplied by the caller.
38
+ */
39
+ listPayouts(params?: ListBuildercodePayoutsParams): Promise<ListBuildercodePayoutsResponse>;
40
+ /**
41
+ * Summarize this frontend's BuilderCodes earnings by token.
42
+ *
43
+ * Amounts are RAW atomic units and remain separated by token.
44
+ */
45
+ getPayoutSummary(): Promise<GetBuildercodePayoutSummaryResponse>;
46
+ /**
47
+ * Read the authenticated wallet's available BuilderCodes reward balances.
48
+ *
49
+ * Current enrollment is not required: a former payout wallet can still see
50
+ * and claim the balance it accrued before an address rotation.
51
+ */
52
+ getRewardsBalance(): Promise<GetBuildercodeRewardsBalanceResponse>;
53
+ /**
54
+ * Claim accrued BuilderCodes payout balance into a trading balance.
55
+ *
56
+ * Throws 403 when the caller is refused — either BuilderCodes is not
57
+ * enabled, or the session is a delegated agent. Delegated sessions are
58
+ * refused before the feature flag is read, so a 403 there is permanent for
59
+ * that session type rather than a rollout state.
60
+ *
61
+ * Throws 409 when the payout balance is insufficient for the requested
62
+ * amount (including when the caller has never accrued a share).
63
+ *
64
+ * Throws 503 when the matching engine is unreachable, restarting, or slow to
65
+ * answer. Treat that as an UNKNOWN outcome rather than a rejection: the claim
66
+ * is admitted to the sequencer before its reply is sent, so it may still
67
+ * commit, and there is no idempotency key — a blind retry can claim twice.
68
+ * Do not retry automatically, and do not settle it with a balance read: an
69
+ * admitted claim can still be queued, so an unchanged balance does not prove
70
+ * it will not commit. Treat the claim as pending and reconcile first.
71
+ *
72
+ * Because that warning has to hold for code as well as readers, an ambiguous
73
+ * failure (any 5xx, or a network error with no response at all) is thrown
74
+ * with `retryable: false`, against the SDK's usual "every 5xx is retryable"
75
+ * rule, so a caller driving retries off that flag cannot claim twice. A
76
+ * pre-admission rejection is exempt and stays retryable: a maintenance block,
77
+ * and a sequencer overload (`code: "OVERLOADED"`), both of which are refused
78
+ * before the claim is queued and so committed nothing.
79
+ */
80
+ claimBuildercodeRewards(params: ClaimBuildercodeRewardsParams): Promise<ClaimBuildercodeRewardsResponse>;
81
+ }
@@ -0,0 +1,182 @@
1
+ /**
2
+ * BuilderCodes API Implementation
3
+ *
4
+ * Provides authenticated reads of an enrolled frontend's BuilderCodes program,
5
+ * earnings, and reserved balance, plus the claim into a tradeable balance.
6
+ *
7
+ * `claimBuildercodeRewards` requires authentication: the payout bucket is
8
+ * resolved from the authenticated caller's own wallet address, so a caller can
9
+ * only ever claim their own accrued balance.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * // Claim accrued payout balance into a trading balance (authenticated)
14
+ * const result = await sdk.buildercodes.claimBuildercodeRewards({
15
+ * token: "0x0000000000000000000000000000000000000002",
16
+ * amount: "1000000",
17
+ * });
18
+ * console.log(`Payout remaining: ${result.payoutBalance}`);
19
+ * console.log(`Now tradeable: ${result.tradingBalance}`);
20
+ * ```
21
+ */
22
+ import { ClaimBuildercodeRewardsParamsSchema, ListBuildercodePayoutsParamsSchema, validate } from "@0xmonaco/types";
23
+ import { APIError } from "../../errors";
24
+ import { BaseAPI } from "../base";
25
+ /**
26
+ * REST `error` code carried by a deliberate maintenance block. The write guard
27
+ * runs as middleware BEFORE the handler, so nothing was admitted to the
28
+ * sequencer and the claim provably did not commit — that 503 stays retryable.
29
+ */
30
+ const MAINTENANCE_BLOCK_ERROR = "OPERATIONS_BLOCKED";
31
+ /**
32
+ * Stable engine `code` for a sequencer admission rejection. The engine refuses a
33
+ * full lane strictly before sequencing, so the command was never queued and left
34
+ * no durable-log or state footprint — provably nothing committed, and exactly the
35
+ * case a client SHOULD retry with backoff.
36
+ */
37
+ const OVERLOADED_ENGINE_CODE = "OVERLOADED";
38
+ /**
39
+ * Clear `retryable` on a claim failure whose outcome is UNKNOWN.
40
+ *
41
+ * A claim is not idempotent and is admitted to the sequencer before its reply
42
+ * is sent, so a 5xx or a dropped connection can arrive after the claim already
43
+ * committed. `APIError` classifies every 5xx and every network failure as
44
+ * `retryable: true`, and the documented consumer pattern retries whenever that
45
+ * flag is set — which would claim a second amount. The prose warning on the
46
+ * method is not enough on its own: the flag is the machine-readable signal, so
47
+ * it has to agree with it.
48
+ *
49
+ * Left alone deliberately: the two 503s that are provably PRE-admission and so
50
+ * committed nothing — a maintenance block (`OPERATIONS_BLOCKED`, refused in
51
+ * middleware ahead of the handler) and a sequencer admission rejection
52
+ * (`OVERLOADED`, refused before the command is queued) — plus every 4xx, which
53
+ * is a decided outcome. Marking those non-retryable would tell a client to
54
+ * reconcile a claim that never existed, and would stop it backing off and
55
+ * retrying an overload, which is the one 503 that most wants a retry.
56
+ *
57
+ * The error is mutated rather than replaced so the endpoint, status, request id
58
+ * and response body all survive for the caller's logs; `APIError`'s constructor
59
+ * recomputes `retryable` from the status, so a fresh instance could not carry
60
+ * the override anyway.
61
+ */
62
+ function markAmbiguousOutcomeNonRetryable(error) {
63
+ if (!(error instanceof APIError) || !error.retryable) {
64
+ return error;
65
+ }
66
+ // No status at all means the response was never seen — the most ambiguous
67
+ // case of the lot, since the request may well have been served.
68
+ const outcomeUnknown = error.statusCode === undefined || error.statusCode >= 500;
69
+ if (!outcomeUnknown || isPreAdmissionRejection(error)) {
70
+ return error;
71
+ }
72
+ error.retryable = false;
73
+ error.suggestion =
74
+ "The claim's outcome is unknown: it may have committed after this failure. Do not retry automatically, and do not rely on a balance read to decide — an admitted claim can still be queued, so an unchanged balance does not prove it will not commit. Treat the claim as pending and reconcile before issuing another; this endpoint has no idempotency key, so a retry can claim a second time.";
75
+ return error;
76
+ }
77
+ /**
78
+ * Whether the failure was refused before the claim could be admitted to the
79
+ * sequencer, which makes it provably non-committing and safe to retry.
80
+ *
81
+ * `error` is the gateway's own classification; `code` is the stable engine code
82
+ * the matching engine tags onto an otherwise-ambiguous `Unavailable`.
83
+ */
84
+ function isPreAdmissionRejection(error) {
85
+ const body = error.responseBody;
86
+ if (body === null || typeof body !== "object") {
87
+ return false;
88
+ }
89
+ const { error: errorCode, code: engineCode } = body;
90
+ return errorCode === MAINTENANCE_BLOCK_ERROR || engineCode === OVERLOADED_ENGINE_CODE;
91
+ }
92
+ export class BuildercodesAPIImpl extends BaseAPI {
93
+ /**
94
+ * Read this frontend's current BuilderCodes program state.
95
+ *
96
+ * The application comes from the authenticated session; callers cannot
97
+ * select another application. The authenticated wallet must match the
98
+ * application's configured payout address.
99
+ */
100
+ async getConfig() {
101
+ return this.makeAuthenticatedRequest("/api/v1/buildercodes/config", {
102
+ method: "GET",
103
+ });
104
+ }
105
+ /**
106
+ * List this frontend's per-trade BuilderCodes credits, newest first.
107
+ *
108
+ * The server scopes every query to the authenticated application; neither
109
+ * the application id nor payout wallet can be supplied by the caller.
110
+ */
111
+ async listPayouts(params) {
112
+ if (params) {
113
+ validate(ListBuildercodePayoutsParamsSchema, params);
114
+ }
115
+ const searchParams = new URLSearchParams();
116
+ if (params?.page !== undefined) {
117
+ searchParams.append("page", params.page.toString());
118
+ }
119
+ if (params?.pageSize !== undefined) {
120
+ searchParams.append("pageSize", params.pageSize.toString());
121
+ }
122
+ const query = searchParams.toString();
123
+ const path = query ? `/api/v1/buildercodes/payouts?${query}` : "/api/v1/buildercodes/payouts";
124
+ return this.makeAuthenticatedRequest(path, { method: "GET" });
125
+ }
126
+ /**
127
+ * Summarize this frontend's BuilderCodes earnings by token.
128
+ *
129
+ * Amounts are RAW atomic units and remain separated by token.
130
+ */
131
+ async getPayoutSummary() {
132
+ return this.makeAuthenticatedRequest("/api/v1/buildercodes/payouts/summary", { method: "GET" });
133
+ }
134
+ /**
135
+ * Read the authenticated wallet's available BuilderCodes reward balances.
136
+ *
137
+ * Current enrollment is not required: a former payout wallet can still see
138
+ * and claim the balance it accrued before an address rotation.
139
+ */
140
+ async getRewardsBalance() {
141
+ return this.makeAuthenticatedRequest("/api/v1/buildercodes/rewards/balance", { method: "GET" });
142
+ }
143
+ /**
144
+ * Claim accrued BuilderCodes payout balance into a trading balance.
145
+ *
146
+ * Throws 403 when the caller is refused — either BuilderCodes is not
147
+ * enabled, or the session is a delegated agent. Delegated sessions are
148
+ * refused before the feature flag is read, so a 403 there is permanent for
149
+ * that session type rather than a rollout state.
150
+ *
151
+ * Throws 409 when the payout balance is insufficient for the requested
152
+ * amount (including when the caller has never accrued a share).
153
+ *
154
+ * Throws 503 when the matching engine is unreachable, restarting, or slow to
155
+ * answer. Treat that as an UNKNOWN outcome rather than a rejection: the claim
156
+ * is admitted to the sequencer before its reply is sent, so it may still
157
+ * commit, and there is no idempotency key — a blind retry can claim twice.
158
+ * Do not retry automatically, and do not settle it with a balance read: an
159
+ * admitted claim can still be queued, so an unchanged balance does not prove
160
+ * it will not commit. Treat the claim as pending and reconcile first.
161
+ *
162
+ * Because that warning has to hold for code as well as readers, an ambiguous
163
+ * failure (any 5xx, or a network error with no response at all) is thrown
164
+ * with `retryable: false`, against the SDK's usual "every 5xx is retryable"
165
+ * rule, so a caller driving retries off that flag cannot claim twice. A
166
+ * pre-admission rejection is exempt and stays retryable: a maintenance block,
167
+ * and a sequencer overload (`code: "OVERLOADED"`), both of which are refused
168
+ * before the claim is queued and so committed nothing.
169
+ */
170
+ async claimBuildercodeRewards(params) {
171
+ const validated = validate(ClaimBuildercodeRewardsParamsSchema, params);
172
+ try {
173
+ return await this.makeAuthenticatedRequest("/api/v1/buildercodes/rewards/claim", {
174
+ method: "POST",
175
+ body: JSON.stringify({ token: validated.token, amount: validated.amount }),
176
+ });
177
+ }
178
+ catch (error) {
179
+ throw markAmbiguousOutcomeNonRetryable(error);
180
+ }
181
+ }
182
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * BuilderCodes API Module
3
+ *
4
+ * Exports the BuilderCodes payout API implementation.
5
+ */
6
+ export { BuildercodesAPIImpl } from "./api";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * BuilderCodes API Module
3
+ *
4
+ * Exports the BuilderCodes payout API implementation.
5
+ */
6
+ export { BuildercodesAPIImpl } from "./api";
@@ -5,6 +5,7 @@
5
5
  */
6
6
  export * from "./applications/index";
7
7
  export * from "./base";
8
+ export * from "./buildercodes";
8
9
  export * from "./delegated-agents";
9
10
  export * from "./faucet";
10
11
  export * from "./fees";
package/dist/api/index.js CHANGED
@@ -5,6 +5,7 @@
5
5
  */
6
6
  export * from "./applications/index";
7
7
  export * from "./base";
8
+ export * from "./buildercodes";
8
9
  export * from "./delegated-agents";
9
10
  export * from "./faucet";
10
11
  export * from "./fees";
@@ -204,10 +204,29 @@ function parsePositionEventData(raw) {
204
204
  liquidationPrice: readOptionalString(data, "liquidationPrice"),
205
205
  isolatedMargin: readString(data, "isolatedMargin"),
206
206
  leverage: readString(data, "leverage"),
207
+ // REST parity fields (0XM-2668). All four are optional here even though
208
+ // the server populates the margin requirements on every frame it builds
209
+ // today: this parser also runs against frames produced by an older
210
+ // deployment during a rolling release, and a `readString` on a key that
211
+ // deployment does not send would throw inside the message handler and drop
212
+ // a risk-critical update. `riskBucketId` and `marginMode` are genuinely
213
+ // optional besides — a legacy unbucketed position has neither.
214
+ riskBucketId: readOptionalString(data, "riskBucketId"),
215
+ marginMode: readOptionalString(data, "marginMode"),
216
+ maintenanceMarginRequired: readOptionalString(data, "maintenanceMarginRequired"),
217
+ initialMarginRequired: readOptionalString(data, "initialMarginRequired"),
207
218
  tradeId: readOptionalString(data, "tradeId"),
208
219
  orderId: readOptionalString(data, "orderId"),
209
220
  reason: readString(data, "reason"),
210
221
  updatedAt: readString(data, "updatedAt"),
222
+ // Opaque durable row version (0XM-2673). `readOptionalSequence`, not
223
+ // `readOptionalNumber`: this is an ordering counter, so a fractional,
224
+ // negative, or unsafe-integer value would silently corrupt every
225
+ // comparison against it. Same helper the balance version uses. Absent
226
+ // stays absent — a definite 0 would be read as a real revision and lose
227
+ // every `>=` comparison, so the server omits the key rather than sending
228
+ // zero.
229
+ version: readOptionalSequence(data, "version"),
211
230
  };
212
231
  }
213
232
  function parsePositionEvent(rawData) {
@@ -24,6 +24,9 @@ export declare const COVERED: {
24
24
  get_application_config: string;
25
25
  get_application_stats: string;
26
26
  get_available_collateral: string;
27
+ get_buildercode_payout_summary: string;
28
+ get_buildercode_rewards_balance: string;
29
+ get_buildercodes_config: string;
27
30
  get_candles: string;
28
31
  get_faucet_info: string;
29
32
  get_funding_state: string;
@@ -80,6 +83,7 @@ export declare const COVERED: {
80
83
  list_application_movements: string;
81
84
  list_application_orders: string;
82
85
  list_application_users: string;
86
+ list_buildercode_payouts: string;
83
87
  list_conditional_orders: string;
84
88
  list_delegated_agent_owners: string;
85
89
  list_delegated_agents: string;
@@ -106,6 +110,7 @@ export declare const COVERED: {
106
110
  transfer_collateral_to_margin_account: string;
107
111
  transfer_collateral_to_parent_margin_account: string;
108
112
  transfer_collateral_to_risk_bucket: string;
113
+ claim_buildercode_rewards: string;
109
114
  transfer_rewards: string;
110
115
  update_sub_account_limit: string;
111
116
  upsert_delegated_agent: string;
package/dist/coverage.js CHANGED
@@ -24,6 +24,9 @@ export const COVERED = {
24
24
  get_application_config: "getApplicationConfig",
25
25
  get_application_stats: "getApplicationStats",
26
26
  get_available_collateral: "getAvailableCollateral",
27
+ get_buildercode_payout_summary: "buildercodes.getPayoutSummary",
28
+ get_buildercode_rewards_balance: "buildercodes.getRewardsBalance",
29
+ get_buildercodes_config: "buildercodes.getConfig",
27
30
  get_candles: "getCandlesticks",
28
31
  get_faucet_info: "faucet.getInfo",
29
32
  get_funding_state: "getFundingState",
@@ -80,6 +83,7 @@ export const COVERED = {
80
83
  list_application_movements: "listApplicationMovements",
81
84
  list_application_orders: "listApplicationOrders",
82
85
  list_application_users: "listApplicationUsers",
86
+ list_buildercode_payouts: "buildercodes.listPayouts",
83
87
  list_conditional_orders: "listConditionalOrders",
84
88
  list_delegated_agent_owners: "listDelegatedOwners",
85
89
  list_delegated_agents: "listDelegatedAgents",
@@ -106,6 +110,7 @@ export const COVERED = {
106
110
  transfer_collateral_to_margin_account: "transferCollateralToMarginAccount",
107
111
  transfer_collateral_to_parent_margin_account: "transferCollateralToParentMarginAccount",
108
112
  transfer_collateral_to_risk_bucket: "transferCollateralToRiskBucket",
113
+ claim_buildercode_rewards: "buildercodes.claimBuildercodeRewards",
109
114
  transfer_rewards: "pitpass.transferRewards",
110
115
  update_sub_account_limit: "subAccounts.updateLimit",
111
116
  upsert_delegated_agent: "upsertDelegatedAgent",
package/dist/sdk.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ApplicationsAPI, AuthAPI, AuthState, 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, 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 {
@@ -6,6 +6,7 @@ export declare class MonacoSDKImpl implements MonacoSDK {
6
6
  delegatedAgents: DelegatedAgentsAPI;
7
7
  applications: ApplicationsAPI;
8
8
  fees: FeesAPI;
9
+ buildercodes: BuildercodesAPI;
9
10
  pitpass: PitpassAPI;
10
11
  vault: VaultAPI;
11
12
  withdrawals: WithdrawalsAPI;
package/dist/sdk.js CHANGED
@@ -3,6 +3,7 @@ import { createPublicClient, http } from "viem";
3
3
  import { sei, seiTestnet } from "viem/chains";
4
4
  import { ApplicationsAPIImpl, createMonacoWebSocket, OrderbookAPIImpl, TradesAPIImpl } from "./api";
5
5
  import { AuthAPIImpl } from "./api/auth";
6
+ import { BuildercodesAPIImpl } from "./api/buildercodes";
6
7
  import { DelegatedAgentsAPIImpl } from "./api/delegated-agents";
7
8
  import { FaucetAPIImpl } from "./api/faucet";
8
9
  import { FeesAPIImpl } from "./api/fees";
@@ -44,6 +45,7 @@ export class MonacoSDKImpl {
44
45
  delegatedAgents;
45
46
  applications;
46
47
  fees;
48
+ buildercodes;
47
49
  pitpass;
48
50
  vault;
49
51
  withdrawals;
@@ -75,6 +77,7 @@ export class MonacoSDKImpl {
75
77
  this.delegatedAgents.setSessionKeypair(credentials);
76
78
  this.applications.setSessionKeypair(credentials);
77
79
  this.fees.setSessionKeypair(credentials);
80
+ this.buildercodes.setSessionKeypair(credentials);
78
81
  this.pitpass.setSessionKeypair(credentials);
79
82
  this.vault.setSessionKeypair(credentials);
80
83
  this.withdrawals.setSessionKeypair(credentials);
@@ -115,6 +118,7 @@ export class MonacoSDKImpl {
115
118
  this.delegatedAgents.setServerKey(serverKey);
116
119
  this.applications.setServerKey(serverKey);
117
120
  this.fees.setServerKey(serverKey);
121
+ this.buildercodes.setServerKey(serverKey);
118
122
  this.pitpass.setServerKey(serverKey);
119
123
  this.vault.setServerKey(serverKey);
120
124
  this.withdrawals.setServerKey(serverKey);
@@ -198,6 +202,7 @@ export class MonacoSDKImpl {
198
202
  this.auth = configureSigning(new AuthAPIImpl(this.walletClient, this.chain, apiUrl));
199
203
  this.delegatedAgents = configureSigning(new DelegatedAgentsAPIImpl(apiUrl));
200
204
  this.fees = configureSigning(new FeesAPIImpl(apiUrl));
205
+ this.buildercodes = configureSigning(new BuildercodesAPIImpl(apiUrl));
201
206
  this.pitpass = configureSigning(new PitpassAPIImpl(apiUrl));
202
207
  this.profile = configureSigning(new ProfileAPIImpl(apiUrl));
203
208
  this.vault = configureSigning(new VaultAPIImpl(this.publicClient, this.walletClient, this.chain, this.applications, this.profile, apiUrl));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/core",
3
- "version": "1.0.58",
3
+ "version": "1.0.59",
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.58",
23
- "@0xmonaco/types": "1.0.58",
22
+ "@0xmonaco/contracts": "1.0.59",
23
+ "@0xmonaco/types": "1.0.59",
24
24
  "@noble/curves": "^1.9.1",
25
25
  "@noble/hashes": "^2.4.0",
26
26
  "http-status-codes": "^2.3.0"