create-message-kit 1.2.23 → 1.2.25
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +14 -13
- package/package.json +1 -2
- package/templates/ens/.cursorrules +0 -112
- package/templates/ens/package.json +1 -2
- package/templates/ens/src/index.ts +2 -16
- package/templates/ens/src/prompt.ts +1 -1
- package/templates/simple/.cursorrules +0 -112
- package/templates/simple/src/index.ts +0 -1
- package/templates/coinbase-agent/.cursorrules +0 -290
- package/templates/coinbase-agent/.env.example +0 -4
- package/templates/coinbase-agent/.yarnrc.yml +0 -9
- package/templates/coinbase-agent/package.json +0 -22
- package/templates/coinbase-agent/src/index.ts +0 -29
- package/templates/coinbase-agent/src/plugins/learnweb3.ts +0 -96
- package/templates/coinbase-agent/src/plugins/redis.ts +0 -15
- package/templates/coinbase-agent/src/prompt.ts +0 -64
- package/templates/coinbase-agent/src/skills/drip.ts +0 -83
- package/templates/coinbase-agent/src/skills/mint.ts +0 -99
- package/templates/coinbase-agent/src/skills/pay.ts +0 -35
- package/templates/coinbase-agent/src/skills/swap.ts +0 -52
- package/templates/faucet/.cursorrules +0 -290
- package/templates/faucet/.env.example +0 -5
- package/templates/faucet/.yarnrc.yml +0 -9
- package/templates/faucet/package.json +0 -22
- package/templates/faucet/src/index.ts +0 -28
- package/templates/faucet/src/plugins/learnweb3.ts +0 -96
- package/templates/faucet/src/plugins/redis.ts +0 -15
- package/templates/faucet/src/prompt.ts +0 -11
- package/templates/faucet/src/skills/faucet.ts +0 -140
- package/templates/gated-group/.cursorrules +0 -290
- package/templates/gated-group/.env.example +0 -3
- package/templates/gated-group/.yarnrc.yml +0 -9
- package/templates/gated-group/package.json +0 -23
- package/templates/gated-group/src/index.ts +0 -17
- package/templates/gated-group/src/plugins/alchemy.ts +0 -27
- package/templates/gated-group/src/plugins/xmtp.ts +0 -137
- package/templates/gated-group/src/prompt.ts +0 -11
- package/templates/gated-group/src/skills/gated.ts +0 -88
- package/templates/gm/.cursorrules +0 -290
- package/templates/gm/.env.example +0 -2
- package/templates/gm/.yarnrc.yml +0 -9
- package/templates/gm/package.json +0 -20
- package/templates/gm/src/index.ts +0 -16
- package/templates/hackathon-store/.cursorrules +0 -290
- package/templates/hackathon-store/.env.example +0 -6
- package/templates/hackathon-store/.yarnrc.yml +0 -9
- package/templates/hackathon-store/package.json +0 -20
- package/templates/hackathon-store/src/index.ts +0 -47
- package/templates/hackathon-store/src/plugins/notion.ts +0 -60
- package/templates/hackathon-store/src/prompt.md +0 -27
- package/templates/playground/.cursorrules +0 -290
- package/templates/playground/.env.example +0 -6
- package/templates/playground/.yarnrc.yml +0 -9
- package/templates/playground/package.json +0 -26
- package/templates/playground/src/index.ts +0 -38
- package/templates/playground/src/plugins/alchemy.ts +0 -27
- package/templates/playground/src/plugins/minilog.ts +0 -26
- package/templates/playground/src/plugins/usdc.ts +0 -99
- package/templates/playground/src/plugins/xmtp.ts +0 -137
- package/templates/playground/src/prompt.ts +0 -11
- package/templates/playground/src/skills/broadcast.ts +0 -39
- package/templates/playground/src/skills/cash.ts +0 -122
- package/templates/playground/src/skills/cryptoPrice.ts +0 -63
- package/templates/playground/src/skills/dalle.ts +0 -61
- package/templates/playground/src/skills/gated.ts +0 -88
- package/templates/playground/src/skills/search.ts +0 -159
- package/templates/playground/src/skills/todo.ts +0 -79
- package/templates/playground/src/skills/token.ts +0 -57
- package/templates/playground/src/skills/web.ts +0 -83
- package/templates/playground/src/skills/wordle.ts +0 -96
- package/templates/playground/src/vibes/chill.ts +0 -9
- package/templates/playground/src/vibes/friendly.ts +0 -9
- package/templates/playground/src/vibes/inquisitive.ts +0 -10
- package/templates/playground/src/vibes/playful.ts +0 -10
- package/templates/playground/src/vibes/professional.ts +0 -9
- package/templates/toss/.cursorrules +0 -290
- package/templates/toss/.env.example +0 -7
- package/templates/toss/.yarnrc.yml +0 -9
- package/templates/toss/package.json +0 -21
- package/templates/toss/src/index.ts +0 -29
- package/templates/toss/src/plugins/helpers.ts +0 -174
- package/templates/toss/src/plugins/redis.ts +0 -15
- package/templates/toss/src/prompt.ts +0 -54
- package/templates/toss/src/skills/toss.ts +0 -318
- package/templates/toss/src/skills/waas.ts +0 -116
- package/templates.json +0 -58
@@ -1,116 +0,0 @@
|
|
1
|
-
import { Skill, XMTPContext, getUserInfo } from "@xmtp/message-kit";
|
2
|
-
import { DM_HELP_MESSAGE } from "../plugins/helpers.js";
|
3
|
-
|
4
|
-
export const waas: Skill[] = [
|
5
|
-
{
|
6
|
-
skill: "create",
|
7
|
-
description: "Create an agent wallet.",
|
8
|
-
handler: handleDM,
|
9
|
-
examples: ["/create"],
|
10
|
-
},
|
11
|
-
{
|
12
|
-
skill: "fund",
|
13
|
-
description: "Fund your account.",
|
14
|
-
handler: handleDM,
|
15
|
-
examples: ["/fund 10"],
|
16
|
-
params: {
|
17
|
-
amount: {
|
18
|
-
type: "number",
|
19
|
-
},
|
20
|
-
},
|
21
|
-
},
|
22
|
-
{
|
23
|
-
skill: "withdraw",
|
24
|
-
description: "Withdraw funds from your account.",
|
25
|
-
handler: handleDM,
|
26
|
-
examples: ["/withdraw 10"],
|
27
|
-
params: {
|
28
|
-
amount: {
|
29
|
-
type: "number",
|
30
|
-
},
|
31
|
-
},
|
32
|
-
},
|
33
|
-
{
|
34
|
-
skill: "help",
|
35
|
-
description: "Get help with tossing.",
|
36
|
-
handler: handleDM,
|
37
|
-
examples: ["/help"],
|
38
|
-
},
|
39
|
-
{
|
40
|
-
skill: "balance",
|
41
|
-
description: "Check your balance.",
|
42
|
-
handler: handleDM,
|
43
|
-
examples: ["/balance"],
|
44
|
-
},
|
45
|
-
];
|
46
|
-
|
47
|
-
export async function handleDM(context: XMTPContext) {
|
48
|
-
const {
|
49
|
-
message: {
|
50
|
-
content: {
|
51
|
-
skill,
|
52
|
-
params: { amount },
|
53
|
-
},
|
54
|
-
sender,
|
55
|
-
},
|
56
|
-
group,
|
57
|
-
walletService,
|
58
|
-
} = context;
|
59
|
-
if (group && skill == "help") {
|
60
|
-
await context.reply("Check your DM's");
|
61
|
-
await context.sendTo(DM_HELP_MESSAGE, [sender.address]);
|
62
|
-
return;
|
63
|
-
} else if (skill === "help") {
|
64
|
-
await context.send(DM_HELP_MESSAGE);
|
65
|
-
} else if (skill === "create") {
|
66
|
-
const walletExist = await walletService.getWallet(sender.address);
|
67
|
-
if (walletExist) {
|
68
|
-
await context.reply("You already have an agent wallet.");
|
69
|
-
return;
|
70
|
-
}
|
71
|
-
await walletService.createWallet(sender.address);
|
72
|
-
} else if (skill === "balance") {
|
73
|
-
context.sendTo(
|
74
|
-
`Your agent wallet for address is ${sender.address}\nBalance: $${await walletService.checkBalance(sender.address)}`,
|
75
|
-
[sender.address],
|
76
|
-
);
|
77
|
-
} else if (skill === "fund") {
|
78
|
-
const balance = await walletService.checkBalance(sender.address);
|
79
|
-
if (balance === 10) {
|
80
|
-
await context.reply("You have maxed out your funds.");
|
81
|
-
return;
|
82
|
-
} else if (amount) {
|
83
|
-
if (amount + balance <= 10) {
|
84
|
-
return walletService.requestFunds(Number(amount));
|
85
|
-
} else {
|
86
|
-
await context.send("Wrong amount. Max 10 USDC.");
|
87
|
-
return;
|
88
|
-
}
|
89
|
-
}
|
90
|
-
await context.reply(
|
91
|
-
`You have $${balance} in your account. You can fund up to $${10 - balance} more.`,
|
92
|
-
);
|
93
|
-
const options = Array.from({ length: Math.floor(10 - balance) }, (_, i) =>
|
94
|
-
(i + 1).toString(),
|
95
|
-
);
|
96
|
-
const response = await context.awaitResponse(
|
97
|
-
`Please specify the amount of USDC to prefund (1 to ${10 - balance}):`,
|
98
|
-
options,
|
99
|
-
);
|
100
|
-
return walletService.requestFunds(Number(response));
|
101
|
-
} else if (skill === "withdraw") {
|
102
|
-
const balance = await walletService.checkBalance(sender.address);
|
103
|
-
if (balance === 0) {
|
104
|
-
await context.reply("You have no funds to withdraw.");
|
105
|
-
return;
|
106
|
-
}
|
107
|
-
const options = Array.from({ length: Math.floor(balance) }, (_, i) =>
|
108
|
-
(i + 1).toString(),
|
109
|
-
);
|
110
|
-
const response = await context.awaitResponse(
|
111
|
-
`Please specify the amount of USDC to withdraw (1 to ${balance}):`,
|
112
|
-
options,
|
113
|
-
);
|
114
|
-
await walletService.withdrawFunds(Number(response));
|
115
|
-
}
|
116
|
-
}
|
package/templates.json
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
[
|
2
|
-
{
|
3
|
-
"href": "/templates/ens",
|
4
|
-
"title": "ENS Agent",
|
5
|
-
"description": "A template for working with ENS domains.",
|
6
|
-
"icon": "🔗",
|
7
|
-
"author": "humanagent"
|
8
|
-
},
|
9
|
-
{
|
10
|
-
"href": "/templates/simple",
|
11
|
-
"title": "Simple Template",
|
12
|
-
"description": "A simple template without skills.",
|
13
|
-
"icon": "🤖",
|
14
|
-
"author": "humanagent"
|
15
|
-
},
|
16
|
-
{
|
17
|
-
"href": "/templates/coinbase-agent",
|
18
|
-
"title": "Coinbase Agent",
|
19
|
-
"description": "A template for a Coinbase features.",
|
20
|
-
"icon": "💰",
|
21
|
-
"author": "humanagent"
|
22
|
-
},
|
23
|
-
{
|
24
|
-
"href": "/templates/hackathon-store",
|
25
|
-
"title": "Hackathon Store",
|
26
|
-
"description": "All the goodies needed in a hackathon.",
|
27
|
-
"icon": "🏪",
|
28
|
-
"author": "humanagent"
|
29
|
-
},
|
30
|
-
{
|
31
|
-
"href": "/templates/faucet",
|
32
|
-
"title": "Faucet Agent",
|
33
|
-
"description": "A template for requesting testnet funds.",
|
34
|
-
"icon": "💧",
|
35
|
-
"author": "humanagent"
|
36
|
-
},
|
37
|
-
{
|
38
|
-
"href": "/templates/gated-group",
|
39
|
-
"title": "Gated Group",
|
40
|
-
"description": "A template for a gated group.",
|
41
|
-
"icon": "🔒",
|
42
|
-
"author": "humanagent"
|
43
|
-
},
|
44
|
-
{
|
45
|
-
"href": "/templates/gm",
|
46
|
-
"title": "GM Bot",
|
47
|
-
"description": "A template for a GM bot.",
|
48
|
-
"icon": "👑",
|
49
|
-
"author": "humanagent"
|
50
|
-
},
|
51
|
-
{
|
52
|
-
"href": "/templates/toss",
|
53
|
-
"title": "Toss",
|
54
|
-
"description": "A friendly game for groups.",
|
55
|
-
"icon": "🪙",
|
56
|
-
"author": "humanagent"
|
57
|
-
}
|
58
|
-
]
|