@0xmonaco/core 1.0.21 → 1.0.25

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.
@@ -8,7 +8,8 @@
8
8
  *
9
9
  * @example
10
10
  * ```typescript
11
- * const { minted, failed, remainingRequests24h } = await sdk.faucet.mint();
11
+ * // A valid Cloudflare Turnstile token is required on every mint.
12
+ * const { minted, failed, remainingRequests24h } = await sdk.faucet.mint({ turnstileToken });
12
13
  * ```
13
14
  */
14
15
  import type { FaucetAPI, MintTokensParams, MintTokensResponse } from "@0xmonaco/types";
@@ -18,14 +19,15 @@ export declare class FaucetAPIImpl extends BaseAPI implements FaucetAPI {
18
19
  * Mints the full set of testnet tokens to the authenticated user.
19
20
  *
20
21
  * Synchronous: resolves only when every faucet transaction confirmed
21
- * on-chain (HTTP 200). Rejects with 429 when the daily quota is exhausted,
22
- * 502 when transactions failed or were only partially confirmed (the error
23
- * details carry the minted/failed breakdown; delivered legs still consume
24
- * the quota), and 503 when the faucet is unavailable (safe to retry).
22
+ * on-chain (HTTP 200). Rejects with 400 when the Turnstile token is missing
23
+ * or invalid, 429 when the daily quota is exhausted, 502 when transactions
24
+ * failed or were only partially confirmed (the error details carry the
25
+ * minted/failed breakdown; delivered legs still consume the quota), and 503
26
+ * when the faucet is unavailable (safe to retry).
25
27
  *
26
- * @param params - Optional parameters (Turnstile captcha token when the
27
- * gateway requires one)
28
+ * @param params - Mint parameters, including the required Turnstile captcha
29
+ * token
28
30
  * @returns Promise resolving to the minted tokens and remaining quota
29
31
  */
30
- mint(params?: MintTokensParams): Promise<MintTokensResponse>;
32
+ mint(params: MintTokensParams): Promise<MintTokensResponse>;
31
33
  }
@@ -8,7 +8,8 @@
8
8
  *
9
9
  * @example
10
10
  * ```typescript
11
- * const { minted, failed, remainingRequests24h } = await sdk.faucet.mint();
11
+ * // A valid Cloudflare Turnstile token is required on every mint.
12
+ * const { minted, failed, remainingRequests24h } = await sdk.faucet.mint({ turnstileToken });
12
13
  * ```
13
14
  */
14
15
  import { BaseAPI } from "../base";
@@ -18,21 +19,20 @@ export class FaucetAPIImpl extends BaseAPI {
18
19
  * Mints the full set of testnet tokens to the authenticated user.
19
20
  *
20
21
  * Synchronous: resolves only when every faucet transaction confirmed
21
- * on-chain (HTTP 200). Rejects with 429 when the daily quota is exhausted,
22
- * 502 when transactions failed or were only partially confirmed (the error
23
- * details carry the minted/failed breakdown; delivered legs still consume
24
- * the quota), and 503 when the faucet is unavailable (safe to retry).
22
+ * on-chain (HTTP 200). Rejects with 400 when the Turnstile token is missing
23
+ * or invalid, 429 when the daily quota is exhausted, 502 when transactions
24
+ * failed or were only partially confirmed (the error details carry the
25
+ * minted/failed breakdown; delivered legs still consume the quota), and 503
26
+ * when the faucet is unavailable (safe to retry).
25
27
  *
26
- * @param params - Optional parameters (Turnstile captcha token when the
27
- * gateway requires one)
28
+ * @param params - Mint parameters, including the required Turnstile captcha
29
+ * token
28
30
  * @returns Promise resolving to the minted tokens and remaining quota
29
31
  */
30
32
  async mint(params) {
31
33
  return await this.makeAuthenticatedRequest(perpRoutes.faucet.mint(), {
32
34
  method: "POST",
33
- ...(params?.turnstileToken !== undefined && {
34
- body: JSON.stringify({ turnstileToken: params.turnstileToken }),
35
- }),
35
+ body: JSON.stringify({ turnstileToken: params.turnstileToken }),
36
36
  });
37
37
  }
38
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/core",
3
- "version": "1.0.21",
3
+ "version": "1.0.25",
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": "1.0.21",
27
- "@0xmonaco/types": "1.0.21",
26
+ "@0xmonaco/contracts": "1.0.25",
27
+ "@0xmonaco/types": "1.0.25",
28
28
  "@noble/curves": "^1.9.1",
29
29
  "@noble/hashes": "^1.8.0",
30
30
  "http-status-codes": "^2.3.0"