dexe-mcp 0.3.0 → 0.4.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/CHANGELOG.md +192 -136
- package/dist/lib/merkleTree.d.ts +38 -0
- package/dist/lib/merkleTree.d.ts.map +1 -0
- package/dist/lib/merkleTree.js +83 -0
- package/dist/lib/merkleTree.js.map +1 -0
- package/dist/tools/flow.d.ts +57 -0
- package/dist/tools/flow.d.ts.map +1 -1
- package/dist/tools/flow.js +204 -176
- package/dist/tools/flow.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/merkle.d.ts +4 -0
- package/dist/tools/merkle.d.ts.map +1 -0
- package/dist/tools/merkle.js +174 -0
- package/dist/tools/merkle.js.map +1 -0
- package/dist/tools/otc.d.ts +5 -0
- package/dist/tools/otc.d.ts.map +1 -0
- package/dist/tools/otc.js +481 -0
- package/dist/tools/otc.js.map +1 -0
- package/dist/tools/proposalBuildComplex.d.ts +222 -0
- package/dist/tools/proposalBuildComplex.d.ts.map +1 -1
- package/dist/tools/proposalBuildComplex.js +373 -66
- package/dist/tools/proposalBuildComplex.js.map +1 -1
- package/dist/tools/read.js +2 -2
- package/dist/tools/read.js.map +1 -1
- package/package.json +83 -83
|
@@ -1,4 +1,226 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
3
|
import type { ToolContext } from "./context.js";
|
|
4
|
+
export declare const TOKEN_SALE_PROPOSAL_ABI: readonly ["function createTiers(tuple(tuple(string name, string description) metadata, uint256 totalTokenProvided, uint64 saleStartTime, uint64 saleEndTime, uint64 claimLockDuration, address saleTokenAddress, address[] purchaseTokenAddresses, uint256[] exchangeRates, uint256 minAllocationPerUser, uint256 maxAllocationPerUser, tuple(uint256 vestingPercentage, uint64 vestingDuration, uint64 cliffPeriod, uint64 unlockStep) vestingSettings, tuple(uint8 participationType, bytes data)[] participationDetails)[] tiers)", "function addToWhitelist(tuple(uint256 tierId, address[] users, string uri)[] requests)", "function recover(uint256[] tierIds)"];
|
|
5
|
+
type Action = {
|
|
6
|
+
executor: string;
|
|
7
|
+
value: string;
|
|
8
|
+
data: string;
|
|
9
|
+
};
|
|
3
10
|
export declare function registerProposalBuildComplexTools(server: McpServer, _ctx: ToolContext): void;
|
|
11
|
+
export declare const tierSchema: z.ZodObject<{
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
description: z.ZodDefault<z.ZodString>;
|
|
14
|
+
totalTokenProvided: z.ZodString;
|
|
15
|
+
saleStartTime: z.ZodString;
|
|
16
|
+
saleEndTime: z.ZodString;
|
|
17
|
+
claimLockDuration: z.ZodDefault<z.ZodString>;
|
|
18
|
+
saleTokenAddress: z.ZodString;
|
|
19
|
+
purchaseTokenAddresses: z.ZodArray<z.ZodString, "many">;
|
|
20
|
+
exchangeRates: z.ZodArray<z.ZodString, "many">;
|
|
21
|
+
minAllocationPerUser: z.ZodDefault<z.ZodString>;
|
|
22
|
+
maxAllocationPerUser: z.ZodDefault<z.ZodString>;
|
|
23
|
+
vestingSettings: z.ZodDefault<z.ZodObject<{
|
|
24
|
+
vestingPercentage: z.ZodDefault<z.ZodString>;
|
|
25
|
+
vestingDuration: z.ZodDefault<z.ZodString>;
|
|
26
|
+
cliffPeriod: z.ZodDefault<z.ZodString>;
|
|
27
|
+
unlockStep: z.ZodDefault<z.ZodString>;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
vestingPercentage: string;
|
|
30
|
+
vestingDuration: string;
|
|
31
|
+
cliffPeriod: string;
|
|
32
|
+
unlockStep: string;
|
|
33
|
+
}, {
|
|
34
|
+
vestingPercentage?: string | undefined;
|
|
35
|
+
vestingDuration?: string | undefined;
|
|
36
|
+
cliffPeriod?: string | undefined;
|
|
37
|
+
unlockStep?: string | undefined;
|
|
38
|
+
}>>;
|
|
39
|
+
participation: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
40
|
+
type: z.ZodLiteral<"DAOVotes">;
|
|
41
|
+
requiredVotes: z.ZodString;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
type: "DAOVotes";
|
|
44
|
+
requiredVotes: string;
|
|
45
|
+
}, {
|
|
46
|
+
type: "DAOVotes";
|
|
47
|
+
requiredVotes: string;
|
|
48
|
+
}>, z.ZodObject<{
|
|
49
|
+
type: z.ZodLiteral<"Whitelist">;
|
|
50
|
+
users: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
51
|
+
uri: z.ZodDefault<z.ZodString>;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
type: "Whitelist";
|
|
54
|
+
uri: string;
|
|
55
|
+
users: string[];
|
|
56
|
+
}, {
|
|
57
|
+
type: "Whitelist";
|
|
58
|
+
uri?: string | undefined;
|
|
59
|
+
users?: string[] | undefined;
|
|
60
|
+
}>, z.ZodObject<{
|
|
61
|
+
type: z.ZodLiteral<"BABT">;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
type: "BABT";
|
|
64
|
+
}, {
|
|
65
|
+
type: "BABT";
|
|
66
|
+
}>, z.ZodObject<{
|
|
67
|
+
type: z.ZodLiteral<"TokenLock">;
|
|
68
|
+
token: z.ZodString;
|
|
69
|
+
amount: z.ZodString;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
type: "TokenLock";
|
|
72
|
+
token: string;
|
|
73
|
+
amount: string;
|
|
74
|
+
}, {
|
|
75
|
+
type: "TokenLock";
|
|
76
|
+
token: string;
|
|
77
|
+
amount: string;
|
|
78
|
+
}>, z.ZodObject<{
|
|
79
|
+
type: z.ZodLiteral<"NftLock">;
|
|
80
|
+
nft: z.ZodString;
|
|
81
|
+
amount: z.ZodString;
|
|
82
|
+
}, "strip", z.ZodTypeAny, {
|
|
83
|
+
type: "NftLock";
|
|
84
|
+
amount: string;
|
|
85
|
+
nft: string;
|
|
86
|
+
}, {
|
|
87
|
+
type: "NftLock";
|
|
88
|
+
amount: string;
|
|
89
|
+
nft: string;
|
|
90
|
+
}>, z.ZodObject<{
|
|
91
|
+
type: z.ZodLiteral<"MerkleWhitelist">;
|
|
92
|
+
users: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
93
|
+
uri: z.ZodDefault<z.ZodString>;
|
|
94
|
+
root: z.ZodOptional<z.ZodString>;
|
|
95
|
+
}, "strip", z.ZodTypeAny, {
|
|
96
|
+
type: "MerkleWhitelist";
|
|
97
|
+
uri: string;
|
|
98
|
+
users: string[];
|
|
99
|
+
root?: string | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
type: "MerkleWhitelist";
|
|
102
|
+
uri?: string | undefined;
|
|
103
|
+
root?: string | undefined;
|
|
104
|
+
users?: string[] | undefined;
|
|
105
|
+
}>]>, "many">>;
|
|
106
|
+
}, "strip", z.ZodTypeAny, {
|
|
107
|
+
name: string;
|
|
108
|
+
description: string;
|
|
109
|
+
totalTokenProvided: string;
|
|
110
|
+
saleStartTime: string;
|
|
111
|
+
saleEndTime: string;
|
|
112
|
+
claimLockDuration: string;
|
|
113
|
+
saleTokenAddress: string;
|
|
114
|
+
purchaseTokenAddresses: string[];
|
|
115
|
+
exchangeRates: string[];
|
|
116
|
+
minAllocationPerUser: string;
|
|
117
|
+
maxAllocationPerUser: string;
|
|
118
|
+
vestingSettings: {
|
|
119
|
+
vestingPercentage: string;
|
|
120
|
+
vestingDuration: string;
|
|
121
|
+
cliffPeriod: string;
|
|
122
|
+
unlockStep: string;
|
|
123
|
+
};
|
|
124
|
+
participation: ({
|
|
125
|
+
type: "DAOVotes";
|
|
126
|
+
requiredVotes: string;
|
|
127
|
+
} | {
|
|
128
|
+
type: "Whitelist";
|
|
129
|
+
uri: string;
|
|
130
|
+
users: string[];
|
|
131
|
+
} | {
|
|
132
|
+
type: "BABT";
|
|
133
|
+
} | {
|
|
134
|
+
type: "TokenLock";
|
|
135
|
+
token: string;
|
|
136
|
+
amount: string;
|
|
137
|
+
} | {
|
|
138
|
+
type: "NftLock";
|
|
139
|
+
amount: string;
|
|
140
|
+
nft: string;
|
|
141
|
+
} | {
|
|
142
|
+
type: "MerkleWhitelist";
|
|
143
|
+
uri: string;
|
|
144
|
+
users: string[];
|
|
145
|
+
root?: string | undefined;
|
|
146
|
+
})[];
|
|
147
|
+
}, {
|
|
148
|
+
name: string;
|
|
149
|
+
totalTokenProvided: string;
|
|
150
|
+
saleStartTime: string;
|
|
151
|
+
saleEndTime: string;
|
|
152
|
+
saleTokenAddress: string;
|
|
153
|
+
purchaseTokenAddresses: string[];
|
|
154
|
+
exchangeRates: string[];
|
|
155
|
+
description?: string | undefined;
|
|
156
|
+
claimLockDuration?: string | undefined;
|
|
157
|
+
minAllocationPerUser?: string | undefined;
|
|
158
|
+
maxAllocationPerUser?: string | undefined;
|
|
159
|
+
vestingSettings?: {
|
|
160
|
+
vestingPercentage?: string | undefined;
|
|
161
|
+
vestingDuration?: string | undefined;
|
|
162
|
+
cliffPeriod?: string | undefined;
|
|
163
|
+
unlockStep?: string | undefined;
|
|
164
|
+
} | undefined;
|
|
165
|
+
participation?: ({
|
|
166
|
+
type: "DAOVotes";
|
|
167
|
+
requiredVotes: string;
|
|
168
|
+
} | {
|
|
169
|
+
type: "Whitelist";
|
|
170
|
+
uri?: string | undefined;
|
|
171
|
+
users?: string[] | undefined;
|
|
172
|
+
} | {
|
|
173
|
+
type: "BABT";
|
|
174
|
+
} | {
|
|
175
|
+
type: "TokenLock";
|
|
176
|
+
token: string;
|
|
177
|
+
amount: string;
|
|
178
|
+
} | {
|
|
179
|
+
type: "NftLock";
|
|
180
|
+
amount: string;
|
|
181
|
+
nft: string;
|
|
182
|
+
} | {
|
|
183
|
+
type: "MerkleWhitelist";
|
|
184
|
+
uri?: string | undefined;
|
|
185
|
+
root?: string | undefined;
|
|
186
|
+
users?: string[] | undefined;
|
|
187
|
+
})[] | undefined;
|
|
188
|
+
}>;
|
|
189
|
+
export type TierSpec = z.infer<typeof tierSchema>;
|
|
190
|
+
export declare function buildTierTuple(tier: TierSpec): {
|
|
191
|
+
tuple: unknown[];
|
|
192
|
+
whitelistUsers: string[];
|
|
193
|
+
whitelistUri: string;
|
|
194
|
+
derivedRoots: {
|
|
195
|
+
root: string;
|
|
196
|
+
users: string[];
|
|
197
|
+
}[];
|
|
198
|
+
};
|
|
199
|
+
export declare function buildSaleApprovals(tiers: readonly TierSpec[], tokenSaleProposal: string): Action[];
|
|
200
|
+
/**
|
|
201
|
+
* Pure builder for a multi-tier Token Sale proposal envelope. Used by both
|
|
202
|
+
* the `dexe_proposal_build_token_sale_multi` registrar and the OTC composite
|
|
203
|
+
* tools in `src/tools/otc.ts`.
|
|
204
|
+
*/
|
|
205
|
+
export declare function buildTokenSaleMultiActions(input: {
|
|
206
|
+
tokenSaleProposal: string;
|
|
207
|
+
tiers: readonly TierSpec[];
|
|
208
|
+
latestTierId?: string;
|
|
209
|
+
proposalName?: string;
|
|
210
|
+
proposalDescription?: string;
|
|
211
|
+
}): {
|
|
212
|
+
metadata: Record<string, unknown>;
|
|
213
|
+
actions: Action[];
|
|
214
|
+
derivedMerkleRoots: {
|
|
215
|
+
root: string;
|
|
216
|
+
users: string[];
|
|
217
|
+
}[];
|
|
218
|
+
whitelistRequests: {
|
|
219
|
+
tierId: string;
|
|
220
|
+
users: string[];
|
|
221
|
+
uri: string;
|
|
222
|
+
}[];
|
|
223
|
+
tierNames: string;
|
|
224
|
+
};
|
|
225
|
+
export {};
|
|
4
226
|
//# sourceMappingURL=proposalBuildComplex.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proposalBuildComplex.d.ts","sourceRoot":"","sources":["../../src/tools/proposalBuildComplex.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"proposalBuildComplex.d.ts","sourceRoot":"","sources":["../../src/tools/proposalBu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