@0xmonaco/core 1.0.7 → 1.0.15

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.
@@ -11,7 +11,7 @@
11
11
  * const { minted, failed, remainingRequests24h } = await sdk.faucet.mint();
12
12
  * ```
13
13
  */
14
- import type { FaucetAPI, MintTokensResponse } from "@0xmonaco/types";
14
+ import type { FaucetAPI, MintTokensParams, MintTokensResponse } from "@0xmonaco/types";
15
15
  import { BaseAPI } from "../base";
16
16
  export declare class FaucetAPIImpl extends BaseAPI implements FaucetAPI {
17
17
  /**
@@ -23,7 +23,9 @@ export declare class FaucetAPIImpl extends BaseAPI implements FaucetAPI {
23
23
  * details carry the minted/failed breakdown; delivered legs still consume
24
24
  * the quota), and 503 when the faucet is unavailable (safe to retry).
25
25
  *
26
+ * @param params - Optional parameters (Turnstile captcha token when the
27
+ * gateway requires one)
26
28
  * @returns Promise resolving to the minted tokens and remaining quota
27
29
  */
28
- mint(): Promise<MintTokensResponse>;
30
+ mint(params?: MintTokensParams): Promise<MintTokensResponse>;
29
31
  }
@@ -23,11 +23,16 @@ export class FaucetAPIImpl extends BaseAPI {
23
23
  * details carry the minted/failed breakdown; delivered legs still consume
24
24
  * the quota), and 503 when the faucet is unavailable (safe to retry).
25
25
  *
26
+ * @param params - Optional parameters (Turnstile captcha token when the
27
+ * gateway requires one)
26
28
  * @returns Promise resolving to the minted tokens and remaining quota
27
29
  */
28
- async mint() {
30
+ async mint(params) {
29
31
  return await this.makeAuthenticatedRequest(perpRoutes.faucet.mint(), {
30
32
  method: "POST",
33
+ ...(params?.turnstileToken !== undefined && {
34
+ body: JSON.stringify({ turnstileToken: params.turnstileToken }),
35
+ }),
31
36
  });
32
37
  }
33
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/core",
3
- "version": "1.0.7",
3
+ "version": "1.0.15",
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.7",
27
- "@0xmonaco/types": "1.0.7",
26
+ "@0xmonaco/contracts": "1.0.15",
27
+ "@0xmonaco/types": "1.0.15",
28
28
  "@noble/curves": "^1.9.1",
29
29
  "@noble/hashes": "^1.8.0",
30
30
  "http-status-codes": "^2.3.0"