@xmtp/node-bindings 1.5.5 → 1.6.0-dev.3656d63
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 +165 -3
- package/dist/index.js +5 -1
- package/dist/version.json +3 -3
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export declare class Client {
|
|
|
21
21
|
apiAggregateStatistics(): string
|
|
22
22
|
clearAllStatistics(): void
|
|
23
23
|
uploadDebugArchive(serverUrl: string): Promise<string>
|
|
24
|
+
deleteMessage(messageId: Uint8Array): number
|
|
25
|
+
enrichedMessage(messageId: Array<number>): Promise<DecodedMessage>
|
|
24
26
|
setConsentStates(records: Array<Consent>): Promise<void>
|
|
25
27
|
getConsentState(entityType: ConsentEntityType, entity: string): Promise<ConsentState>
|
|
26
28
|
/**
|
|
@@ -50,11 +52,12 @@ export declare class Client {
|
|
|
50
52
|
|
|
51
53
|
export declare class Conversation {
|
|
52
54
|
id(): string
|
|
53
|
-
send(encodedContent: EncodedContent): Promise<string>
|
|
54
|
-
sendOptimistic(encodedContent: EncodedContent): string
|
|
55
|
+
send(encodedContent: EncodedContent, opts: SendMessageOpts): Promise<string>
|
|
56
|
+
sendOptimistic(encodedContent: EncodedContent, opts: SendMessageOpts): string
|
|
55
57
|
publishMessages(): Promise<void>
|
|
56
58
|
sync(): Promise<void>
|
|
57
59
|
findMessages(opts?: ListMessagesOptions | undefined | null): Promise<Array<Message>>
|
|
60
|
+
countMessages(opts?: ListMessagesOptions | undefined | null): Promise<number>
|
|
58
61
|
findMessagesWithReactions(opts?: ListMessagesOptions | undefined | null): Promise<Array<MessageWithReactions>>
|
|
59
62
|
processStreamedGroupMessage(envelopeBytes: Uint8Array): Promise<Message>
|
|
60
63
|
listMembers(): Promise<Array<GroupMember>>
|
|
@@ -94,6 +97,8 @@ export declare class Conversation {
|
|
|
94
97
|
getHmacKeys(): Record<string, Array<HmacKey>>
|
|
95
98
|
debugInfo(): Promise<ConversationDebugInfo>
|
|
96
99
|
findDuplicateDms(): Promise<Array<Conversation>>
|
|
100
|
+
findEnrichedMessages(opts?: ListMessagesOptions | undefined | null): Promise<Array<DecodedMessage>>
|
|
101
|
+
getLastReadTimes(): Promise<Record<string, number>>
|
|
97
102
|
}
|
|
98
103
|
|
|
99
104
|
export declare class ConversationListItem {
|
|
@@ -122,6 +127,37 @@ export declare class Conversations {
|
|
|
122
127
|
streamPreferences(callback: (err: null | Error, result: any) => void, onClose: () => void): StreamCloser
|
|
123
128
|
}
|
|
124
129
|
|
|
130
|
+
export declare class DecodedMessage {
|
|
131
|
+
id: Array<number>
|
|
132
|
+
sentAtNs: number
|
|
133
|
+
kind: GroupMessageKind
|
|
134
|
+
senderInstallationId: Array<number>
|
|
135
|
+
senderInboxId: string
|
|
136
|
+
contentType: ContentTypeId
|
|
137
|
+
conversationId: Array<number>
|
|
138
|
+
fallbackText?: string
|
|
139
|
+
deliveryStatus: DeliveryStatus
|
|
140
|
+
numReplies: number
|
|
141
|
+
get reactions(): Array<DecodedMessage>
|
|
142
|
+
get textContent(): TextContent | null
|
|
143
|
+
get replyContent(): EnrichedReply | null
|
|
144
|
+
get reactionContent(): ReactionPayload | null
|
|
145
|
+
get attachmentContent(): Attachment | null
|
|
146
|
+
get remoteAttachmentContent(): RemoteAttachment | null
|
|
147
|
+
get multiRemoteAttachmentContent(): MultiRemoteAttachmentPayload | null
|
|
148
|
+
get transactionReferenceContent(): TransactionReference | null
|
|
149
|
+
get groupUpdatedContent(): GroupUpdated | null
|
|
150
|
+
get readReceiptContent(): ReadReceipt | null
|
|
151
|
+
get walletSendCallsContent(): WalletSendCalls | null
|
|
152
|
+
get customContent(): EncodedContent | null
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export declare class EnrichedReply {
|
|
156
|
+
get referenceId(): string
|
|
157
|
+
get content(): DecodedMessageBody
|
|
158
|
+
get inReplyTo(): NodeDecodedMessage | null
|
|
159
|
+
}
|
|
160
|
+
|
|
125
161
|
export declare class GroupMember {
|
|
126
162
|
inboxId: string
|
|
127
163
|
accountIdentifiers: Array<Identifier>
|
|
@@ -177,6 +213,12 @@ export interface ApiStats {
|
|
|
177
213
|
|
|
178
214
|
export declare export declare function applySignatureRequest(host: string, signatureRequest: SignatureRequestHandle): Promise<void>
|
|
179
215
|
|
|
216
|
+
export interface Attachment {
|
|
217
|
+
filename?: string
|
|
218
|
+
mimeType: string
|
|
219
|
+
content: Array<number>
|
|
220
|
+
}
|
|
221
|
+
|
|
180
222
|
export interface Consent {
|
|
181
223
|
entityType: ConsentEntityType
|
|
182
224
|
state: ConsentState
|
|
@@ -253,6 +295,19 @@ export interface CreateGroupOptions {
|
|
|
253
295
|
messageDisappearingSettings?: MessageDisappearingSettings
|
|
254
296
|
}
|
|
255
297
|
|
|
298
|
+
export interface DecodedMessageBody {
|
|
299
|
+
textContent?: TextContent
|
|
300
|
+
reactionContent?: ReactionPayload
|
|
301
|
+
attachmentContent?: Attachment
|
|
302
|
+
remoteAttachmentContent?: RemoteAttachment
|
|
303
|
+
multiRemoteAttachmentContent?: MultiRemoteAttachmentPayload
|
|
304
|
+
transactionReferenceContent?: TransactionReference
|
|
305
|
+
groupUpdatedContent?: GroupUpdated
|
|
306
|
+
readReceiptContent?: ReadReceipt
|
|
307
|
+
walletSendCallsContent?: WalletSendCalls
|
|
308
|
+
customContent?: EncodedContent
|
|
309
|
+
}
|
|
310
|
+
|
|
256
311
|
export declare export declare function decodeMultiRemoteAttachment(bytes: Uint8Array): MultiRemoteAttachment
|
|
257
312
|
|
|
258
313
|
export declare export declare function decodeReaction(bytes: Uint8Array): Reaction
|
|
@@ -263,6 +318,8 @@ export declare const enum DeliveryStatus {
|
|
|
263
318
|
Failed = 2
|
|
264
319
|
}
|
|
265
320
|
|
|
321
|
+
export declare export declare function deserializeEncodedContent(bytes: Uint8Array): EncodedContent
|
|
322
|
+
|
|
266
323
|
export interface EncodedContent {
|
|
267
324
|
type?: ContentTypeId
|
|
268
325
|
parameters: Record<string, string>
|
|
@@ -297,6 +354,13 @@ export declare const enum GroupPermissionsOptions {
|
|
|
297
354
|
CustomPolicy = 2
|
|
298
355
|
}
|
|
299
356
|
|
|
357
|
+
export interface GroupUpdated {
|
|
358
|
+
initiatedByInboxId: string
|
|
359
|
+
addedInboxes: Array<Inbox>
|
|
360
|
+
removedInboxes: Array<Inbox>
|
|
361
|
+
metadataFieldChanges: Array<MetadataFieldChange>
|
|
362
|
+
}
|
|
363
|
+
|
|
300
364
|
export interface HmacKey {
|
|
301
365
|
key: Uint8Array
|
|
302
366
|
epoch: bigint
|
|
@@ -319,6 +383,10 @@ export interface IdentityStats {
|
|
|
319
383
|
verifySmartContractWalletSignature: bigint
|
|
320
384
|
}
|
|
321
385
|
|
|
386
|
+
export interface Inbox {
|
|
387
|
+
inboxId: string
|
|
388
|
+
}
|
|
389
|
+
|
|
322
390
|
export interface InboxState {
|
|
323
391
|
inboxId: string
|
|
324
392
|
recoveryIdentifier: Identifier
|
|
@@ -364,7 +432,9 @@ export interface ListMessagesOptions {
|
|
|
364
432
|
deliveryStatus?: DeliveryStatus
|
|
365
433
|
direction?: SortDirection
|
|
366
434
|
contentTypes?: Array<ContentType>
|
|
435
|
+
excludeContentTypes?: Array<ContentType>
|
|
367
436
|
kind?: GroupMessageKind
|
|
437
|
+
excludeSenderInboxIds?: Array<string>
|
|
368
438
|
}
|
|
369
439
|
|
|
370
440
|
export declare const enum LogLevel {
|
|
@@ -413,10 +483,20 @@ export declare const enum MetadataField {
|
|
|
413
483
|
ImageUrlSquare = 2
|
|
414
484
|
}
|
|
415
485
|
|
|
486
|
+
export interface MetadataFieldChange {
|
|
487
|
+
fieldName: string
|
|
488
|
+
oldValue?: string
|
|
489
|
+
newValue?: string
|
|
490
|
+
}
|
|
491
|
+
|
|
416
492
|
export interface MultiRemoteAttachment {
|
|
417
493
|
attachments: Array<RemoteAttachmentInfo>
|
|
418
494
|
}
|
|
419
495
|
|
|
496
|
+
export interface MultiRemoteAttachmentPayload {
|
|
497
|
+
attachments: Array<RemoteAttachmentInfoPayload>
|
|
498
|
+
}
|
|
499
|
+
|
|
420
500
|
export interface PasskeySignature {
|
|
421
501
|
publicKey: Array<number>
|
|
422
502
|
signature: Array<number>
|
|
@@ -472,6 +552,14 @@ export declare const enum ReactionAction {
|
|
|
472
552
|
Removed = 2
|
|
473
553
|
}
|
|
474
554
|
|
|
555
|
+
export interface ReactionPayload {
|
|
556
|
+
reference: string
|
|
557
|
+
referenceInboxId: string
|
|
558
|
+
action: ReactionAction
|
|
559
|
+
content: string
|
|
560
|
+
schema: ReactionSchema
|
|
561
|
+
}
|
|
562
|
+
|
|
475
563
|
export declare const enum ReactionSchema {
|
|
476
564
|
Unknown = 0,
|
|
477
565
|
Unicode = 1,
|
|
@@ -479,6 +567,21 @@ export declare const enum ReactionSchema {
|
|
|
479
567
|
Custom = 3
|
|
480
568
|
}
|
|
481
569
|
|
|
570
|
+
export interface ReadReceipt {
|
|
571
|
+
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
export interface RemoteAttachment {
|
|
575
|
+
url: string
|
|
576
|
+
contentDigest: string
|
|
577
|
+
secret: Array<number>
|
|
578
|
+
salt: Array<number>
|
|
579
|
+
nonce: Array<number>
|
|
580
|
+
scheme: string
|
|
581
|
+
contentLength: number
|
|
582
|
+
filename?: string
|
|
583
|
+
}
|
|
584
|
+
|
|
482
585
|
export interface RemoteAttachmentInfo {
|
|
483
586
|
secret: Uint8Array
|
|
484
587
|
contentDigest: string
|
|
@@ -490,7 +593,24 @@ export interface RemoteAttachmentInfo {
|
|
|
490
593
|
filename?: string
|
|
491
594
|
}
|
|
492
595
|
|
|
493
|
-
export
|
|
596
|
+
export interface RemoteAttachmentInfoPayload {
|
|
597
|
+
url: string
|
|
598
|
+
contentDigest: string
|
|
599
|
+
secret: Array<number>
|
|
600
|
+
salt: Array<number>
|
|
601
|
+
nonce: Array<number>
|
|
602
|
+
scheme: string
|
|
603
|
+
contentLength?: number
|
|
604
|
+
filename?: string
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
export declare export declare function revokeInstallationsSignatureRequest(host: string, recoveryIdentifier: Identifier, inboxId: string, installationIds: Array<Uint8Array>): SignatureRequestHandle
|
|
608
|
+
|
|
609
|
+
export interface SendMessageOpts {
|
|
610
|
+
shouldPush: boolean
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
export declare export declare function serializeEncodedContent(content: EncodedContent): Uint8Array
|
|
494
614
|
|
|
495
615
|
export declare const enum SortDirection {
|
|
496
616
|
Ascending = 0,
|
|
@@ -502,4 +622,46 @@ export declare const enum SyncWorkerMode {
|
|
|
502
622
|
disabled = 'disabled'
|
|
503
623
|
}
|
|
504
624
|
|
|
625
|
+
export interface TextContent {
|
|
626
|
+
content: string
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
export interface TransactionMetadata {
|
|
630
|
+
transactionType: string
|
|
631
|
+
currency: string
|
|
632
|
+
amount: number
|
|
633
|
+
decimals: number
|
|
634
|
+
fromAddress: string
|
|
635
|
+
toAddress: string
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
export interface TransactionReference {
|
|
639
|
+
namespace?: string
|
|
640
|
+
networkId: string
|
|
641
|
+
reference: string
|
|
642
|
+
metadata?: TransactionMetadata
|
|
643
|
+
}
|
|
644
|
+
|
|
505
645
|
export declare export declare function verifySignedWithPublicKey(signatureText: string, signatureBytes: Uint8Array, publicKey: Uint8Array): void
|
|
646
|
+
|
|
647
|
+
export interface WalletCall {
|
|
648
|
+
to?: string
|
|
649
|
+
data?: string
|
|
650
|
+
value?: string
|
|
651
|
+
gas?: string
|
|
652
|
+
metadata?: WalletCallMetadata
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
export interface WalletCallMetadata {
|
|
656
|
+
description: string
|
|
657
|
+
transactionType: string
|
|
658
|
+
extra: Record<string, string>
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
export interface WalletSendCalls {
|
|
662
|
+
version: string
|
|
663
|
+
chainId: string
|
|
664
|
+
from: string
|
|
665
|
+
calls: Array<WalletCall>
|
|
666
|
+
capabilities?: Record<string, string>
|
|
667
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -365,11 +365,13 @@ 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, 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
|
|
368
|
+
const { Client, Conversation, ConversationListItem, Conversations, DecodedMessage, EnrichedReply, GroupMember, GroupMetadata, GroupPermissions, SignatureRequestHandle, StreamCloser, applySignatureRequest, ConsentEntityType, ConsentState, ContentType, ConversationType, createClient, decodeMultiRemoteAttachment, decodeReaction, DeliveryStatus, deserializeEncodedContent, encodeMultiRemoteAttachment, encodeReaction, generateInboxId, getInboxIdForIdentifier, GroupMembershipState, GroupMessageKind, GroupPermissionsOptions, IdentifierKind, inboxStateFromInboxIds, isAddressAuthorized, isInstallationAuthorized, LogLevel, MetadataField, PermissionLevel, PermissionPolicy, PermissionUpdateType, ReactionAction, ReactionSchema, revokeInstallationsSignatureRequest, serializeEncodedContent, SortDirection, SyncWorkerMode, verifySignedWithPublicKey } = nativeBinding
|
|
369
369
|
export { Client }
|
|
370
370
|
export { Conversation }
|
|
371
371
|
export { ConversationListItem }
|
|
372
372
|
export { Conversations }
|
|
373
|
+
export { DecodedMessage }
|
|
374
|
+
export { EnrichedReply }
|
|
373
375
|
export { GroupMember }
|
|
374
376
|
export { GroupMetadata }
|
|
375
377
|
export { GroupPermissions }
|
|
@@ -384,6 +386,7 @@ export { createClient }
|
|
|
384
386
|
export { decodeMultiRemoteAttachment }
|
|
385
387
|
export { decodeReaction }
|
|
386
388
|
export { DeliveryStatus }
|
|
389
|
+
export { deserializeEncodedContent }
|
|
387
390
|
export { encodeMultiRemoteAttachment }
|
|
388
391
|
export { encodeReaction }
|
|
389
392
|
export { generateInboxId }
|
|
@@ -403,6 +406,7 @@ export { PermissionUpdateType }
|
|
|
403
406
|
export { ReactionAction }
|
|
404
407
|
export { ReactionSchema }
|
|
405
408
|
export { revokeInstallationsSignatureRequest }
|
|
409
|
+
export { serializeEncodedContent }
|
|
406
410
|
export { SortDirection }
|
|
407
411
|
export { SyncWorkerMode }
|
|
408
412
|
export { verifySignedWithPublicKey }
|
package/dist/version.json
CHANGED