@xmtp/node-bindings 0.0.41 → 1.0.0-rc1

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,7 +1,7 @@
1
1
  # Node bindings for the libXMTP rust library
2
2
 
3
- > [!CAUTION]
4
- > These bindings are currently in alpha and under heavy development. The API is subject to change and it is not yet recommended for production use.
3
+ > [!INFO]
4
+ > These bindings are not intended to be used directly, use the associated SDK instead.
5
5
 
6
6
  ## Useful commands
7
7
 
Binary file
package/dist/index.d.ts CHANGED
@@ -1,17 +1,18 @@
1
1
  /* auto-generated by NAPI-RS */
2
2
  /* eslint-disable */
3
3
  export declare class Client {
4
- accountAddress: string
4
+ accountIdentifier: Identifier
5
5
  inboxId(): string
6
6
  isRegistered(): boolean
7
7
  installationId(): string
8
8
  installationIdBytes(): Uint8Array
9
- canMessage(accountAddresses: Array<string>): Promise<Record<string, boolean>>
9
+ /** The resulting vec will be the same length as the input and should be zipped for the results. */
10
+ canMessage(accountIdentities: Array<Identifier>): Promise<Record<string, boolean>>
10
11
  registerIdentity(): Promise<void>
11
12
  conversations(): Conversations
12
13
  sendHistorySyncRequest(): Promise<void>
13
14
  sendConsentSyncRequest(): Promise<void>
14
- findInboxIdByAddress(address: string): Promise<string | null>
15
+ findInboxIdByIdentifier(identifier: Identifier): Promise<string | null>
15
16
  addressesFromInboxId(refreshFromNetwork: boolean, inboxIds: Array<string>): Promise<Array<InboxState>>
16
17
  setConsentStates(records: Array<Consent>): Promise<void>
17
18
  getConsentState(entityType: ConsentEntityType, entity: string): Promise<ConsentState>
@@ -24,11 +25,12 @@ export declare class Client {
24
25
  inboxState(refreshFromNetwork: boolean): Promise<InboxState>
25
26
  getLatestInboxState(inboxId: string): Promise<InboxState>
26
27
  createInboxSignatureText(): Promise<string | null>
27
- addWalletSignatureText(newWalletAddress: string): Promise<string>
28
- revokeWalletSignatureText(walletAddress: string): Promise<string>
28
+ addIdentifierSignatureText(newIdentifier: Identifier): Promise<string>
29
+ revokeIdentifierSignatureText(identifier: Identifier): Promise<string>
29
30
  revokeAllOtherInstallationsSignatureText(): Promise<string>
30
31
  revokeInstallationsSignatureText(installationIds: Array<Uint8Array>): Promise<string>
31
- addSignature(signatureType: SignatureRequestType, signatureBytes: Uint8Array): Promise<void>
32
+ addEcdsaSignature(signatureType: SignatureRequestType, signatureBytes: Uint8Array): Promise<void>
33
+ addPasskeySignature(signatureType: SignatureRequestType, signature: PasskeySignature): Promise<void>
32
34
  addScwSignature(signatureType: SignatureRequestType, signatureBytes: Uint8Array, chainId: bigint, blockNumber?: bigint | undefined | null): Promise<void>
33
35
  applySignatureRequests(): Promise<void>
34
36
  signWithInstallationKey(signatureText: string): Uint8Array
@@ -49,14 +51,14 @@ export declare class Conversation {
49
51
  superAdminList(): Array<string>
50
52
  isAdmin(inboxId: string): boolean
51
53
  isSuperAdmin(inboxId: string): boolean
52
- addMembers(accountAddresses: Array<string>): Promise<void>
54
+ addMembers(accountIdentities: Array<Identifier>): Promise<void>
53
55
  addAdmin(inboxId: string): Promise<void>
54
56
  removeAdmin(inboxId: string): Promise<void>
55
57
  addSuperAdmin(inboxId: string): Promise<void>
56
58
  removeSuperAdmin(inboxId: string): Promise<void>
57
59
  groupPermissions(): GroupPermissions
58
60
  addMembersByInboxId(inboxIds: Array<string>): Promise<void>
59
- removeMembers(accountAddresses: Array<string>): Promise<void>
61
+ removeMembers(accountIdentities: Array<Identifier>): Promise<void>
60
62
  removeMembersByInboxId(inboxIds: Array<string>): Promise<void>
61
63
  updateGroupName(groupName: string): Promise<void>
62
64
  groupName(): string
@@ -67,6 +69,7 @@ export declare class Conversation {
67
69
  stream(callback: (err: null | Error, result: Message | undefined) => void): StreamCloser
68
70
  createdAtNs(): number
69
71
  isActive(): boolean
72
+ pausedForVersion(): string | null
70
73
  addedByInboxId(): string
71
74
  groupMetadata(): Promise<GroupMetadata>
72
75
  consentState(): ConsentState
@@ -86,9 +89,9 @@ export declare class ConversationListItem {
86
89
  }
87
90
 
88
91
  export declare class Conversations {
89
- createGroup(accountAddresses: Array<string>, options?: CreateGroupOptions | undefined | null): Promise<Conversation>
92
+ createGroup(accountIdentities: Array<Identifier>, options?: CreateGroupOptions | undefined | null): Promise<Conversation>
90
93
  createGroupByInboxId(inboxIds: Array<string>, options?: CreateGroupOptions | undefined | null): Promise<Conversation>
91
- createDm(accountAddress: string, options?: CreateDmOptions | undefined | null): Promise<Conversation>
94
+ createDm(accountIdentity: Identifier, options?: CreateDmOptions | undefined | null): Promise<Conversation>
92
95
  createDmByInboxId(inboxId: string, options?: CreateDmOptions | undefined | null): Promise<Conversation>
93
96
  findGroupById(groupId: string): Conversation
94
97
  findDmByTargetInboxId(targetInboxId: string): Conversation
@@ -112,7 +115,7 @@ export declare class Conversations {
112
115
 
113
116
  export declare class GroupMember {
114
117
  inboxId: string
115
- accountAddresses: Array<string>
118
+ accountIdentifiers: Array<Identifier>
116
119
  installationIds: Array<string>
117
120
  permissionLevel: PermissionLevel
118
121
  consentState: ConsentState
@@ -153,8 +156,7 @@ export interface Consent {
153
156
 
154
157
  export declare const enum ConsentEntityType {
155
158
  GroupId = 0,
156
- InboxId = 1,
157
- Address = 2
159
+ InboxId = 1
158
160
  }
159
161
 
160
162
  export declare const enum ConsentState {
@@ -196,7 +198,7 @@ export declare const enum ConversationType {
196
198
  * It can be one of: `debug`, `info`, `warn`, `error` or 'off'.
197
199
  * By default, logging is disabled.
198
200
  */
199
- export declare export declare function createClient(host: string, isSecure: boolean, dbPath: string | undefined | null, inboxId: string, accountAddress: string, encryptionKey?: Uint8Array | undefined | null, historySyncUrl?: string | undefined | null, logOptions?: LogOptions | undefined | null): Promise<Client>
201
+ export declare export declare function createClient(host: string, isSecure: boolean, dbPath: string | undefined | null, inboxId: string, accountIdentifier: Identifier, encryptionKey?: Uint8Array | undefined | null, historySyncUrl?: string | undefined | null, logOptions?: LogOptions | undefined | null): Promise<Client>
200
202
 
201
203
  export interface CreateDmOptions {
202
204
  messageDisappearingSettings?: MessageDisappearingSettings
@@ -233,9 +235,9 @@ export declare export declare function encodeMultiRemoteAttachment(multiRemoteAt
233
235
 
234
236
  export declare export declare function encodeReaction(reaction: Reaction): Uint8Array
235
237
 
236
- export declare export declare function generateInboxId(accountAddress: string): string
238
+ export declare export declare function generateInboxId(accountIdent: Identifier): string
237
239
 
238
- export declare export declare function getInboxIdForAddress(host: string, isSecure: boolean, accountAddress: string): Promise<string | null>
240
+ export declare export declare function getInboxIdForIdentifier(host: string, isSecure: boolean, identifier: Identifier): Promise<string | null>
239
241
 
240
242
  export declare const enum GroupMembershipState {
241
243
  Allowed = 0,
@@ -259,11 +261,22 @@ export interface HmacKey {
259
261
  epoch: bigint
260
262
  }
261
263
 
264
+ export interface Identifier {
265
+ identifier: string
266
+ identifierKind: IdentifierKind
267
+ relyingParty?: string
268
+ }
269
+
270
+ export declare const enum IdentifierKind {
271
+ Ethereum = 0,
272
+ Passkey = 1
273
+ }
274
+
262
275
  export interface InboxState {
263
276
  inboxId: string
264
- recoveryAddress: string
277
+ recoveryIdentifier: Identifier
265
278
  installations: Array<Installation>
266
- accountAddresses: Array<string>
279
+ identifiers: Array<Identifier>
267
280
  }
268
281
 
269
282
  export interface Installation {
@@ -343,6 +356,13 @@ export interface MultiRemoteAttachment {
343
356
  attachments: Array<RemoteAttachmentInfo>
344
357
  }
345
358
 
359
+ export interface PasskeySignature {
360
+ publicKey: Array<number>
361
+ signature: Array<number>
362
+ authenticatorData: Array<number>
363
+ clientDataJson: Array<number>
364
+ }
365
+
346
366
  export declare const enum PermissionLevel {
347
367
  Member = 0,
348
368
  Admin = 1,
package/dist/index.js CHANGED
@@ -365,7 +365,7 @@ if (!nativeBinding) {
365
365
  throw new Error(`Failed to load native binding`)
366
366
  }
367
367
 
368
- const { Client, Conversation, ConversationListItem, Conversations, GroupMember, GroupMetadata, GroupPermissions, StreamCloser, ConsentEntityType, ConsentState, ContentType, ConversationType, createClient, decodeMultiRemoteAttachment, decodeReaction, DeliveryStatus, encodeMultiRemoteAttachment, encodeReaction, generateInboxId, getInboxIdForAddress, GroupMembershipState, GroupMessageKind, GroupPermissionsOptions, isAddressAuthorized, isInstallationAuthorized, LogLevel, MetadataField, PermissionLevel, PermissionPolicy, PermissionUpdateType, ReactionAction, ReactionSchema, SignatureRequestType, SortDirection, verifySignedWithPublicKey } = nativeBinding
368
+ const { Client, Conversation, ConversationListItem, Conversations, GroupMember, GroupMetadata, GroupPermissions, StreamCloser, ConsentEntityType, ConsentState, ContentType, ConversationType, createClient, decodeMultiRemoteAttachment, decodeReaction, DeliveryStatus, encodeMultiRemoteAttachment, encodeReaction, generateInboxId, getInboxIdForIdentifier, GroupMembershipState, GroupMessageKind, GroupPermissionsOptions, IdentifierKind, isAddressAuthorized, isInstallationAuthorized, LogLevel, MetadataField, PermissionLevel, PermissionPolicy, PermissionUpdateType, ReactionAction, ReactionSchema, SignatureRequestType, SortDirection, verifySignedWithPublicKey } = nativeBinding
369
369
  export { Client }
370
370
  export { Conversation }
371
371
  export { ConversationListItem }
@@ -385,10 +385,11 @@ export { DeliveryStatus }
385
385
  export { encodeMultiRemoteAttachment }
386
386
  export { encodeReaction }
387
387
  export { generateInboxId }
388
- export { getInboxIdForAddress }
388
+ export { getInboxIdForIdentifier }
389
389
  export { GroupMembershipState }
390
390
  export { GroupMessageKind }
391
391
  export { GroupPermissionsOptions }
392
+ export { IdentifierKind }
392
393
  export { isAddressAuthorized }
393
394
  export { isInstallationAuthorized }
394
395
  export { LogLevel }
package/dist/version.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "branch": "main",
3
- "version": "6bd613d",
4
- "date": "2025-03-06 14:52:58 +0000"
3
+ "version": "070b27a",
4
+ "date": "2025-03-11 15:23:17 +0000"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmtp/node-bindings",
3
- "version": "0.0.41",
3
+ "version": "1.0.0-rc1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://git@github.com/xmtp/libxmtp.git",
@@ -52,7 +52,7 @@
52
52
  "vite": "^6.2.0",
53
53
  "vite-tsconfig-paths": "^5.1.4",
54
54
  "vitest": "^3.0.4",
55
- "zx": "^8.3.2"
55
+ "zx": "^8.4.0"
56
56
  },
57
57
  "packageManager": "yarn@4.6.0",
58
58
  "engines": {