@xmtp/node-sdk 0.0.38 → 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.d.ts CHANGED
@@ -192,7 +192,7 @@ declare class Client {
192
192
  get accountAddress(): string;
193
193
  get inboxId(): string;
194
194
  get installationId(): string;
195
- get installationIdBytes(): Uint8Array;
195
+ get installationIdBytes(): Uint8Array<ArrayBufferLike>;
196
196
  get isRegistered(): boolean;
197
197
  register(): Promise<void>;
198
198
  addAccount(newAccountSigner: Signer): Promise<void>;
@@ -212,7 +212,7 @@ declare class Client {
212
212
  inboxStateFromInboxIds(inboxIds: string[], refreshFromNetwork?: boolean): Promise<_xmtp_node_bindings.InboxState[]>;
213
213
  setConsentStates(consentStates: Consent[]): Promise<void>;
214
214
  getConsentState(entityType: ConsentEntityType, entity: string): Promise<_xmtp_node_bindings.ConsentState>;
215
- signWithInstallationKey(signatureText: string): Uint8Array;
215
+ signWithInstallationKey(signatureText: string): Uint8Array<ArrayBufferLike>;
216
216
  verifySignedWithInstallationKey(signatureText: string, signatureBytes: Uint8Array): boolean;
217
217
  static verifySignedWithPublicKey(signatureText: string, signatureBytes: Uint8Array, publicKey: Uint8Array): boolean;
218
218
  static isAddressAuthorized(inboxId: string, address: string, options?: NetworkOptions): Promise<boolean>;
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 ?? ApiUrls[options?.env ?? "dev"];
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 ?? "dev"}-${accountAddress}.db3`);
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 ?? HistorySyncUrls[options?.env ?? "dev"];
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 ?? "dev"];
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.38",
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"
@@ -51,27 +53,28 @@
51
53
  "@xmtp/content-type-group-updated": "^2.0.0",
52
54
  "@xmtp/content-type-primitives": "^2.0.0",
53
55
  "@xmtp/content-type-text": "^2.0.0",
54
- "@xmtp/node-bindings": "^0.0.33",
56
+ "@xmtp/node-bindings": "^0.0.34",
55
57
  "@xmtp/proto": "^3.72.3"
56
58
  },
57
59
  "devDependencies": {
58
60
  "@rollup/plugin-json": "^6.1.0",
59
- "@rollup/plugin-typescript": "^12.1.1",
60
- "@types/node": "^20.17.6",
61
+ "@rollup/plugin-typescript": "^12.1.2",
62
+ "@types/node": "^22.10.6",
61
63
  "@vitest/coverage-v8": "^2.1.3",
62
64
  "@xmtp/xmtp-js": "workspace:^",
63
- "fast-glob": "^3.3.2",
65
+ "fast-glob": "^3.3.3",
64
66
  "rimraf": "^6.0.1",
65
- "rollup": "^4.27.3",
67
+ "rollup": "^4.30.1",
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",
69
- "typescript": "^5.6.3",
71
+ "tsx": "^4.19.2",
72
+ "typescript": "^5.7.3",
70
73
  "uint8array-extras": "^1.4.0",
71
74
  "uuid": "^11.0.3",
72
75
  "viem": "^2.13.6",
73
- "vite": "^5.4.11",
74
- "vite-tsconfig-paths": "^5.1.2",
76
+ "vite": "^6.0.7",
77
+ "vite-tsconfig-paths": "^5.1.4",
75
78
  "vitest": "^2.1.3"
76
79
  },
77
80
  "packageManager": "yarn@4.5.0",