create-message-kit 1.1.8-beta.1 → 1.1.8-beta.2
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -5,7 +5,7 @@ import { clearMemory } from "@xmtp/message-kit";
|
|
5
5
|
|
6
6
|
export const frameUrl = "https://ens.steer.fun/";
|
7
7
|
export const ensUrl = "https://app.ens.domains/";
|
8
|
-
export const
|
8
|
+
export const txpayUrl = "https://txpay.vercel.app";
|
9
9
|
|
10
10
|
export async function handleEns(
|
11
11
|
context: HandlerContext,
|
@@ -128,13 +128,12 @@ export async function handleEns(
|
|
128
128
|
};
|
129
129
|
}
|
130
130
|
const data = await getUserInfo(address);
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
console.log(txUrl);
|
131
|
+
|
132
|
+
let sendUrl = `${txpayUrl}/?&amount=1&token=USDC&receiver=${address}`;
|
133
|
+
|
135
134
|
return {
|
136
135
|
code: 200,
|
137
|
-
message:
|
136
|
+
message: sendUrl,
|
138
137
|
};
|
139
138
|
} else if (skill == "cool") {
|
140
139
|
const { domain } = params;
|
@@ -2,7 +2,7 @@ import { skills } from "./skills.js";
|
|
2
2
|
import { defaultPromptTemplate } from "@xmtp/message-kit";
|
3
3
|
|
4
4
|
export async function agent_prompt(senderAddress: string) {
|
5
|
-
let
|
5
|
+
let fineTuning = `
|
6
6
|
## Example responses:
|
7
7
|
|
8
8
|
1. Check if the user does not have a ENS domain
|
@@ -23,8 +23,8 @@ export async function agent_prompt(senderAddress: string) {
|
|
23
23
|
6. If the user wants to register a ENS domain, use the command "/register [domain]"
|
24
24
|
Looks like {ENS_DOMAIN} is available! Let me help you register it\n/register {ENS_DOMAIN}
|
25
25
|
|
26
|
-
7. If the user wants to directly to tip to the ENS domain owner, use directly the command "/tip [
|
27
|
-
Here is the url to send the tip:\n/tip
|
26
|
+
7. If the user wants to directly to tip to the ENS domain owner, use directly the command "/tip [address]", this will return a url but a button to send the tip
|
27
|
+
Here is the url to send the tip:\n/tip 0x...
|
28
28
|
|
29
29
|
8. If the user wants to get information about the ENS domain, use the command "/info [domain]"
|
30
30
|
Hello! I'll help you get info about {ENS_DOMAIN}.\n Give me a moment.\n/info {ENS_DOMAIN}
|
@@ -42,5 +42,5 @@ export async function agent_prompt(senderAddress: string) {
|
|
42
42
|
You should have said something like: "Looks like vitalik.eth is registered! What about these cool alternatives?\n/cool vitalik.eth
|
43
43
|
`;
|
44
44
|
|
45
|
-
return defaultPromptTemplate(
|
45
|
+
return defaultPromptTemplate(fineTuning, senderAddress, skills, "@ens");
|
46
46
|
}
|
@@ -6,7 +6,7 @@ export async function handler(context: HandlerContext) {
|
|
6
6
|
content: { skill, params },
|
7
7
|
},
|
8
8
|
} = context;
|
9
|
-
const
|
9
|
+
const txpayUrl = "https://txpay.vercel.app";
|
10
10
|
|
11
11
|
if (skill === "pay") {
|
12
12
|
const { amount: amountSend, token: tokenSend, username } = params;
|
@@ -23,7 +23,7 @@ export async function handler(context: HandlerContext) {
|
|
23
23
|
};
|
24
24
|
}
|
25
25
|
|
26
|
-
let sendUrl = `${
|
26
|
+
let sendUrl = `${txpayUrl}/?&amount=${amountSend}&token=${tokenSend}&receiver=${senderInfo.address}`;
|
27
27
|
await context.send(`${sendUrl}`);
|
28
28
|
}
|
29
29
|
}
|
@@ -9,7 +9,7 @@ export async function agent_prompt(senderAddress: string) {
|
|
9
9
|
Hey! Sure let's do that.\n/game wordle
|
10
10
|
|
11
11
|
2. When user wants to pay a specific token:
|
12
|
-
I'll help you pay 1 USDC to 0x123...\n/pay 1
|
12
|
+
I'll help you pay 1 USDC to 0x123...\n/pay 1 [token] 0x123456789...
|
13
13
|
*This will return a url to pay
|
14
14
|
|
15
15
|
3. If the user wants to pay a eth domain:
|
@@ -11,7 +11,7 @@ export const skills: SkillGroup[] = [
|
|
11
11
|
description: "Group agent for tipping and transactions.",
|
12
12
|
skills: [
|
13
13
|
{
|
14
|
-
skill: "/tip [
|
14
|
+
skill: "/tip [usernames] [amount] [token]",
|
15
15
|
triggers: ["/tip"],
|
16
16
|
examples: ["/tip @vitalik 10 usdc"],
|
17
17
|
description: "Tip users in a specified token.",
|