create-message-kit 1.2.35 → 1.3.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
CHANGED
@@ -1,18 +1,3 @@
|
|
1
|
-
#
|
1
|
+
# MessageKit
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
To install it run the following command:
|
6
|
-
|
7
|
-
```bash
|
8
|
-
bun create message-kit
|
9
|
-
```
|
10
|
-
|
11
|
-
```bash
|
12
|
-
npx create-message-kit@latest
|
13
|
-
```
|
14
|
-
|
15
|
-
```bash
|
16
|
-
yarn create message-kit
|
17
|
-
// use yarn create message-kit@latest in yarn > v2
|
18
|
-
```
|
3
|
+
See [MessageKit](https://message-kit.org/) quickstart
|
package/package.json
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Context,
|
1
|
+
import { Context, baselinks, Skill } from "@xmtp/message-kit";
|
2
2
|
|
3
3
|
export const pay: Skill[] = [
|
4
4
|
{
|
@@ -44,17 +44,17 @@ export async function handler(context: Context) {
|
|
44
44
|
message: {
|
45
45
|
content: {
|
46
46
|
skill,
|
47
|
-
params: { amount,
|
47
|
+
params: { amount, username },
|
48
48
|
},
|
49
49
|
},
|
50
50
|
} = context;
|
51
51
|
let receiverAddress = username?.address;
|
52
52
|
if (skill === "tip") {
|
53
53
|
let tipAmount = 1;
|
54
|
-
const url =
|
55
|
-
await context.
|
54
|
+
const url = baselinks.paymentLink(receiverAddress, tipAmount);
|
55
|
+
await context.send({ message: url, originalMessage: context.message });
|
56
56
|
} else if (skill === "pay") {
|
57
|
-
const url =
|
58
|
-
await context.
|
57
|
+
const url = baselinks.paymentLink(receiverAddress, amount);
|
58
|
+
await context.send({ message: url, originalMessage: context.message });
|
59
59
|
}
|
60
60
|
}
|