elizaos-plugin-crewpay 0.1.1 → 0.2.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/README.md +3 -4
- package/dist/client.d.ts +9 -21
- package/dist/client.js +15 -59
- package/dist/index.d.ts +59 -17
- package/dist/index.js +25 -28
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -23,11 +23,10 @@ import crewpayPlugin from 'elizaos-plugin-crewpay'
|
|
|
23
23
|
|
|
24
24
|
## Safety
|
|
25
25
|
|
|
26
|
-
- Always run `CREW_LAUNCH_DRY_RUN` first — it returns
|
|
27
|
-
- `
|
|
28
|
-
- `CREW_WIRE_FEES` also requires `humanConfirmed` + `APPROVE_SOL_SPEND`
|
|
26
|
+
- Always run `CREW_LAUNCH_DRY_RUN` first — it returns `dryRunId` + `approvalUrl`
|
|
27
|
+
- Human opens `approvalUrl`; then `CREW_LAUNCH` with the same body + `dryRunId`
|
|
29
28
|
- Fee map: **60% KOLs / 15% agent / 25% CrewPay** — buyback cron not live yet
|
|
30
|
-
- Prefer MCP: `npx -y crewpay-mcp@1.2.
|
|
29
|
+
- Prefer MCP: `npx -y crewpay-mcp@1.2.3` or https://mcp.crewpay.dev/mcp
|
|
31
30
|
|
|
32
31
|
## Links
|
|
33
32
|
|
package/dist/client.d.ts
CHANGED
|
@@ -2,21 +2,17 @@
|
|
|
2
2
|
* Minimal CrewPay REST client for framework plugins.
|
|
3
3
|
* Keys from env only — never accept private keys as function arguments.
|
|
4
4
|
*
|
|
5
|
-
* Spend
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Spend gate: POST /api/agent/launch/dry-run returns dryRunId + approvalUrl
|
|
6
|
+
* (no approve secret). Operator opens approvalUrl and wallet-signs.
|
|
7
|
+
* Launch/wire require dryRunId after approval. Image content is bound by sha256.
|
|
8
8
|
*/
|
|
9
9
|
export declare const DEFAULT_API_URL = "https://api.crewpay.dev";
|
|
10
|
-
/** Exact phrase a human must supply for SOL-spending calls. */
|
|
11
|
-
export declare const SOL_SPEND_CONFIRM_PHRASE = "APPROVE_SOL_SPEND";
|
|
12
10
|
export type CrewPayEnv = {
|
|
13
11
|
apiUrl?: string;
|
|
14
12
|
apiKey?: string;
|
|
15
13
|
launcherKey?: string;
|
|
16
14
|
};
|
|
17
15
|
export declare function loadCrewPayEnv(overrides?: CrewPayEnv): Required<Pick<CrewPayEnv, 'apiUrl'>> & CrewPayEnv;
|
|
18
|
-
/** Canonical hash of launch fields so dry-run and launch bodies must match. */
|
|
19
|
-
export declare function hashLaunchBody(body: Record<string, unknown>): string;
|
|
20
16
|
export declare class CrewPayClient {
|
|
21
17
|
private readonly env;
|
|
22
18
|
constructor(env?: ReturnType<typeof loadCrewPayEnv>);
|
|
@@ -32,27 +28,19 @@ export declare class CrewPayClient {
|
|
|
32
28
|
model?: string;
|
|
33
29
|
}): Promise<unknown>;
|
|
34
30
|
autohire(body: Record<string, unknown>): Promise<unknown>;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
confirmPhraseRequired: string;
|
|
38
|
-
tip: string;
|
|
39
|
-
}>;
|
|
40
|
-
/**
|
|
41
|
-
* Real launch — spends SOL. Requires a prior dryRunToken for this body plus
|
|
42
|
-
* humanConfirmed and confirmPhrase APPROVE_SOL_SPEND.
|
|
43
|
-
*/
|
|
31
|
+
/** Server dry-run — returns plan + dryRunId + approvalUrl (no approve secret). */
|
|
32
|
+
dryRun(body: Record<string, unknown>): Promise<unknown>;
|
|
44
33
|
launch(body: Record<string, unknown>, opts: {
|
|
45
|
-
|
|
46
|
-
confirmPhrase: string;
|
|
47
|
-
dryRunToken: string;
|
|
34
|
+
dryRunId: string;
|
|
48
35
|
}): Promise<unknown>;
|
|
49
36
|
wireFees(body: {
|
|
50
37
|
mint: string;
|
|
51
38
|
mode?: string;
|
|
52
39
|
crew?: unknown[];
|
|
40
|
+
name?: string;
|
|
41
|
+
ticker?: string;
|
|
53
42
|
}, opts: {
|
|
54
|
-
|
|
55
|
-
confirmPhrase: string;
|
|
43
|
+
dryRunId: string;
|
|
56
44
|
}): Promise<unknown>;
|
|
57
45
|
crank(body: {
|
|
58
46
|
mint: string;
|
package/dist/client.js
CHANGED
|
@@ -2,16 +2,11 @@
|
|
|
2
2
|
* Minimal CrewPay REST client for framework plugins.
|
|
3
3
|
* Keys from env only — never accept private keys as function arguments.
|
|
4
4
|
*
|
|
5
|
-
* Spend
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Spend gate: POST /api/agent/launch/dry-run returns dryRunId + approvalUrl
|
|
6
|
+
* (no approve secret). Operator opens approvalUrl and wallet-signs.
|
|
7
|
+
* Launch/wire require dryRunId after approval. Image content is bound by sha256.
|
|
8
8
|
*/
|
|
9
|
-
import { createHash, randomBytes } from 'node:crypto';
|
|
10
9
|
export const DEFAULT_API_URL = 'https://api.crewpay.dev';
|
|
11
|
-
/** Exact phrase a human must supply for SOL-spending calls. */
|
|
12
|
-
export const SOL_SPEND_CONFIRM_PHRASE = 'APPROVE_SOL_SPEND';
|
|
13
|
-
const pendingDryRuns = new Map();
|
|
14
|
-
const DRY_RUN_TTL_MS = 30 * 60 * 1000;
|
|
15
10
|
export function loadCrewPayEnv(overrides = {}) {
|
|
16
11
|
return {
|
|
17
12
|
apiUrl: (overrides.apiUrl || process.env.CREW_API_URL || DEFAULT_API_URL).replace(/\/$/, ''),
|
|
@@ -24,29 +19,6 @@ export function loadCrewPayEnv(overrides = {}) {
|
|
|
24
19
|
'',
|
|
25
20
|
};
|
|
26
21
|
}
|
|
27
|
-
/** Canonical hash of launch fields so dry-run and launch bodies must match. */
|
|
28
|
-
export function hashLaunchBody(body) {
|
|
29
|
-
const pick = {
|
|
30
|
-
name: body.name,
|
|
31
|
-
ticker: body.ticker,
|
|
32
|
-
description: body.description ?? null,
|
|
33
|
-
mode: body.mode ?? 'agent',
|
|
34
|
-
initialBuySol: body.initialBuySol ?? 0,
|
|
35
|
-
imageUrl: body.imageUrl ?? null,
|
|
36
|
-
autoHire: body.autoHire ?? null,
|
|
37
|
-
crew: body.crew ?? null,
|
|
38
|
-
holderKol: body.holderKol ?? false,
|
|
39
|
-
};
|
|
40
|
-
return createHash('sha256').update(JSON.stringify(pick)).digest('hex');
|
|
41
|
-
}
|
|
42
|
-
function assertSpendConfirm(opts, action) {
|
|
43
|
-
if (opts.humanConfirmed !== true) {
|
|
44
|
-
throw new Error(`${action} blocked: humanConfirmed must be true after an explicit human approval`);
|
|
45
|
-
}
|
|
46
|
-
if (opts.confirmPhrase !== SOL_SPEND_CONFIRM_PHRASE) {
|
|
47
|
-
throw new Error(`${action} blocked: confirmPhrase must be exactly "${SOL_SPEND_CONFIRM_PHRASE}" (human-supplied; do not invent)`);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
22
|
export class CrewPayClient {
|
|
51
23
|
env;
|
|
52
24
|
constructor(env = loadCrewPayEnv()) {
|
|
@@ -102,52 +74,36 @@ export class CrewPayClient {
|
|
|
102
74
|
body: JSON.stringify(body),
|
|
103
75
|
});
|
|
104
76
|
}
|
|
105
|
-
|
|
106
|
-
|
|
77
|
+
/** Server dry-run — returns plan + dryRunId + approvalUrl (no approve secret). */
|
|
78
|
+
dryRun(body) {
|
|
79
|
+
return this.fetch('/api/agent/launch/dry-run', {
|
|
107
80
|
method: 'POST',
|
|
108
81
|
auth: true,
|
|
109
82
|
body: JSON.stringify(body),
|
|
110
83
|
});
|
|
111
|
-
const dryRunToken = randomBytes(16).toString('hex');
|
|
112
|
-
pendingDryRuns.set(dryRunToken, {
|
|
113
|
-
bodyHash: hashLaunchBody(body),
|
|
114
|
-
expiresAt: Date.now() + DRY_RUN_TTL_MS,
|
|
115
|
-
});
|
|
116
|
-
return {
|
|
117
|
-
...(typeof data === 'object' && data ? data : { result: data }),
|
|
118
|
-
dryRunToken,
|
|
119
|
-
confirmPhraseRequired: SOL_SPEND_CONFIRM_PHRASE,
|
|
120
|
-
tip: `To launch: pass the same body + dryRunToken + humanConfirmed:true + confirmPhrase:"${SOL_SPEND_CONFIRM_PHRASE}" (human must supply the phrase).`,
|
|
121
|
-
};
|
|
122
84
|
}
|
|
123
|
-
/**
|
|
124
|
-
* Real launch — spends SOL. Requires a prior dryRunToken for this body plus
|
|
125
|
-
* humanConfirmed and confirmPhrase APPROVE_SOL_SPEND.
|
|
126
|
-
*/
|
|
127
85
|
launch(body, opts) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
throw new Error('Launch blocked: missing/expired dryRunToken — call dryRun first and reuse its dryRunToken');
|
|
132
|
-
}
|
|
133
|
-
if (pending.bodyHash !== hashLaunchBody(body)) {
|
|
134
|
-
throw new Error('Launch blocked: body does not match the dry-run that issued dryRunToken');
|
|
86
|
+
const dryRunId = String(opts.dryRunId || '').trim();
|
|
87
|
+
if (!dryRunId) {
|
|
88
|
+
throw new Error('Launch blocked: dryRunId required — dry-run, operator wallet-approves on approvalUrl, then launch');
|
|
135
89
|
}
|
|
136
|
-
pendingDryRuns.delete(opts.dryRunToken);
|
|
137
90
|
return this.fetch('/api/agent/launch', {
|
|
138
91
|
method: 'POST',
|
|
139
92
|
auth: true,
|
|
140
93
|
launcher: true,
|
|
141
|
-
body: JSON.stringify(body),
|
|
94
|
+
body: JSON.stringify({ ...body, dryRunId }),
|
|
142
95
|
});
|
|
143
96
|
}
|
|
144
97
|
wireFees(body, opts) {
|
|
145
|
-
|
|
98
|
+
const dryRunId = String(opts.dryRunId || '').trim();
|
|
99
|
+
if (!dryRunId) {
|
|
100
|
+
throw new Error('Wire-fees blocked: dryRunId required — dry-run with intent=wire-fees, wallet-approve, then wire');
|
|
101
|
+
}
|
|
146
102
|
return this.fetch('/api/agent/wire-fees', {
|
|
147
103
|
method: 'POST',
|
|
148
104
|
auth: true,
|
|
149
105
|
launcher: true,
|
|
150
|
-
body: JSON.stringify(body),
|
|
106
|
+
body: JSON.stringify({ ...body, dryRunId }),
|
|
151
107
|
});
|
|
152
108
|
}
|
|
153
109
|
crank(body) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ElizaOS plugin scaffold for CrewPay.
|
|
3
|
-
*
|
|
3
|
+
* Prefer MCP: npx -y crewpay-mcp@1.2.3 or https://mcp.crewpay.dev/mcp
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Launch requires dryRunId from CREW_LAUNCH_DRY_RUN after human approval
|
|
6
|
+
* on the approvalUrl page (no confirm phrase).
|
|
7
7
|
*/
|
|
8
|
-
type ActionResult = {
|
|
9
|
-
success: boolean;
|
|
10
|
-
text?: string;
|
|
11
|
-
data?: unknown;
|
|
12
|
-
error?: string;
|
|
13
|
-
};
|
|
14
8
|
export declare const crewDiscoverAction: {
|
|
15
9
|
name: string;
|
|
16
10
|
similes: string[];
|
|
17
11
|
description: string;
|
|
18
12
|
validate: () => Promise<boolean>;
|
|
19
|
-
handler: () => Promise<
|
|
13
|
+
handler: () => Promise<{
|
|
14
|
+
success: boolean;
|
|
15
|
+
data: unknown;
|
|
16
|
+
} | {
|
|
17
|
+
success: boolean;
|
|
18
|
+
error: string;
|
|
19
|
+
}>;
|
|
20
20
|
};
|
|
21
21
|
export declare const crewAutohireAction: {
|
|
22
22
|
name: string;
|
|
@@ -27,7 +27,13 @@ export declare const crewAutohireAction: {
|
|
|
27
27
|
content?: {
|
|
28
28
|
text?: string;
|
|
29
29
|
};
|
|
30
|
-
}) => Promise<
|
|
30
|
+
}) => Promise<{
|
|
31
|
+
success: boolean;
|
|
32
|
+
data: unknown;
|
|
33
|
+
} | {
|
|
34
|
+
success: boolean;
|
|
35
|
+
error: string;
|
|
36
|
+
}>;
|
|
31
37
|
};
|
|
32
38
|
export declare const crewDryRunAction: {
|
|
33
39
|
name: string;
|
|
@@ -38,7 +44,13 @@ export declare const crewDryRunAction: {
|
|
|
38
44
|
content?: {
|
|
39
45
|
text?: string;
|
|
40
46
|
};
|
|
41
|
-
}) => Promise<
|
|
47
|
+
}) => Promise<{
|
|
48
|
+
success: boolean;
|
|
49
|
+
data: unknown;
|
|
50
|
+
} | {
|
|
51
|
+
success: boolean;
|
|
52
|
+
error: string;
|
|
53
|
+
}>;
|
|
42
54
|
};
|
|
43
55
|
export declare const crewLaunchAction: {
|
|
44
56
|
name: string;
|
|
@@ -49,7 +61,13 @@ export declare const crewLaunchAction: {
|
|
|
49
61
|
content?: {
|
|
50
62
|
text?: string;
|
|
51
63
|
};
|
|
52
|
-
}) => Promise<
|
|
64
|
+
}) => Promise<{
|
|
65
|
+
success: boolean;
|
|
66
|
+
data: unknown;
|
|
67
|
+
} | {
|
|
68
|
+
success: boolean;
|
|
69
|
+
error: string;
|
|
70
|
+
}>;
|
|
53
71
|
};
|
|
54
72
|
export declare const crewWireFeesAction: {
|
|
55
73
|
name: string;
|
|
@@ -60,7 +78,13 @@ export declare const crewWireFeesAction: {
|
|
|
60
78
|
content?: {
|
|
61
79
|
text?: string;
|
|
62
80
|
};
|
|
63
|
-
}) => Promise<
|
|
81
|
+
}) => Promise<{
|
|
82
|
+
success: boolean;
|
|
83
|
+
data: unknown;
|
|
84
|
+
} | {
|
|
85
|
+
success: boolean;
|
|
86
|
+
error: string;
|
|
87
|
+
}>;
|
|
64
88
|
};
|
|
65
89
|
export declare const crewCrankAction: {
|
|
66
90
|
name: string;
|
|
@@ -71,14 +95,26 @@ export declare const crewCrankAction: {
|
|
|
71
95
|
content?: {
|
|
72
96
|
text?: string;
|
|
73
97
|
};
|
|
74
|
-
}) => Promise<
|
|
98
|
+
}) => Promise<{
|
|
99
|
+
success: boolean;
|
|
100
|
+
data: unknown;
|
|
101
|
+
} | {
|
|
102
|
+
success: boolean;
|
|
103
|
+
error: string;
|
|
104
|
+
}>;
|
|
75
105
|
};
|
|
76
106
|
export declare const crewProofAction: {
|
|
77
107
|
name: string;
|
|
78
108
|
similes: string[];
|
|
79
109
|
description: string;
|
|
80
110
|
validate: () => Promise<boolean>;
|
|
81
|
-
handler: () => Promise<
|
|
111
|
+
handler: () => Promise<{
|
|
112
|
+
success: boolean;
|
|
113
|
+
data: unknown;
|
|
114
|
+
} | {
|
|
115
|
+
success: boolean;
|
|
116
|
+
error: string;
|
|
117
|
+
}>;
|
|
82
118
|
};
|
|
83
119
|
export declare const crewpayPlugin: {
|
|
84
120
|
name: string;
|
|
@@ -92,7 +128,13 @@ export declare const crewpayPlugin: {
|
|
|
92
128
|
content?: {
|
|
93
129
|
text?: string;
|
|
94
130
|
};
|
|
95
|
-
}) => Promise<
|
|
131
|
+
}) => Promise<{
|
|
132
|
+
success: boolean;
|
|
133
|
+
data: unknown;
|
|
134
|
+
} | {
|
|
135
|
+
success: boolean;
|
|
136
|
+
error: string;
|
|
137
|
+
}>;
|
|
96
138
|
}[];
|
|
97
139
|
providers: never[];
|
|
98
140
|
services: never[];
|
package/dist/index.js
CHANGED
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ElizaOS plugin scaffold for CrewPay.
|
|
3
|
-
*
|
|
3
|
+
* Prefer MCP: npx -y crewpay-mcp@1.2.3 or https://mcp.crewpay.dev/mcp
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Launch requires dryRunId from CREW_LAUNCH_DRY_RUN after human approval
|
|
6
|
+
* on the approvalUrl page (no confirm phrase).
|
|
7
7
|
*/
|
|
8
|
-
import { CrewPayClient, loadCrewPayEnv
|
|
8
|
+
import { CrewPayClient, loadCrewPayEnv } from './client.js';
|
|
9
9
|
function client() {
|
|
10
10
|
return new CrewPayClient(loadCrewPayEnv());
|
|
11
11
|
}
|
|
12
|
-
function ok(data, text) {
|
|
13
|
-
return { success: true, text: text ?? JSON.stringify(data, null, 2), data };
|
|
14
|
-
}
|
|
15
|
-
function fail(err) {
|
|
16
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
17
|
-
return { success: false, error: message, text: message };
|
|
18
|
-
}
|
|
19
12
|
function parseJsonContent(message) {
|
|
20
|
-
const
|
|
13
|
+
const text = message.content?.text?.trim() || '{}';
|
|
21
14
|
try {
|
|
22
|
-
const parsed = JSON.parse(
|
|
15
|
+
const parsed = JSON.parse(text);
|
|
23
16
|
return typeof parsed === 'object' && parsed ? parsed : {};
|
|
24
17
|
}
|
|
25
18
|
catch {
|
|
26
19
|
return {};
|
|
27
20
|
}
|
|
28
21
|
}
|
|
22
|
+
function ok(data) {
|
|
23
|
+
return { success: true, data };
|
|
24
|
+
}
|
|
25
|
+
function fail(e) {
|
|
26
|
+
return { success: false, error: e instanceof Error ? e.message : String(e) };
|
|
27
|
+
}
|
|
29
28
|
export const crewDiscoverAction = {
|
|
30
29
|
name: 'CREW_DISCOVER',
|
|
31
|
-
similes: ['CREWPAY_DISCOVER'
|
|
32
|
-
description: '
|
|
30
|
+
similes: ['CREWPAY_DISCOVER'],
|
|
31
|
+
description: 'Discover CrewPay agent API, fee map, and MCP surfaces.',
|
|
33
32
|
validate: async () => true,
|
|
34
33
|
handler: async () => {
|
|
35
34
|
try {
|
|
@@ -42,8 +41,8 @@ export const crewDiscoverAction = {
|
|
|
42
41
|
};
|
|
43
42
|
export const crewAutohireAction = {
|
|
44
43
|
name: 'CREW_AUTOHIRE',
|
|
45
|
-
similes: ['CREWPAY_AUTOHIRE'
|
|
46
|
-
description: 'Preview KOL
|
|
44
|
+
similes: ['CREWPAY_AUTOHIRE'],
|
|
45
|
+
description: 'Preview Autohire KOL crew (no SOL).',
|
|
47
46
|
validate: async () => Boolean(loadCrewPayEnv().apiKey),
|
|
48
47
|
handler: async (_runtime, message) => {
|
|
49
48
|
try {
|
|
@@ -57,7 +56,7 @@ export const crewAutohireAction = {
|
|
|
57
56
|
export const crewDryRunAction = {
|
|
58
57
|
name: 'CREW_LAUNCH_DRY_RUN',
|
|
59
58
|
similes: ['CREWPAY_DRY_RUN', 'CREW_DRY_RUN'],
|
|
60
|
-
description:
|
|
59
|
+
description: 'Dry-run a CrewPay launch (no mint, no SOL). Returns dryRunId + approvalUrl. Human must open approvalUrl before CREW_LAUNCH.',
|
|
61
60
|
validate: async () => Boolean(loadCrewPayEnv().apiKey),
|
|
62
61
|
handler: async (_runtime, message) => {
|
|
63
62
|
try {
|
|
@@ -71,18 +70,17 @@ export const crewDryRunAction = {
|
|
|
71
70
|
export const crewLaunchAction = {
|
|
72
71
|
name: 'CREW_LAUNCH',
|
|
73
72
|
similes: ['CREWPAY_LAUNCH'],
|
|
74
|
-
description:
|
|
73
|
+
description: 'MAINNET launch after dry-run. Requires dryRunId from CREW_LAUNCH_DRY_RUN after human approval on approvalUrl. Fee map 60/15/25; buyback not live.',
|
|
75
74
|
validate: async () => Boolean(loadCrewPayEnv().apiKey && loadCrewPayEnv().launcherKey),
|
|
76
75
|
handler: async (_runtime, message) => {
|
|
77
76
|
try {
|
|
78
77
|
const body = parseJsonContent(message);
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
const dryRunToken = typeof body.dryRunToken === 'string' ? body.dryRunToken : '';
|
|
78
|
+
const dryRunId = typeof body.dryRunId === 'string' ? body.dryRunId : '';
|
|
79
|
+
delete body.dryRunId;
|
|
82
80
|
delete body.humanConfirmed;
|
|
83
81
|
delete body.confirmPhrase;
|
|
84
82
|
delete body.dryRunToken;
|
|
85
|
-
return ok(await client().launch(body, {
|
|
83
|
+
return ok(await client().launch(body, { dryRunId }));
|
|
86
84
|
}
|
|
87
85
|
catch (e) {
|
|
88
86
|
return fail(e);
|
|
@@ -92,16 +90,15 @@ export const crewLaunchAction = {
|
|
|
92
90
|
export const crewWireFeesAction = {
|
|
93
91
|
name: 'CREW_WIRE_FEES',
|
|
94
92
|
similes: ['CREWPAY_WIRE_FEES'],
|
|
95
|
-
description:
|
|
93
|
+
description: 'Wire / repair fee-shares (spends SOL). Requires dryRunId from dry-run intent=wire-fees after wallet approval.',
|
|
96
94
|
validate: async () => Boolean(loadCrewPayEnv().apiKey && loadCrewPayEnv().launcherKey),
|
|
97
95
|
handler: async (_runtime, message) => {
|
|
98
96
|
try {
|
|
99
97
|
const body = parseJsonContent(message);
|
|
100
|
-
const humanConfirmed = body.humanConfirmed === true;
|
|
101
|
-
const confirmPhrase = typeof body.confirmPhrase === 'string' ? body.confirmPhrase : '';
|
|
102
98
|
const mint = String(body.mint || '');
|
|
103
99
|
const mode = typeof body.mode === 'string' ? body.mode : undefined;
|
|
104
|
-
|
|
100
|
+
const dryRunId = typeof body.dryRunId === 'string' ? body.dryRunId : '';
|
|
101
|
+
return ok(await client().wireFees({ mint, mode }, { dryRunId }));
|
|
105
102
|
}
|
|
106
103
|
catch (e) {
|
|
107
104
|
return fail(e);
|
|
@@ -139,7 +136,7 @@ export const crewProofAction = {
|
|
|
139
136
|
};
|
|
140
137
|
export const crewpayPlugin = {
|
|
141
138
|
name: 'crewpay',
|
|
142
|
-
description: 'CrewPay — Solana Pump.fun launches with KOL Autohire and on-chain fee-shares (60/15/25). Buyback not live yet. Dry-run
|
|
139
|
+
description: 'CrewPay — Solana Pump.fun launches with KOL Autohire and on-chain fee-shares (60/15/25). Buyback not live yet. Dry-run → approvalUrl → launch with dryRunId.',
|
|
143
140
|
actions: [
|
|
144
141
|
crewDiscoverAction,
|
|
145
142
|
crewAutohireAction,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "elizaos-plugin-crewpay",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "ElizaOS plugin for CrewPay — Solana Pump.fun KOL Autohire + fee-shares (60/15/25). Buyback cron not live.
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "ElizaOS plugin for CrewPay — Solana Pump.fun KOL Autohire + fee-shares (60/15/25). Buyback cron not live. Dry-run returns dryRunId + approvalUrl before launch.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
"LICENSE"
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
|
-
"build": "tsc -p tsconfig.json"
|
|
21
|
-
"prepublishOnly": "npm run build"
|
|
20
|
+
"build": "tsc -p tsconfig.json"
|
|
22
21
|
},
|
|
23
22
|
"keywords": [
|
|
24
23
|
"elizaos",
|
|
@@ -50,5 +49,6 @@
|
|
|
50
49
|
},
|
|
51
50
|
"publishConfig": {
|
|
52
51
|
"access": "public"
|
|
53
|
-
}
|
|
52
|
+
},
|
|
53
|
+
"private": false
|
|
54
54
|
}
|