@xmtp/node-bindings 0.0.41 → 1.0.0-rc2
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 +2 -2
- package/dist/bindings_node.darwin-arm64.node +0 -0
- package/dist/bindings_node.darwin-x64.node +0 -0
- package/dist/bindings_node.linux-arm64-gnu.node +0 -0
- package/dist/bindings_node.linux-arm64-musl.node +0 -0
- package/dist/bindings_node.linux-x64-gnu.node +0 -0
- package/dist/bindings_node.linux-x64-musl.node +0 -0
- package/dist/bindings_node.win32-x64-msvc.node +0 -0
- package/dist/index.d.ts +37 -18
- package/dist/index.js +3 -2
- package/dist/version.json +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Node bindings for the libXMTP rust library
|
|
2
2
|
|
|
3
|
-
> [!
|
|
4
|
-
> These bindings are
|
|
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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
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
|
-
|
|
4
|
+
accountIdentifier: Identifier
|
|
5
5
|
inboxId(): string
|
|
6
6
|
isRegistered(): boolean
|
|
7
7
|
installationId(): string
|
|
8
8
|
installationIdBytes(): Uint8Array
|
|
9
|
-
|
|
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
|
-
|
|
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
|
-
|
|
28
|
-
|
|
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
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
-
|
|
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,
|
|
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(
|
|
238
|
+
export declare export declare function generateInboxId(accountIdent: Identifier): string
|
|
237
239
|
|
|
238
|
-
export declare export declare function
|
|
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,21 @@ export interface HmacKey {
|
|
|
259
261
|
epoch: bigint
|
|
260
262
|
}
|
|
261
263
|
|
|
264
|
+
export interface Identifier {
|
|
265
|
+
identifier: string
|
|
266
|
+
identifierKind: IdentifierKind
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export declare const enum IdentifierKind {
|
|
270
|
+
Ethereum = 0,
|
|
271
|
+
Passkey = 1
|
|
272
|
+
}
|
|
273
|
+
|
|
262
274
|
export interface InboxState {
|
|
263
275
|
inboxId: string
|
|
264
|
-
|
|
276
|
+
recoveryIdentifier: Identifier
|
|
265
277
|
installations: Array<Installation>
|
|
266
|
-
|
|
278
|
+
identifiers: Array<Identifier>
|
|
267
279
|
}
|
|
268
280
|
|
|
269
281
|
export interface Installation {
|
|
@@ -343,6 +355,13 @@ export interface MultiRemoteAttachment {
|
|
|
343
355
|
attachments: Array<RemoteAttachmentInfo>
|
|
344
356
|
}
|
|
345
357
|
|
|
358
|
+
export interface PasskeySignature {
|
|
359
|
+
publicKey: Array<number>
|
|
360
|
+
signature: Array<number>
|
|
361
|
+
authenticatorData: Array<number>
|
|
362
|
+
clientDataJson: Array<number>
|
|
363
|
+
}
|
|
364
|
+
|
|
346
365
|
export declare const enum PermissionLevel {
|
|
347
366
|
Member = 0,
|
|
348
367
|
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,
|
|
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 {
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmtp/node-bindings",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0-rc2",
|
|
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.
|
|
55
|
+
"zx": "^8.4.0"
|
|
56
56
|
},
|
|
57
57
|
"packageManager": "yarn@4.6.0",
|
|
58
58
|
"engines": {
|