@wzrd_sol/goat-plugin 0.1.0
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/index.d.mts +101 -0
- package/dist/index.d.ts +101 -0
- package/dist/index.js +698 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +655 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +51 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import * as _goat_sdk_core from '@goat-sdk/core';
|
|
2
|
+
import { PluginBase, Chain } from '@goat-sdk/core';
|
|
3
|
+
import { SolanaWalletClient } from '@goat-sdk/wallet-solana';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WzrdApiClient — shared API client used by all WZRD GOAT tools.
|
|
8
|
+
*
|
|
9
|
+
* Handles:
|
|
10
|
+
* - Ed25519 challenge/verify authentication with the WZRD API
|
|
11
|
+
* - Token caching with expiry-aware refresh
|
|
12
|
+
* - Base URL resolution (env var or constructor param)
|
|
13
|
+
*
|
|
14
|
+
* The GOAT wallet client provides the signing capability. We use tweetnacl
|
|
15
|
+
* for Ed25519 signatures since the GOAT SolanaWalletClient exposes signMessage().
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
interface WzrdApiClientOptions {
|
|
19
|
+
apiUrl?: string;
|
|
20
|
+
}
|
|
21
|
+
declare class WzrdApiClient {
|
|
22
|
+
readonly apiUrl: string;
|
|
23
|
+
private tokenCache;
|
|
24
|
+
constructor(options?: WzrdApiClientOptions);
|
|
25
|
+
/**
|
|
26
|
+
* Authenticate with the WZRD API using the GOAT wallet client.
|
|
27
|
+
*
|
|
28
|
+
* Flow:
|
|
29
|
+
* 1. GET /v1/agent/challenge — receive nonce
|
|
30
|
+
* 2. Sign canonical message with wallet's signMessage()
|
|
31
|
+
* 3. POST /v1/agent/verify — receive bearer token (24h TTL)
|
|
32
|
+
*
|
|
33
|
+
* Returns a cached bearer token if still valid.
|
|
34
|
+
*/
|
|
35
|
+
authenticate(walletClient: SolanaWalletClient): Promise<string>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare class WzrdPlugin extends PluginBase {
|
|
39
|
+
constructor(options?: WzrdApiClientOptions);
|
|
40
|
+
supportsChain: (chain: Chain) => chain is _goat_sdk_core.SolanaChain;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Factory function — standard GOAT plugin pattern.
|
|
44
|
+
*
|
|
45
|
+
* @param options.apiUrl - Override WZRD API URL (default: https://api.twzrd.xyz)
|
|
46
|
+
*/
|
|
47
|
+
declare const wzrd: (options?: WzrdApiClientOptions) => WzrdPlugin;
|
|
48
|
+
|
|
49
|
+
declare const GetLeaderboardParameters_base: _goat_sdk_core.ToolParametersStatic<z.ZodObject<{
|
|
50
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
platform: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
limit?: number | undefined;
|
|
54
|
+
platform?: string | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
limit?: number | undefined;
|
|
57
|
+
platform?: string | undefined;
|
|
58
|
+
}>>;
|
|
59
|
+
declare class GetLeaderboardParameters extends GetLeaderboardParameters_base {
|
|
60
|
+
}
|
|
61
|
+
declare const GetVelocitySignalParameters_base: _goat_sdk_core.ToolParametersStatic<z.ZodObject<{
|
|
62
|
+
platform: z.ZodOptional<z.ZodString>;
|
|
63
|
+
min_signal: z.ZodOptional<z.ZodEnum<["BREAKOUT", "MOMENTUM", "EMERGING", "STABLE", "COOLING", "WEAK"]>>;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
platform?: string | undefined;
|
|
66
|
+
min_signal?: "BREAKOUT" | "MOMENTUM" | "EMERGING" | "STABLE" | "COOLING" | "WEAK" | undefined;
|
|
67
|
+
}, {
|
|
68
|
+
platform?: string | undefined;
|
|
69
|
+
min_signal?: "BREAKOUT" | "MOMENTUM" | "EMERGING" | "STABLE" | "COOLING" | "WEAK" | undefined;
|
|
70
|
+
}>>;
|
|
71
|
+
declare class GetVelocitySignalParameters extends GetVelocitySignalParameters_base {
|
|
72
|
+
}
|
|
73
|
+
declare const GetPortfolioParameters_base: _goat_sdk_core.ToolParametersStatic<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
74
|
+
declare class GetPortfolioParameters extends GetPortfolioParameters_base {
|
|
75
|
+
}
|
|
76
|
+
declare const DepositParameters_base: _goat_sdk_core.ToolParametersStatic<z.ZodObject<{
|
|
77
|
+
market_id: z.ZodNumber;
|
|
78
|
+
amount_usdc: z.ZodNumber;
|
|
79
|
+
priority_fee: z.ZodOptional<z.ZodNumber>;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
market_id: number;
|
|
82
|
+
amount_usdc: number;
|
|
83
|
+
priority_fee?: number | undefined;
|
|
84
|
+
}, {
|
|
85
|
+
market_id: number;
|
|
86
|
+
amount_usdc: number;
|
|
87
|
+
priority_fee?: number | undefined;
|
|
88
|
+
}>>;
|
|
89
|
+
declare class DepositParameters extends DepositParameters_base {
|
|
90
|
+
}
|
|
91
|
+
declare const ClaimParameters_base: _goat_sdk_core.ToolParametersStatic<z.ZodObject<{
|
|
92
|
+
execute: z.ZodOptional<z.ZodBoolean>;
|
|
93
|
+
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
execute?: boolean | undefined;
|
|
95
|
+
}, {
|
|
96
|
+
execute?: boolean | undefined;
|
|
97
|
+
}>>;
|
|
98
|
+
declare class ClaimParameters extends ClaimParameters_base {
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export { ClaimParameters, DepositParameters, GetLeaderboardParameters, GetPortfolioParameters, GetVelocitySignalParameters, WzrdApiClient, type WzrdApiClientOptions, WzrdPlugin, wzrd };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import * as _goat_sdk_core from '@goat-sdk/core';
|
|
2
|
+
import { PluginBase, Chain } from '@goat-sdk/core';
|
|
3
|
+
import { SolanaWalletClient } from '@goat-sdk/wallet-solana';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WzrdApiClient — shared API client used by all WZRD GOAT tools.
|
|
8
|
+
*
|
|
9
|
+
* Handles:
|
|
10
|
+
* - Ed25519 challenge/verify authentication with the WZRD API
|
|
11
|
+
* - Token caching with expiry-aware refresh
|
|
12
|
+
* - Base URL resolution (env var or constructor param)
|
|
13
|
+
*
|
|
14
|
+
* The GOAT wallet client provides the signing capability. We use tweetnacl
|
|
15
|
+
* for Ed25519 signatures since the GOAT SolanaWalletClient exposes signMessage().
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
interface WzrdApiClientOptions {
|
|
19
|
+
apiUrl?: string;
|
|
20
|
+
}
|
|
21
|
+
declare class WzrdApiClient {
|
|
22
|
+
readonly apiUrl: string;
|
|
23
|
+
private tokenCache;
|
|
24
|
+
constructor(options?: WzrdApiClientOptions);
|
|
25
|
+
/**
|
|
26
|
+
* Authenticate with the WZRD API using the GOAT wallet client.
|
|
27
|
+
*
|
|
28
|
+
* Flow:
|
|
29
|
+
* 1. GET /v1/agent/challenge — receive nonce
|
|
30
|
+
* 2. Sign canonical message with wallet's signMessage()
|
|
31
|
+
* 3. POST /v1/agent/verify — receive bearer token (24h TTL)
|
|
32
|
+
*
|
|
33
|
+
* Returns a cached bearer token if still valid.
|
|
34
|
+
*/
|
|
35
|
+
authenticate(walletClient: SolanaWalletClient): Promise<string>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare class WzrdPlugin extends PluginBase {
|
|
39
|
+
constructor(options?: WzrdApiClientOptions);
|
|
40
|
+
supportsChain: (chain: Chain) => chain is _goat_sdk_core.SolanaChain;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Factory function — standard GOAT plugin pattern.
|
|
44
|
+
*
|
|
45
|
+
* @param options.apiUrl - Override WZRD API URL (default: https://api.twzrd.xyz)
|
|
46
|
+
*/
|
|
47
|
+
declare const wzrd: (options?: WzrdApiClientOptions) => WzrdPlugin;
|
|
48
|
+
|
|
49
|
+
declare const GetLeaderboardParameters_base: _goat_sdk_core.ToolParametersStatic<z.ZodObject<{
|
|
50
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
platform: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
limit?: number | undefined;
|
|
54
|
+
platform?: string | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
limit?: number | undefined;
|
|
57
|
+
platform?: string | undefined;
|
|
58
|
+
}>>;
|
|
59
|
+
declare class GetLeaderboardParameters extends GetLeaderboardParameters_base {
|
|
60
|
+
}
|
|
61
|
+
declare const GetVelocitySignalParameters_base: _goat_sdk_core.ToolParametersStatic<z.ZodObject<{
|
|
62
|
+
platform: z.ZodOptional<z.ZodString>;
|
|
63
|
+
min_signal: z.ZodOptional<z.ZodEnum<["BREAKOUT", "MOMENTUM", "EMERGING", "STABLE", "COOLING", "WEAK"]>>;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
platform?: string | undefined;
|
|
66
|
+
min_signal?: "BREAKOUT" | "MOMENTUM" | "EMERGING" | "STABLE" | "COOLING" | "WEAK" | undefined;
|
|
67
|
+
}, {
|
|
68
|
+
platform?: string | undefined;
|
|
69
|
+
min_signal?: "BREAKOUT" | "MOMENTUM" | "EMERGING" | "STABLE" | "COOLING" | "WEAK" | undefined;
|
|
70
|
+
}>>;
|
|
71
|
+
declare class GetVelocitySignalParameters extends GetVelocitySignalParameters_base {
|
|
72
|
+
}
|
|
73
|
+
declare const GetPortfolioParameters_base: _goat_sdk_core.ToolParametersStatic<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
74
|
+
declare class GetPortfolioParameters extends GetPortfolioParameters_base {
|
|
75
|
+
}
|
|
76
|
+
declare const DepositParameters_base: _goat_sdk_core.ToolParametersStatic<z.ZodObject<{
|
|
77
|
+
market_id: z.ZodNumber;
|
|
78
|
+
amount_usdc: z.ZodNumber;
|
|
79
|
+
priority_fee: z.ZodOptional<z.ZodNumber>;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
market_id: number;
|
|
82
|
+
amount_usdc: number;
|
|
83
|
+
priority_fee?: number | undefined;
|
|
84
|
+
}, {
|
|
85
|
+
market_id: number;
|
|
86
|
+
amount_usdc: number;
|
|
87
|
+
priority_fee?: number | undefined;
|
|
88
|
+
}>>;
|
|
89
|
+
declare class DepositParameters extends DepositParameters_base {
|
|
90
|
+
}
|
|
91
|
+
declare const ClaimParameters_base: _goat_sdk_core.ToolParametersStatic<z.ZodObject<{
|
|
92
|
+
execute: z.ZodOptional<z.ZodBoolean>;
|
|
93
|
+
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
execute?: boolean | undefined;
|
|
95
|
+
}, {
|
|
96
|
+
execute?: boolean | undefined;
|
|
97
|
+
}>>;
|
|
98
|
+
declare class ClaimParameters extends ClaimParameters_base {
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export { ClaimParameters, DepositParameters, GetLeaderboardParameters, GetPortfolioParameters, GetVelocitySignalParameters, WzrdApiClient, type WzrdApiClientOptions, WzrdPlugin, wzrd };
|