@xmtp/node-sdk 0.0.39 → 0.0.40
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/dist/index.js +5 -5
- package/package.json +4 -1
package/dist/index.js
CHANGED
|
@@ -468,17 +468,17 @@ class Client {
|
|
|
468
468
|
}
|
|
469
469
|
static async create(signer, encryptionKey, options) {
|
|
470
470
|
const accountAddress = await signer.getAddress();
|
|
471
|
-
const host = options?.apiUrl
|
|
471
|
+
const host = options?.apiUrl || ApiUrls[options?.env || "dev"];
|
|
472
472
|
const isSecure = host.startsWith("https");
|
|
473
|
-
const dbPath = options?.dbPath
|
|
474
|
-
join(process.cwd(), `xmtp-${options?.env
|
|
473
|
+
const dbPath = options?.dbPath ||
|
|
474
|
+
join(process.cwd(), `xmtp-${options?.env || "dev"}-${accountAddress}.db3`);
|
|
475
475
|
const inboxId = (await getInboxIdForAddress$1(host, isSecure, accountAddress)) ||
|
|
476
476
|
generateInboxId$1(accountAddress);
|
|
477
477
|
const logOptions = {
|
|
478
478
|
structured: options?.structuredLogging ?? false,
|
|
479
479
|
level: options?.loggingLevel ?? "off" /* LogLevel.off */,
|
|
480
480
|
};
|
|
481
|
-
const historySyncUrl = options?.historySyncUrl
|
|
481
|
+
const historySyncUrl = options?.historySyncUrl || HistorySyncUrls[options?.env || "dev"];
|
|
482
482
|
const client = new Client(await createClient(host, isSecure, dbPath, inboxId, accountAddress, encryptionKey, historySyncUrl, logOptions), signer, [new GroupUpdatedCodec(), new TextCodec(), ...(options?.codecs ?? [])]);
|
|
483
483
|
if (!options?.disableAutoRegister) {
|
|
484
484
|
await client.register();
|
|
@@ -604,7 +604,7 @@ class Client {
|
|
|
604
604
|
}
|
|
605
605
|
static async canMessage(accountAddresses, env) {
|
|
606
606
|
const accountAddress = "0x0000000000000000000000000000000000000000";
|
|
607
|
-
const host = ApiUrls[env
|
|
607
|
+
const host = ApiUrls[env || "dev"];
|
|
608
608
|
const isSecure = host.startsWith("https");
|
|
609
609
|
const inboxId = (await getInboxIdForAddress$1(host, isSecure, accountAddress)) ||
|
|
610
610
|
generateInboxId$1(accountAddress);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmtp/node-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.40",
|
|
4
4
|
"description": "XMTP Node client SDK for interacting with XMTP networks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xmtp",
|
|
@@ -43,6 +43,8 @@
|
|
|
43
43
|
"clean:dist": "rimraf dist",
|
|
44
44
|
"clean:tests": "rimraf test/*.db3* ||:",
|
|
45
45
|
"dev": "yarn build --watch",
|
|
46
|
+
"generate:accounts": "tsx scripts/accounts.ts",
|
|
47
|
+
"generate:groups": "tsx scripts/groups.ts",
|
|
46
48
|
"test": "vitest run",
|
|
47
49
|
"test:cov": "vitest run --coverage",
|
|
48
50
|
"typecheck": "tsc"
|
|
@@ -66,6 +68,7 @@
|
|
|
66
68
|
"rollup-plugin-dts": "^6.1.1",
|
|
67
69
|
"rollup-plugin-filesize": "^10.0.0",
|
|
68
70
|
"rollup-plugin-tsconfig-paths": "^1.5.2",
|
|
71
|
+
"tsx": "^4.19.2",
|
|
69
72
|
"typescript": "^5.7.3",
|
|
70
73
|
"uint8array-extras": "^1.4.0",
|
|
71
74
|
"uuid": "^11.0.3",
|