@0xmonaco/core 1.0.57 → 1.0.58-develop.f12e78b
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/auth/api.d.ts +18 -4
- package/dist/api/auth/api.js +17 -3
- package/dist/api/buildercodes/api.d.ts +81 -0
- package/dist/api/buildercodes/api.js +182 -0
- package/dist/api/buildercodes/index.d.ts +6 -0
- package/dist/api/buildercodes/index.js +6 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/profile/api.d.ts +39 -1
- package/dist/api/profile/api.js +47 -1
- package/dist/api/trading/api.d.ts +4 -1
- package/dist/api/trading/api.js +7 -0
- package/dist/api/websocket/websocket.js +12 -0
- package/dist/coverage.d.ts +7 -0
- package/dist/coverage.js +7 -0
- package/dist/sdk.d.ts +2 -1
- package/dist/sdk.js +5 -0
- package/package.json +3 -3
package/dist/api/auth/api.d.ts
CHANGED
|
@@ -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
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
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
|
package/dist/api/auth/api.js
CHANGED
|
@@ -102,10 +102,24 @@ export class AuthAPIImpl extends BaseAPI {
|
|
|
102
102
|
/**
|
|
103
103
|
* Signs a challenge message using the wallet client.
|
|
104
104
|
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
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
|
-
*
|
|
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
|
+
}
|
package/dist/api/index.d.ts
CHANGED
package/dist/api/index.js
CHANGED
|
@@ -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, ListFundingPaymentsParams, ListFundingPaymentsResponse, 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, SelfTradePreventionDefault, SelfTradePreventionMode, UserProfile } from "@0xmonaco/types";
|
|
21
21
|
import { BaseAPI } from "../base";
|
|
22
22
|
export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
|
|
23
23
|
/**
|
|
@@ -245,4 +245,42 @@ export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
|
|
|
245
245
|
* ```
|
|
246
246
|
*/
|
|
247
247
|
listFundingPayments(params?: ListFundingPaymentsParams): Promise<ListFundingPaymentsResponse>;
|
|
248
|
+
/**
|
|
249
|
+
* Get the wallet's self-trade-prevention default.
|
|
250
|
+
*
|
|
251
|
+
* Fetches the setting from the /api/v1/accounts/self-trade-prevention endpoint.
|
|
252
|
+
* Requires a valid access token to be set. The default is wallet-scoped: it
|
|
253
|
+
* covers every application and account sharing the wallet address, and a
|
|
254
|
+
* per-order mode always overrides it.
|
|
255
|
+
*
|
|
256
|
+
* @returns Promise resolving to the effective mode plus whether it was explicitly set
|
|
257
|
+
* @throws {APIError} When the request fails or user is not authenticated
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* ```typescript
|
|
261
|
+
* const stp = await profileAPI.getSelfTradePreventionDefault();
|
|
262
|
+
* console.log(`Mode: ${stp.mode} (explicitly set: ${stp.isCustom})`);
|
|
263
|
+
* ```
|
|
264
|
+
*/
|
|
265
|
+
getSelfTradePreventionDefault(): Promise<SelfTradePreventionDefault>;
|
|
266
|
+
/**
|
|
267
|
+
* Set the wallet's self-trade-prevention default.
|
|
268
|
+
*
|
|
269
|
+
* Sends a PUT to the /api/v1/accounts/self-trade-prevention endpoint. The
|
|
270
|
+
* write is sequenced through the matching engine; on success the wallet
|
|
271
|
+
* family's next order already resolves the new mode. Delegated-agent
|
|
272
|
+
* sessions cannot change it (403).
|
|
273
|
+
*
|
|
274
|
+
* @param mode - One of "CANCEL_MAKER", "CANCEL_TAKER", "CANCEL_BOTH", "SKIP"
|
|
275
|
+
* @returns Promise resolving to the setting now in force
|
|
276
|
+
* @throws ValidationError If mode is not a known token; this occurs before any network request.
|
|
277
|
+
* @throws {APIError} When the request fails or user is not authenticated
|
|
278
|
+
*
|
|
279
|
+
* @example
|
|
280
|
+
* ```typescript
|
|
281
|
+
* const stp = await profileAPI.setSelfTradePreventionDefault("SKIP");
|
|
282
|
+
* console.log(`Mode is now ${stp.mode}`);
|
|
283
|
+
* ```
|
|
284
|
+
*/
|
|
285
|
+
setSelfTradePreventionDefault(mode: SelfTradePreventionMode): Promise<SelfTradePreventionDefault>;
|
|
248
286
|
}
|
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, ListFundingPaymentsSchema, validate } from "@0xmonaco/types";
|
|
20
|
+
import { GetUserMovementsSchema, GetUserTradesSchema, ListFundingPaymentsSchema, SetSelfTradePreventionDefaultSchema, validate } from "@0xmonaco/types";
|
|
21
21
|
import { APIError } from "../../errors";
|
|
22
22
|
import { BaseAPI } from "../base";
|
|
23
23
|
export class ProfileAPIImpl extends BaseAPI {
|
|
@@ -360,4 +360,50 @@ export class ProfileAPIImpl extends BaseAPI {
|
|
|
360
360
|
const url = queryString ? `/api/v1/accounts/funding-payments?${queryString}` : "/api/v1/accounts/funding-payments";
|
|
361
361
|
return await this.makeAuthenticatedRequest(url);
|
|
362
362
|
}
|
|
363
|
+
/**
|
|
364
|
+
* Get the wallet's self-trade-prevention default.
|
|
365
|
+
*
|
|
366
|
+
* Fetches the setting from the /api/v1/accounts/self-trade-prevention endpoint.
|
|
367
|
+
* Requires a valid access token to be set. The default is wallet-scoped: it
|
|
368
|
+
* covers every application and account sharing the wallet address, and a
|
|
369
|
+
* per-order mode always overrides it.
|
|
370
|
+
*
|
|
371
|
+
* @returns Promise resolving to the effective mode plus whether it was explicitly set
|
|
372
|
+
* @throws {APIError} When the request fails or user is not authenticated
|
|
373
|
+
*
|
|
374
|
+
* @example
|
|
375
|
+
* ```typescript
|
|
376
|
+
* const stp = await profileAPI.getSelfTradePreventionDefault();
|
|
377
|
+
* console.log(`Mode: ${stp.mode} (explicitly set: ${stp.isCustom})`);
|
|
378
|
+
* ```
|
|
379
|
+
*/
|
|
380
|
+
async getSelfTradePreventionDefault() {
|
|
381
|
+
return await this.makeAuthenticatedRequest("/api/v1/accounts/self-trade-prevention");
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Set the wallet's self-trade-prevention default.
|
|
385
|
+
*
|
|
386
|
+
* Sends a PUT to the /api/v1/accounts/self-trade-prevention endpoint. The
|
|
387
|
+
* write is sequenced through the matching engine; on success the wallet
|
|
388
|
+
* family's next order already resolves the new mode. Delegated-agent
|
|
389
|
+
* sessions cannot change it (403).
|
|
390
|
+
*
|
|
391
|
+
* @param mode - One of "CANCEL_MAKER", "CANCEL_TAKER", "CANCEL_BOTH", "SKIP"
|
|
392
|
+
* @returns Promise resolving to the setting now in force
|
|
393
|
+
* @throws ValidationError If mode is not a known token; this occurs before any network request.
|
|
394
|
+
* @throws {APIError} When the request fails or user is not authenticated
|
|
395
|
+
*
|
|
396
|
+
* @example
|
|
397
|
+
* ```typescript
|
|
398
|
+
* const stp = await profileAPI.setSelfTradePreventionDefault("SKIP");
|
|
399
|
+
* console.log(`Mode is now ${stp.mode}`);
|
|
400
|
+
* ```
|
|
401
|
+
*/
|
|
402
|
+
async setSelfTradePreventionDefault(mode) {
|
|
403
|
+
const validated = validate(SetSelfTradePreventionDefaultSchema, { mode });
|
|
404
|
+
return await this.makeAuthenticatedRequest("/api/v1/accounts/self-trade-prevention", {
|
|
405
|
+
method: "PUT",
|
|
406
|
+
body: JSON.stringify(validated),
|
|
407
|
+
});
|
|
408
|
+
}
|
|
363
409
|
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* );
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
|
-
import type { BatchCancelOrdersResponse, BatchCreateOrderParams, BatchCreateOrdersResponse, BatchReplaceOrderParams, BatchReplaceOrdersResponse, CancelConditionalOrderResponse, CancelOrderResponse, CancelTwapOrderResponse, ConditionalOrder, CreateOrderResponse, CreateTwapOrderOptions, CreateTwapOrderResponse, GetOrderResponse, GetPaginatedOrdersParams, GetPaginatedOrdersResponse, GetTwapOrderTcaResponse, ListConditionalOrdersParams, ListConditionalOrdersResponse, ListTwapOrdersParams, ListTwapOrdersResponse, MarginMode, OrderSide, ParentTpSlLegParams, PositionSide, ReplaceOrderResponse, TimeInForce, TradingAPI, TradingMode, TwapOrder } from "@0xmonaco/types";
|
|
24
|
+
import type { BatchCancelOrdersResponse, BatchCreateOrderParams, BatchCreateOrdersResponse, BatchReplaceOrderParams, BatchReplaceOrdersResponse, CancelConditionalOrderResponse, CancelOrderResponse, CancelTwapOrderResponse, ConditionalOrder, CreateOrderResponse, CreateTwapOrderOptions, CreateTwapOrderResponse, GetOrderResponse, GetPaginatedOrdersParams, GetPaginatedOrdersResponse, GetTwapOrderTcaResponse, ListConditionalOrdersParams, ListConditionalOrdersResponse, ListTwapOrdersParams, ListTwapOrdersResponse, MarginMode, OrderSide, ParentTpSlLegParams, PositionSide, ReplaceOrderResponse, SelfTradePreventionMode, TimeInForce, TradingAPI, TradingMode, TwapOrder } from "@0xmonaco/types";
|
|
25
25
|
import { BaseAPI } from "../base";
|
|
26
26
|
export declare class TradingAPIImpl extends BaseAPI implements TradingAPI {
|
|
27
27
|
/**
|
|
@@ -88,6 +88,7 @@ export declare class TradingAPIImpl extends BaseAPI implements TradingAPI {
|
|
|
88
88
|
leverage?: string;
|
|
89
89
|
reduceOnly?: boolean;
|
|
90
90
|
postOnly?: boolean;
|
|
91
|
+
selfTradePreventionMode?: SelfTradePreventionMode;
|
|
91
92
|
clientOrderId?: string;
|
|
92
93
|
/** Generated once per call when omitted. Supply the same key to retry a logical order within 24 hours. */
|
|
93
94
|
idempotencyKey?: string;
|
|
@@ -148,6 +149,7 @@ export declare class TradingAPIImpl extends BaseAPI implements TradingAPI {
|
|
|
148
149
|
positionSide?: PositionSide;
|
|
149
150
|
leverage?: string;
|
|
150
151
|
reduceOnly?: boolean;
|
|
152
|
+
selfTradePreventionMode?: SelfTradePreventionMode;
|
|
151
153
|
takeProfit?: ParentTpSlLegParams;
|
|
152
154
|
stopLoss?: ParentTpSlLegParams;
|
|
153
155
|
clientOrderId?: string;
|
|
@@ -218,6 +220,7 @@ export declare class TradingAPIImpl extends BaseAPI implements TradingAPI {
|
|
|
218
220
|
quantity?: string;
|
|
219
221
|
useMasterBalance?: boolean;
|
|
220
222
|
postOnly?: boolean;
|
|
223
|
+
selfTradePreventionMode?: SelfTradePreventionMode;
|
|
221
224
|
clientOrderId?: string;
|
|
222
225
|
}): Promise<ReplaceOrderResponse>;
|
|
223
226
|
/**
|
package/dist/api/trading/api.js
CHANGED
|
@@ -120,6 +120,7 @@ export class TradingAPIImpl extends BaseAPI {
|
|
|
120
120
|
leverage: options?.leverage,
|
|
121
121
|
reduceOnly: options?.reduceOnly,
|
|
122
122
|
postOnly: options?.postOnly,
|
|
123
|
+
selfTradePreventionMode: options?.selfTradePreventionMode,
|
|
123
124
|
clientOrderId: options?.clientOrderId,
|
|
124
125
|
idempotencyKey: options?.idempotencyKey === undefined ? crypto.randomUUID() : options.idempotencyKey,
|
|
125
126
|
takeProfit: parentTpSlLegToRequest(options?.takeProfit),
|
|
@@ -197,6 +198,7 @@ export class TradingAPIImpl extends BaseAPI {
|
|
|
197
198
|
positionSide: options?.positionSide,
|
|
198
199
|
leverage: options?.leverage,
|
|
199
200
|
reduceOnly: options?.reduceOnly,
|
|
201
|
+
selfTradePreventionMode: options?.selfTradePreventionMode,
|
|
200
202
|
takeProfit: parentTpSlLegToRequest(options?.takeProfit),
|
|
201
203
|
stopLoss: parentTpSlLegToRequest(options?.stopLoss),
|
|
202
204
|
clientOrderId: options?.clientOrderId,
|
|
@@ -327,6 +329,9 @@ export class TradingAPIImpl extends BaseAPI {
|
|
|
327
329
|
if (newOrder.postOnly !== undefined) {
|
|
328
330
|
requestBody.postOnly = newOrder.postOnly;
|
|
329
331
|
}
|
|
332
|
+
if (newOrder.selfTradePreventionMode !== undefined) {
|
|
333
|
+
requestBody.selfTradePreventionMode = newOrder.selfTradePreventionMode;
|
|
334
|
+
}
|
|
330
335
|
if (newOrder.clientOrderId !== undefined) {
|
|
331
336
|
requestBody.clientOrderId = newOrder.clientOrderId;
|
|
332
337
|
}
|
|
@@ -388,6 +393,7 @@ export class TradingAPIImpl extends BaseAPI {
|
|
|
388
393
|
leverage: order.leverage,
|
|
389
394
|
reduceOnly: order.reduceOnly,
|
|
390
395
|
postOnly: order.postOnly,
|
|
396
|
+
selfTradePreventionMode: order.selfTradePreventionMode,
|
|
391
397
|
clientOrderId: order.clientOrderId,
|
|
392
398
|
idempotencyKey: order.idempotencyKey === undefined ? crypto.randomUUID() : order.idempotencyKey,
|
|
393
399
|
})),
|
|
@@ -442,6 +448,7 @@ export class TradingAPIImpl extends BaseAPI {
|
|
|
442
448
|
quantity: order.quantity,
|
|
443
449
|
useMasterBalance: order.useMasterBalance,
|
|
444
450
|
postOnly: order.postOnly,
|
|
451
|
+
selfTradePreventionMode: order.selfTradePreventionMode,
|
|
445
452
|
clientOrderId: order.clientOrderId,
|
|
446
453
|
})),
|
|
447
454
|
};
|
|
@@ -208,6 +208,14 @@ function parsePositionEventData(raw) {
|
|
|
208
208
|
orderId: readOptionalString(data, "orderId"),
|
|
209
209
|
reason: readString(data, "reason"),
|
|
210
210
|
updatedAt: readString(data, "updatedAt"),
|
|
211
|
+
// Opaque durable row version (0XM-2673). `readOptionalSequence`, not
|
|
212
|
+
// `readOptionalNumber`: this is an ordering counter, so a fractional,
|
|
213
|
+
// negative, or unsafe-integer value would silently corrupt every
|
|
214
|
+
// comparison against it. Same helper the balance version uses. Absent
|
|
215
|
+
// stays absent — a definite 0 would be read as a real revision and lose
|
|
216
|
+
// every `>=` comparison, so the server omits the key rather than sending
|
|
217
|
+
// zero.
|
|
218
|
+
version: readOptionalSequence(data, "version"),
|
|
211
219
|
};
|
|
212
220
|
}
|
|
213
221
|
function parsePositionEvent(rawData) {
|
|
@@ -543,6 +551,7 @@ function parseOrderSnapshotItem(raw) {
|
|
|
543
551
|
// conditionally so an absent one stays absent rather than becoming
|
|
544
552
|
// `clientOrderId: undefined`, which a structural comparison would see.
|
|
545
553
|
const clientOrderId = readOptionalString(item, "clientOrderId");
|
|
554
|
+
const selfTradePreventionMode = readOptionalString(item, "selfTradePreventionMode");
|
|
546
555
|
const version = readOptionalNumber(item, "version");
|
|
547
556
|
return {
|
|
548
557
|
orderId: readString(item, "orderId"),
|
|
@@ -574,6 +583,9 @@ function parseOrderSnapshotItem(raw) {
|
|
|
574
583
|
leverage: readNullableString(item, "leverage"),
|
|
575
584
|
reduceOnly: readBoolean(item, "reduceOnly"),
|
|
576
585
|
...(clientOrderId === undefined ? {} : { clientOrderId }),
|
|
586
|
+
// Spread in conditionally like `clientOrderId`: absent means the order
|
|
587
|
+
// requested no override, and must stay absent (0XM-2733).
|
|
588
|
+
...(selfTradePreventionMode === undefined ? {} : { selfTradePreventionMode }),
|
|
577
589
|
// Spread in conditionally for the same reason as `clientOrderId`: the
|
|
578
590
|
// server omits the key when unknown, and absent must stay absent rather
|
|
579
591
|
// than becoming `version: undefined` — a resync compares this value, and
|
package/dist/coverage.d.ts
CHANGED
|
@@ -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;
|
|
@@ -38,7 +41,9 @@ export declare const COVERED: {
|
|
|
38
41
|
get_sweeper_chains: string;
|
|
39
42
|
get_my_trader_code: string;
|
|
40
43
|
get_rewards_balance: string;
|
|
44
|
+
get_self_trade_prevention_default: string;
|
|
41
45
|
get_trader_code_info: string;
|
|
46
|
+
set_self_trade_prevention_default: string;
|
|
42
47
|
set_trader_code: string;
|
|
43
48
|
clear_trader_code: string;
|
|
44
49
|
check_trader_code_availability: string;
|
|
@@ -78,6 +83,7 @@ export declare const COVERED: {
|
|
|
78
83
|
list_application_movements: string;
|
|
79
84
|
list_application_orders: string;
|
|
80
85
|
list_application_users: string;
|
|
86
|
+
list_buildercode_payouts: string;
|
|
81
87
|
list_conditional_orders: string;
|
|
82
88
|
list_delegated_agent_owners: string;
|
|
83
89
|
list_delegated_agents: string;
|
|
@@ -104,6 +110,7 @@ export declare const COVERED: {
|
|
|
104
110
|
transfer_collateral_to_margin_account: string;
|
|
105
111
|
transfer_collateral_to_parent_margin_account: string;
|
|
106
112
|
transfer_collateral_to_risk_bucket: string;
|
|
113
|
+
claim_buildercode_rewards: string;
|
|
107
114
|
transfer_rewards: string;
|
|
108
115
|
update_sub_account_limit: string;
|
|
109
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",
|
|
@@ -38,7 +41,9 @@ export const COVERED = {
|
|
|
38
41
|
get_sweeper_chains: "sweeper.getChains",
|
|
39
42
|
get_my_trader_code: "pitpass.getMyTraderCode",
|
|
40
43
|
get_rewards_balance: "pitpass.getRewardsBalance",
|
|
44
|
+
get_self_trade_prevention_default: "profile.getSelfTradePreventionDefault",
|
|
41
45
|
get_trader_code_info: "pitpass.getTraderCodeInfo",
|
|
46
|
+
set_self_trade_prevention_default: "profile.setSelfTradePreventionDefault",
|
|
42
47
|
set_trader_code: "pitpass.setTraderCode",
|
|
43
48
|
clear_trader_code: "pitpass.clearTraderCode",
|
|
44
49
|
check_trader_code_availability: "pitpass.checkTraderCodeAvailability",
|
|
@@ -78,6 +83,7 @@ export const COVERED = {
|
|
|
78
83
|
list_application_movements: "listApplicationMovements",
|
|
79
84
|
list_application_orders: "listApplicationOrders",
|
|
80
85
|
list_application_users: "listApplicationUsers",
|
|
86
|
+
list_buildercode_payouts: "buildercodes.listPayouts",
|
|
81
87
|
list_conditional_orders: "listConditionalOrders",
|
|
82
88
|
list_delegated_agent_owners: "listDelegatedOwners",
|
|
83
89
|
list_delegated_agents: "listDelegatedAgents",
|
|
@@ -104,6 +110,7 @@ export const COVERED = {
|
|
|
104
110
|
transfer_collateral_to_margin_account: "transferCollateralToMarginAccount",
|
|
105
111
|
transfer_collateral_to_parent_margin_account: "transferCollateralToParentMarginAccount",
|
|
106
112
|
transfer_collateral_to_risk_bucket: "transferCollateralToRiskBucket",
|
|
113
|
+
claim_buildercode_rewards: "buildercodes.claimBuildercodeRewards",
|
|
107
114
|
transfer_rewards: "pitpass.transferRewards",
|
|
108
115
|
update_sub_account_limit: "subAccounts.updateLimit",
|
|
109
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.
|
|
3
|
+
"version": "1.0.58-develop.f12e78b",
|
|
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.58-develop.f12e78b",
|
|
23
|
+
"@0xmonaco/types": "1.0.58-develop.f12e78b",
|
|
24
24
|
"@noble/curves": "^1.9.1",
|
|
25
25
|
"@noble/hashes": "^2.4.0",
|
|
26
26
|
"http-status-codes": "^2.3.0"
|