Skip to content

Commit b46fd64

Browse files
committed
update node
1 parent 16109f0 commit b46fd64

File tree

8 files changed

+16
-55
lines changed

8 files changed

+16
-55
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,6 @@ Interact with the XMTP network using [xmtp.chat](https://xmtp.chat), the officia
9797
Examples integrating XMTP with external libraries from the ecosystem
9898

9999
- [grok](/integrations/grok/): Integrate XMTP to the Grok API
100+
- [gaia](/integrations/gaia/): Integrate XMTP to the Gaia API
100101

101102
> See all the available [integrations](/integrations/).

examples/gated-group/index.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Client, type XmtpEnv } from "@xmtp/node-sdk";
1+
import { Client, type Group, type XmtpEnv } from "@xmtp/node-sdk";
22
import { Alchemy, Network } from "alchemy-sdk";
33
import { createSigner, getEncryptionKeyFromHex } from "@/helpers";
44

@@ -56,8 +56,8 @@ async function main() {
5656
`Received message: ${message.content as string} by ${message.senderInboxId}`,
5757
);
5858

59-
const conversation = client.conversations.getConversationById(
60-
message.conversationId,
59+
const conversation = client.conversations.getDmByInboxId(
60+
message.senderInboxId,
6161
);
6262

6363
if (!conversation) {
@@ -98,7 +98,7 @@ async function main() {
9898
await conversation.send("Please provide a group id");
9999
return;
100100
}
101-
const group = client.conversations.getConversationById(groupId);
101+
const group = await client.conversations.getConversationById(groupId);
102102
if (!group) {
103103
await conversation.send("Please provide a valid group id");
104104
return;
@@ -113,7 +113,7 @@ async function main() {
113113
console.log("User can't be added to the group");
114114
return;
115115
} else {
116-
await group.addMembers([walletAddress]);
116+
await (group as Group).addMembers([walletAddress]);
117117
await conversation.send(
118118
`User added to the group\n- Group ID: ${groupId}\n- Wallet Address: ${walletAddress}`,
119119
);

examples/gm/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ async function main() {
5252
);
5353

5454
/* Get the conversation by id */
55-
const conversation = client.conversations.getConversationById(
56-
message.conversationId,
55+
const conversation = client.conversations.getDmByInboxId(
56+
message.senderInboxId,
5757
);
5858

5959
if (!conversation) {

examples/gpt/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ async function main() {
6868
);
6969

7070
/* Get the conversation from the local db */
71-
const conversation = client.conversations.getConversationById(
72-
message.conversationId,
71+
const conversation = client.conversations.getDmByInboxId(
72+
message.senderInboxId,
7373
);
7474

7575
/* If the conversation is not found, skip the message */

integrations/grok/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ async function main() {
6363
);
6464

6565
/* Get the conversation from the local db */
66-
const conversation = client.conversations.getConversationById(
67-
message.conversationId,
66+
const conversation = client.conversations.getDmByInboxId(
67+
message.senderInboxId,
6868
);
6969

7070
/* If the conversation is not found, skip the message */

integrations/grok/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"gen:keys": "tsx ../../scripts/generateKeys.ts"
99
},
1010
"dependencies": {
11-
"@xmtp/node-sdk": "0.0.42",
11+
"@xmtp/node-sdk": "0.0.47",
1212
"tsx": "^4.19.2",
1313
"uint8arrays": "^5.1.0",
1414
"viem": "^2.22.17"

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"typecheck": "tsc"
2222
},
2323
"dependencies": {
24-
"@xmtp/node-sdk": "0.0.45",
24+
"@xmtp/node-sdk": "0.0.47",
2525
"alchemy-sdk": "^3.0.0",
2626
"openai": "latest",
2727
"tsx": "^4.19.2",

yarn.lock

+2-42
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ __metadata:
823823
version: 0.0.0-use.local
824824
resolution: "@integrations/gpt@workspace:integrations/grok"
825825
dependencies:
826-
"@xmtp/node-sdk": "npm:0.0.42"
826+
"@xmtp/node-sdk": "npm:0.0.47"
827827
tsx: "npm:^4.19.2"
828828
uint8arrays: "npm:^5.1.0"
829829
viem: "npm:^2.22.17"
@@ -1285,53 +1285,13 @@ __metadata:
12851285
languageName: node
12861286
linkType: hard
12871287

1288-
"@xmtp/node-bindings@npm:^0.0.37":
1289-
version: 0.0.37
1290-
resolution: "@xmtp/node-bindings@npm:0.0.37"
1291-
checksum: 10/06d12ee27f306a2ad767b75eedf3ceb0457cab3f574a545f44e487cbb39d07a3866c81277954a4937dc1f048a75c10b34b5ffa5de4fc43eaf9b1310a1c4dce8a
1292-
languageName: node
1293-
linkType: hard
1294-
1295-
"@xmtp/node-bindings@npm:^0.0.38":
1296-
version: 0.0.38
1297-
resolution: "@xmtp/node-bindings@npm:0.0.38"
1298-
checksum: 10/a9452a913cdda5cd050b91ed34358b8975524d1c5e6434db51b1d60f13a29069b531ee566811ab4ed339713ad0e041e83f24fc916684c968c322ba63f21319f3
1299-
languageName: node
1300-
linkType: hard
1301-
13021288
"@xmtp/node-bindings@npm:^0.0.41":
13031289
version: 0.0.41
13041290
resolution: "@xmtp/node-bindings@npm:0.0.41"
13051291
checksum: 10/809347d36de2b4f205fe46cc3869b1eab7595107fd14b0535457732745d14851121d1e7b0f22a0845deb32e48dfca29a7ad36a12bf9fc5c46b445a308a589c10
13061292
languageName: node
13071293
linkType: hard
13081294

1309-
"@xmtp/node-sdk@npm:0.0.42":
1310-
version: 0.0.42
1311-
resolution: "@xmtp/node-sdk@npm:0.0.42"
1312-
dependencies:
1313-
"@xmtp/content-type-group-updated": "npm:^2.0.0"
1314-
"@xmtp/content-type-primitives": "npm:^2.0.0"
1315-
"@xmtp/content-type-text": "npm:^2.0.0"
1316-
"@xmtp/node-bindings": "npm:^0.0.37"
1317-
"@xmtp/proto": "npm:^3.72.3"
1318-
checksum: 10/6163ede6d9cd7bc36b3a237d9a63a8be0041a11a1eefc6f56fefbf7cb8b8cc02c817c4696996a29a4f296d7545fd3172d8ebf8f85e1aeb23dcff917719dfcd10
1319-
languageName: node
1320-
linkType: hard
1321-
1322-
"@xmtp/node-sdk@npm:0.0.45":
1323-
version: 0.0.45
1324-
resolution: "@xmtp/node-sdk@npm:0.0.45"
1325-
dependencies:
1326-
"@xmtp/content-type-group-updated": "npm:^2.0.0"
1327-
"@xmtp/content-type-primitives": "npm:^2.0.0"
1328-
"@xmtp/content-type-text": "npm:^2.0.0"
1329-
"@xmtp/node-bindings": "npm:^0.0.38"
1330-
"@xmtp/proto": "npm:^3.72.3"
1331-
checksum: 10/70eb659105a585e651f9c9a538b98014476212a1023308b88012317a5c64e58b4a2d920891c131e763d449823cb8d1e126a4041ff73a803b5593702f43c08e8c
1332-
languageName: node
1333-
linkType: hard
1334-
13351295
"@xmtp/node-sdk@npm:0.0.47":
13361296
version: 0.0.47
13371297
resolution: "@xmtp/node-sdk@npm:0.0.47"
@@ -3882,7 +3842,7 @@ __metadata:
38823842
"@ianvs/prettier-plugin-sort-imports": "npm:^4.4.1"
38833843
"@types/eslint__js": "npm:^8.42.3"
38843844
"@types/node": "npm:^22.13.0"
3885-
"@xmtp/node-sdk": "npm:0.0.45"
3845+
"@xmtp/node-sdk": "npm:0.0.47"
38863846
alchemy-sdk: "npm:^3.0.0"
38873847
eslint: "npm:^9.19.0"
38883848
eslint-config-prettier: "npm:^10.0.1"

0 commit comments

Comments
 (0)