@xmtp/node-bindings 1.3.0-dev.30b3d7c → 1.3.0-dev.438f403
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/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 +51 -24
- package/dist/index.js +5 -2
- package/dist/version.json +3 -3
- package/package.json +10 -7
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -8,12 +8,17 @@ export declare class Client {
|
|
|
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
10
|
canMessage(accountIdentities: Array<Identifier>): Promise<Record<string, boolean>>
|
|
11
|
-
registerIdentity(): Promise<void>
|
|
11
|
+
registerIdentity(signatureRequest: SignatureRequestHandle): Promise<void>
|
|
12
12
|
conversations(): Conversations
|
|
13
13
|
sendSyncRequest(): Promise<void>
|
|
14
14
|
findInboxIdByIdentifier(identifier: Identifier): Promise<string | null>
|
|
15
15
|
addressesFromInboxId(refreshFromNetwork: boolean, inboxIds: Array<string>): Promise<Array<InboxState>>
|
|
16
16
|
syncPreferences(): Promise<number>
|
|
17
|
+
apiStatistics(): ApiStats
|
|
18
|
+
apiIdentityStatistics(): IdentityStats
|
|
19
|
+
apiAggregateStatistics(): string
|
|
20
|
+
clearAllStatistics(): void
|
|
21
|
+
uploadDebugArchive(serverUrl: string): Promise<string>
|
|
17
22
|
setConsentStates(records: Array<Consent>): Promise<void>
|
|
18
23
|
getConsentState(entityType: ConsentEntityType, entity: string): Promise<ConsentState>
|
|
19
24
|
/**
|
|
@@ -30,16 +35,13 @@ export declare class Client {
|
|
|
30
35
|
* Returns a JavaScript Object mapping installation ID strings to KeyPackageStatus objects.
|
|
31
36
|
*/
|
|
32
37
|
getKeyPackageStatusesForInstallationIds(installationIds: Array<string>): Promise<Record<string, KeyPackageStatus>>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
addPasskeySignature(signatureType: SignatureRequestType, signature: PasskeySignature): Promise<void>
|
|
41
|
-
addScwSignature(signatureType: SignatureRequestType, signatureBytes: Uint8Array, chainId: bigint, blockNumber?: bigint | undefined | null): Promise<void>
|
|
42
|
-
applySignatureRequests(): Promise<void>
|
|
38
|
+
createInboxSignatureRequest(): Promise<SignatureRequestHandle | null>
|
|
39
|
+
addIdentifierSignatureRequest(newIdentifier: Identifier): Promise<SignatureRequestHandle>
|
|
40
|
+
revokeIdentifierSignatureRequest(identifier: Identifier): Promise<SignatureRequestHandle>
|
|
41
|
+
revokeAllOtherInstallationsSignatureRequest(): Promise<SignatureRequestHandle>
|
|
42
|
+
revokeInstallationsSignatureRequest(installationIds: Array<Uint8Array>): Promise<SignatureRequestHandle>
|
|
43
|
+
changeRecoveryIdentifierSignatureRequest(newRecoveryIdentifier: Identifier): Promise<SignatureRequestHandle>
|
|
44
|
+
applySignatureRequest(signatureRequest: SignatureRequestHandle): Promise<void>
|
|
43
45
|
signWithInstallationKey(signatureText: string): Uint8Array
|
|
44
46
|
verifySignedWithInstallationKey(signatureText: string, signatureBytes: Uint8Array): void
|
|
45
47
|
}
|
|
@@ -73,7 +75,7 @@ export declare class Conversation {
|
|
|
73
75
|
groupImageUrlSquare(): string
|
|
74
76
|
updateGroupDescription(groupDescription: string): Promise<void>
|
|
75
77
|
groupDescription(): string
|
|
76
|
-
stream(callback: (err: null | Error, result: Message | undefined) => void): StreamCloser
|
|
78
|
+
stream(callback: (err: null | Error, result: Message | undefined) => void, onClose: () => void): StreamCloser
|
|
77
79
|
createdAtNs(): number
|
|
78
80
|
isActive(): boolean
|
|
79
81
|
pausedForVersion(): string | null
|
|
@@ -111,10 +113,10 @@ export declare class Conversations {
|
|
|
111
113
|
syncAllConversations(consentStates?: Array<ConsentState> | undefined | null): Promise<bigint>
|
|
112
114
|
list(opts?: ListConversationsOptions | undefined | null): Array<ConversationListItem>
|
|
113
115
|
getHmacKeys(): Record<string, Array<HmacKey>>
|
|
114
|
-
stream(callback: (err: Error | null, result: Conversation | undefined) => void, conversationType?: ConversationType): StreamCloser
|
|
115
|
-
streamAllMessages(callback: (err: null | Error, result: Message | undefined) => void, conversationType?: ConversationType, consentStates?: ConsentState[]): StreamCloser
|
|
116
|
-
streamConsent(callback: (err: null | Error, result: Consent[] | undefined) => void): StreamCloser
|
|
117
|
-
streamPreferences(callback: (err: null | Error, result: any[] | undefined) => void): StreamCloser
|
|
116
|
+
stream(callback: (err: Error | null, result: Conversation | undefined) => void, onClose: () => void, conversationType?: ConversationType): StreamCloser
|
|
117
|
+
streamAllMessages(callback: (err: null | Error, result: Message | undefined) => void, onClose: () => void, conversationType?: ConversationType, consentStates?: ConsentState[]): StreamCloser
|
|
118
|
+
streamConsent(callback: (err: null | Error, result: Consent[] | undefined) => void, onClose: () => void): StreamCloser
|
|
119
|
+
streamPreferences(callback: (err: null | Error, result: any[] | undefined) => void, onClose: () => void): StreamCloser
|
|
118
120
|
}
|
|
119
121
|
|
|
120
122
|
export declare class GroupMember {
|
|
@@ -135,6 +137,13 @@ export declare class GroupPermissions {
|
|
|
135
137
|
policySet(): PermissionPolicySet
|
|
136
138
|
}
|
|
137
139
|
|
|
140
|
+
export declare class SignatureRequestHandle {
|
|
141
|
+
signatureText(): Promise<string>
|
|
142
|
+
addEcdsaSignature(signatureBytes: Uint8Array): Promise<void>
|
|
143
|
+
addPasskeySignature(signature: PasskeySignature): Promise<void>
|
|
144
|
+
addScwSignature(accountIdentifier: Identifier, signatureBytes: Uint8Array, chainId: bigint, blockNumber?: bigint | undefined | null): Promise<void>
|
|
145
|
+
}
|
|
146
|
+
|
|
138
147
|
export declare class StreamCloser {
|
|
139
148
|
/**
|
|
140
149
|
* Signal the stream to end
|
|
@@ -152,6 +161,19 @@ export declare class StreamCloser {
|
|
|
152
161
|
isClosed(): boolean
|
|
153
162
|
}
|
|
154
163
|
|
|
164
|
+
export interface ApiStats {
|
|
165
|
+
uploadKeyPackage: bigint
|
|
166
|
+
fetchKeyPackage: bigint
|
|
167
|
+
sendGroupMessages: bigint
|
|
168
|
+
sendWelcomeMessages: bigint
|
|
169
|
+
queryGroupMessages: bigint
|
|
170
|
+
queryWelcomeMessages: bigint
|
|
171
|
+
subscribeMessages: bigint
|
|
172
|
+
subscribeWelcomes: bigint
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export declare export declare function applySignatureRequest(host: string, signatureRequest: SignatureRequestHandle): Promise<void>
|
|
176
|
+
|
|
155
177
|
export interface Consent {
|
|
156
178
|
entityType: ConsentEntityType
|
|
157
179
|
state: ConsentState
|
|
@@ -193,6 +215,8 @@ export interface ConversationDebugInfo {
|
|
|
193
215
|
epoch: bigint
|
|
194
216
|
maybeForked: boolean
|
|
195
217
|
forkDetails: string
|
|
218
|
+
localCommitLog: string
|
|
219
|
+
cursor: number
|
|
196
220
|
}
|
|
197
221
|
|
|
198
222
|
export declare const enum ConversationType {
|
|
@@ -208,7 +232,7 @@ export declare const enum ConversationType {
|
|
|
208
232
|
* It can be one of: `debug`, `info`, `warn`, `error` or 'off'.
|
|
209
233
|
* By default, logging is disabled.
|
|
210
234
|
*/
|
|
211
|
-
export declare export declare function createClient(host: string, isSecure: boolean, dbPath: string | undefined | null, inboxId: string, accountIdentifier: Identifier, encryptionKey?: Uint8Array | undefined | null, deviceSyncServerUrl?: string | undefined | null, deviceSyncWorkerMode?: SyncWorkerMode | undefined | null, logOptions?: LogOptions | undefined | null): Promise<Client>
|
|
235
|
+
export declare export declare function createClient(host: string, isSecure: boolean, dbPath: string | undefined | null, inboxId: string, accountIdentifier: Identifier, encryptionKey?: Uint8Array | undefined | null, deviceSyncServerUrl?: string | undefined | null, deviceSyncWorkerMode?: SyncWorkerMode | undefined | null, logOptions?: LogOptions | undefined | null, allowOffline?: boolean | undefined | null, disableEvents?: boolean | undefined | null): Promise<Client>
|
|
212
236
|
|
|
213
237
|
export interface CreateDmOptions {
|
|
214
238
|
messageDisappearingSettings?: MessageDisappearingSettings
|
|
@@ -282,6 +306,13 @@ export declare const enum IdentifierKind {
|
|
|
282
306
|
Passkey = 1
|
|
283
307
|
}
|
|
284
308
|
|
|
309
|
+
export interface IdentityStats {
|
|
310
|
+
publishIdentityUpdate: bigint
|
|
311
|
+
getIdentityUpdatesV2: bigint
|
|
312
|
+
getInboxIds: bigint
|
|
313
|
+
verifySmartContractWalletSignature: bigint
|
|
314
|
+
}
|
|
315
|
+
|
|
285
316
|
export interface InboxState {
|
|
286
317
|
inboxId: string
|
|
287
318
|
recoveryIdentifier: Identifier
|
|
@@ -289,6 +320,8 @@ export interface InboxState {
|
|
|
289
320
|
identifiers: Array<Identifier>
|
|
290
321
|
}
|
|
291
322
|
|
|
323
|
+
export declare export declare function inboxStateFromInboxIds(host: string, inboxIds: Array<string>): Promise<Array<InboxState>>
|
|
324
|
+
|
|
292
325
|
export interface Installation {
|
|
293
326
|
bytes: Uint8Array
|
|
294
327
|
clientTimestampNs?: bigint
|
|
@@ -451,13 +484,7 @@ export interface RemoteAttachmentInfo {
|
|
|
451
484
|
filename?: string
|
|
452
485
|
}
|
|
453
486
|
|
|
454
|
-
export declare
|
|
455
|
-
AddWallet = 0,
|
|
456
|
-
CreateInbox = 1,
|
|
457
|
-
RevokeWallet = 2,
|
|
458
|
-
RevokeInstallations = 3,
|
|
459
|
-
ChangeRecoveryIdentifier = 4
|
|
460
|
-
}
|
|
487
|
+
export declare export declare function revokeInstallationsSignatureRequest(host: string, recoveryIdentifier: Identifier, inboxId: string, installationIds: Array<Uint8Array>): Promise<SignatureRequestHandle>
|
|
461
488
|
|
|
462
489
|
export declare const enum SortDirection {
|
|
463
490
|
Ascending = 0,
|
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, getInboxIdForIdentifier, GroupMembershipState, GroupMessageKind, GroupPermissionsOptions, IdentifierKind, isAddressAuthorized, isInstallationAuthorized, LogLevel, MetadataField, PermissionLevel, PermissionPolicy, PermissionUpdateType, ReactionAction, ReactionSchema,
|
|
368
|
+
const { Client, Conversation, ConversationListItem, Conversations, GroupMember, GroupMetadata, GroupPermissions, SignatureRequestHandle, StreamCloser, applySignatureRequest, ConsentEntityType, ConsentState, ContentType, ConversationType, createClient, decodeMultiRemoteAttachment, decodeReaction, DeliveryStatus, encodeMultiRemoteAttachment, encodeReaction, generateInboxId, getInboxIdForIdentifier, GroupMembershipState, GroupMessageKind, GroupPermissionsOptions, IdentifierKind, inboxStateFromInboxIds, isAddressAuthorized, isInstallationAuthorized, LogLevel, MetadataField, PermissionLevel, PermissionPolicy, PermissionUpdateType, ReactionAction, ReactionSchema, revokeInstallationsSignatureRequest, SortDirection, SyncWorkerMode, verifySignedWithPublicKey } = nativeBinding
|
|
369
369
|
export { Client }
|
|
370
370
|
export { Conversation }
|
|
371
371
|
export { ConversationListItem }
|
|
@@ -373,7 +373,9 @@ export { Conversations }
|
|
|
373
373
|
export { GroupMember }
|
|
374
374
|
export { GroupMetadata }
|
|
375
375
|
export { GroupPermissions }
|
|
376
|
+
export { SignatureRequestHandle }
|
|
376
377
|
export { StreamCloser }
|
|
378
|
+
export { applySignatureRequest }
|
|
377
379
|
export { ConsentEntityType }
|
|
378
380
|
export { ConsentState }
|
|
379
381
|
export { ContentType }
|
|
@@ -390,6 +392,7 @@ export { GroupMembershipState }
|
|
|
390
392
|
export { GroupMessageKind }
|
|
391
393
|
export { GroupPermissionsOptions }
|
|
392
394
|
export { IdentifierKind }
|
|
395
|
+
export { inboxStateFromInboxIds }
|
|
393
396
|
export { isAddressAuthorized }
|
|
394
397
|
export { isInstallationAuthorized }
|
|
395
398
|
export { LogLevel }
|
|
@@ -399,7 +402,7 @@ export { PermissionPolicy }
|
|
|
399
402
|
export { PermissionUpdateType }
|
|
400
403
|
export { ReactionAction }
|
|
401
404
|
export { ReactionSchema }
|
|
402
|
-
export {
|
|
405
|
+
export { revokeInstallationsSignatureRequest }
|
|
403
406
|
export { SortDirection }
|
|
404
407
|
export { SyncWorkerMode }
|
|
405
408
|
export { verifySignedWithPublicKey }
|
package/dist/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmtp/node-bindings",
|
|
3
|
-
"version": "1.3.0-dev.
|
|
3
|
+
"version": "1.3.0-dev.438f403",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://git@github.com/xmtp/libxmtp.git",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"build:debug": "napi build --platform --esm",
|
|
28
28
|
"build:finish": "mkdir dist && mv index.js dist && mv index.d.ts dist && mv *.node dist",
|
|
29
29
|
"build:release": "napi build --platform --release --esm",
|
|
30
|
+
"build:test": "napi build --platform --esm --features test-utils",
|
|
30
31
|
"clean": "yarn build:clean && yarn test:clean",
|
|
31
32
|
"format": "prettier -w .",
|
|
32
33
|
"format:check": "prettier -c .",
|
|
@@ -34,24 +35,26 @@
|
|
|
34
35
|
"lint": "yarn lint:clippy && yarn lint:fmt",
|
|
35
36
|
"lint:clippy": "cargo clippy --locked --all-features --all-targets --no-deps -- -D warnings",
|
|
36
37
|
"lint:fmt": "cargo fmt --check",
|
|
37
|
-
"test": "vitest run",
|
|
38
|
+
"test": "yarn build:clean && yarn build:test && yarn build:finish && vitest run",
|
|
38
39
|
"test:clean": "rm -rf test/*.db3*"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
42
|
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
|
|
42
43
|
"@napi-rs/cli": "^3.0.0-alpha.64",
|
|
43
|
-
"@types/node": "^
|
|
44
|
+
"@types/node": "^24.0.1",
|
|
44
45
|
"@types/uuid": "^10.0.0",
|
|
46
|
+
"@xmtp/content-type-group-updated": "^2.0.2",
|
|
47
|
+
"@xmtp/content-type-text": "^2.0.2",
|
|
45
48
|
"fast-glob": "^3.3.3",
|
|
46
|
-
"prettier": "^3.
|
|
49
|
+
"prettier": "^3.6.0",
|
|
47
50
|
"prettier-plugin-packagejson": "^2.5.8",
|
|
48
|
-
"tsx": "^4.
|
|
51
|
+
"tsx": "^4.20.3",
|
|
49
52
|
"typescript": "^5.8.2",
|
|
50
53
|
"uuid": "^11.1.0",
|
|
51
|
-
"viem": "^2.
|
|
54
|
+
"viem": "^2.31.0",
|
|
52
55
|
"vite": "^6.3.2",
|
|
53
56
|
"vite-tsconfig-paths": "^5.1.4",
|
|
54
|
-
"vitest": "^3.
|
|
57
|
+
"vitest": "^3.2.2",
|
|
55
58
|
"zx": "^8.5.0"
|
|
56
59
|
},
|
|
57
60
|
"packageManager": "yarn@4.6.0",
|