@xmtp/wasm-bindings 1.10.0-dev.0d30e0e → 1.10.0-dev.2334796

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.
@@ -445,6 +445,32 @@ export class AuthHandle {
445
445
  set(credential: Credential): Promise<void>;
446
446
  }
447
447
 
448
+ export class Backend {
449
+ private constructor();
450
+ free(): void;
451
+ [Symbol.dispose](): void;
452
+ readonly appVersion: string;
453
+ readonly env: XmtpEnv;
454
+ readonly gatewayHost: string | undefined;
455
+ readonly v3Host: string | undefined;
456
+ }
457
+
458
+ export class BackendBuilder {
459
+ free(): void;
460
+ [Symbol.dispose](): void;
461
+ authCallback(callback: any): void;
462
+ authHandle(handle: AuthHandle): void;
463
+ build(): Backend;
464
+ constructor(env: XmtpEnv);
465
+ setApiUrl(api_url: string): BackendBuilder;
466
+ setAppVersion(app_version: string): BackendBuilder;
467
+ setGatewayHost(gateway_host: string): BackendBuilder;
468
+ setReadonly(readonly: boolean): BackendBuilder;
469
+ env: XmtpEnv;
470
+ get readonly(): boolean | undefined;
471
+ set readonly(value: boolean | null | undefined);
472
+ }
473
+
448
474
  /**
449
475
  * Selection of what elements to include in a backup
450
476
  */
@@ -923,6 +949,16 @@ export class WasmBindgenTestContext {
923
949
  run(tests: any[]): Promise<any>;
924
950
  }
925
951
 
952
+ export enum XmtpEnv {
953
+ Local = 0,
954
+ Dev = 1,
955
+ Production = 2,
956
+ TestnetStaging = 3,
957
+ TestnetDev = 4,
958
+ Testnet = 5,
959
+ Mainnet = 6,
960
+ }
961
+
926
962
  /**
927
963
  * Used to read benchmark data, and then the runner stores it on the local disk.
928
964
  */
@@ -972,7 +1008,7 @@ export function __wbgtest_coverage_path(env: string | null | undefined, pid: num
972
1008
 
973
1009
  export function __wbgtest_module_signature(): bigint | undefined;
974
1010
 
975
- export function applySignatureRequest(host: string, gatewayHost: string | null | undefined, signatureRequest: SignatureRequestHandle): Promise<void>;
1011
+ export function applySignatureRequest(backend: Backend, signatureRequest: SignatureRequestHandle): Promise<void>;
976
1012
 
977
1013
  export function contentTypeActions(): ContentTypeId;
978
1014
 
@@ -1004,6 +1040,14 @@ export function contentTypeWalletSendCalls(): ContentTypeId;
1004
1040
 
1005
1041
  export function createClient(host: string, inboxId: string, accountIdentifier: Identifier, dbPath?: string | null, encryptionKey?: Uint8Array | null, deviceSyncMode?: DeviceSyncMode | null, logOptions?: LogOptions | null, allowOffline?: boolean | null, appVersion?: string | null, gatewayHost?: string | null, nonce?: bigint | null, authCallback?: any | null, authHandle?: AuthHandle | null, clientMode?: ClientMode | null): Promise<Client>;
1006
1042
 
1043
+ /**
1044
+ * Create a client from a pre-built Backend.
1045
+ *
1046
+ * The Backend encapsulates all API configuration (env, hosts, auth, TLS).
1047
+ * This function only needs identity and database configuration.
1048
+ */
1049
+ export function createClientWithBackend(backend: Backend, inboxId: string, accountIdentifier: Identifier, dbPath?: string | null, encryptionKey?: Uint8Array | null, deviceSyncMode?: DeviceSyncMode | null, logOptions?: LogOptions | null, allowOffline?: boolean | null, nonce?: bigint | null): Promise<Client>;
1050
+
1007
1051
  /**
1008
1052
  * Decrypts an encrypted payload from a remote attachment.
1009
1053
  */
@@ -1038,9 +1082,9 @@ export function encryptAttachment(attachment: Attachment): EncryptedAttachment;
1038
1082
 
1039
1083
  export function generateInboxId(accountIdentifier: Identifier, nonce?: bigint | null): string;
1040
1084
 
1041
- export function getInboxIdForIdentifier(host: string, gatewayHost: string | null | undefined, isSecure: boolean, accountIdentifier: Identifier): Promise<string | undefined>;
1085
+ export function getInboxIdForIdentifier(backend: Backend, accountIdentifier: Identifier): Promise<string | undefined>;
1042
1086
 
1043
- export function inboxStateFromInboxIds(host: string, gatewayHost: string | null | undefined, inboxIds: string[]): Promise<InboxState[]>;
1087
+ export function inboxStateFromInboxIds(backend: Backend, inboxIds: string[]): Promise<InboxState[]>;
1044
1088
 
1045
1089
  export function metadataFieldName(field: MetadataField): string;
1046
1090
 
@@ -1099,7 +1143,7 @@ export function opfsListFiles(): Promise<string[]>;
1099
1143
  */
1100
1144
  export function opfsPoolCapacity(): Promise<number>;
1101
1145
 
1102
- export function revokeInstallationsSignatureRequest(host: string, gatewayHost: string | null | undefined, recoveryIdentifier: Identifier, inboxId: string, installationIds: Uint8Array[]): SignatureRequestHandle;
1146
+ export function revokeInstallationsSignatureRequest(backend: Backend, recoveryIdentifier: Identifier, inboxId: string, installationIds: Uint8Array[]): SignatureRequestHandle;
1103
1147
 
1104
1148
  /**
1105
1149
  * Entry point invoked by JavaScript in a worker.
@@ -1112,72 +1156,64 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
1112
1156
 
1113
1157
  export interface InitOutput {
1114
1158
  readonly memory: WebAssembly.Memory;
1115
- readonly generateInboxId: (a: any, b: number, c: bigint) => [number, number, number, number];
1116
- readonly getInboxIdForIdentifier: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
1159
+ readonly __wbg_authhandle_free: (a: number, b: number) => void;
1160
+ readonly authhandle_id: (a: number) => number;
1161
+ readonly authhandle_new: () => number;
1162
+ readonly authhandle_set: (a: number, b: any) => any;
1117
1163
  readonly client_fetchLatestInboxUpdatesCount: (a: number, b: number, c: number, d: number) => any;
1118
1164
  readonly client_fetchOwnInboxUpdatesCount: (a: number, b: number) => any;
1119
1165
  readonly client_getKeyPackageStatusesForInstallationIds: (a: number, b: number, c: number) => any;
1120
1166
  readonly client_getLatestInboxState: (a: number, b: number, c: number) => any;
1121
1167
  readonly client_inboxState: (a: number, b: number) => any;
1122
- readonly contentTypeGroupUpdated: () => any;
1123
- readonly contentTypeLeaveRequest: () => any;
1124
- readonly contentTypeMarkdown: () => any;
1125
- readonly contentTypeReaction: () => any;
1126
- readonly contentTypeRemoteAttachment: () => any;
1127
- readonly contentTypeText: () => any;
1128
- readonly contentTypeWalletSendCalls: () => any;
1129
- readonly decryptAttachment: (a: number, b: number, c: any) => [number, number, number];
1130
- readonly encodeMarkdown: (a: number, b: number) => [number, number, number];
1131
- readonly encodeReaction: (a: any) => [number, number, number];
1132
- readonly encodeRemoteAttachment: (a: any) => [number, number, number];
1133
- readonly encodeText: (a: number, b: number) => [number, number, number];
1134
- readonly encodeWalletSendCalls: (a: any) => [number, number, number];
1135
- readonly encryptAttachment: (a: any) => [number, number, number];
1136
- readonly inboxStateFromInboxIds: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
1137
- readonly metadataFieldName: (a: number) => [number, number];
1138
- readonly __wbg_authhandle_free: (a: number, b: number) => void;
1139
- readonly authhandle_id: (a: number) => number;
1140
- readonly authhandle_new: () => number;
1141
- readonly authhandle_set: (a: number, b: any) => any;
1142
- readonly client_getConsentState: (a: number, b: number, c: number, d: number) => any;
1143
- readonly client_setConsentStates: (a: number, b: number, c: number) => any;
1144
- readonly conversation_consentState: (a: number) => [number, number, number];
1145
- readonly conversation_updateConsentState: (a: number, b: number) => [number, number];
1146
- readonly opfsClearAll: () => any;
1147
- readonly opfsDeleteFile: (a: number, b: number) => any;
1148
- readonly opfsExportDb: (a: number, b: number) => any;
1149
- readonly opfsFileCount: () => any;
1150
- readonly opfsFileExists: (a: number, b: number) => any;
1151
- readonly opfsImportDb: (a: number, b: number, c: any) => any;
1152
- readonly opfsInit: () => any;
1153
- readonly opfsListFiles: () => any;
1154
- readonly opfsPoolCapacity: () => any;
1168
+ readonly inboxStateFromInboxIds: (a: number, b: number, c: number) => any;
1169
+ readonly __wbg_backend_free: (a: number, b: number) => void;
1170
+ readonly __wbg_backendbuilder_free: (a: number, b: number) => void;
1171
+ readonly __wbg_get_backendbuilder_env: (a: number) => number;
1172
+ readonly __wbg_get_backendbuilder_readonly: (a: number) => number;
1173
+ readonly __wbg_set_backendbuilder_env: (a: number, b: number) => void;
1174
+ readonly __wbg_set_backendbuilder_readonly: (a: number, b: number) => void;
1175
+ readonly __wbg_signaturerequesthandle_free: (a: number, b: number) => void;
1176
+ readonly applySignatureRequest: (a: number, b: number) => any;
1177
+ readonly backend_appVersion: (a: number) => [number, number];
1178
+ readonly backend_env: (a: number) => number;
1179
+ readonly backend_gatewayHost: (a: number) => [number, number];
1180
+ readonly backend_v3Host: (a: number) => [number, number];
1181
+ readonly backendbuilder_authCallback: (a: number, b: any) => void;
1182
+ readonly backendbuilder_authHandle: (a: number, b: number) => void;
1183
+ readonly backendbuilder_build: (a: number) => [number, number, number];
1184
+ readonly backendbuilder_new: (a: number) => number;
1185
+ readonly backendbuilder_setApiUrl: (a: number, b: number, c: number) => number;
1186
+ readonly backendbuilder_setAppVersion: (a: number, b: number, c: number) => number;
1187
+ readonly backendbuilder_setGatewayHost: (a: number, b: number, c: number) => number;
1188
+ readonly backendbuilder_setReadonly: (a: number, b: number) => number;
1189
+ readonly client_addWalletSignatureRequest: (a: number, b: any) => any;
1190
+ readonly client_applySignatureRequest: (a: number, b: number) => any;
1191
+ readonly client_changeRecoveryIdentifierSignatureRequest: (a: number, b: any) => any;
1192
+ readonly client_createInboxSignatureRequest: (a: number) => [number, number, number];
1193
+ readonly client_registerIdentity: (a: number, b: number) => any;
1194
+ readonly client_revokeAllOtherInstallationsSignatureRequest: (a: number) => any;
1195
+ readonly client_revokeInstallationsSignatureRequest: (a: number, b: number, c: number) => any;
1196
+ readonly client_revokeWalletSignatureRequest: (a: number, b: any) => any;
1197
+ readonly client_signWithInstallationKey: (a: number, b: number, c: number) => [number, number, number];
1198
+ readonly client_verifySignedWithInstallationKey: (a: number, b: number, c: number, d: any) => [number, number];
1199
+ readonly createClientWithBackend: (a: number, b: number, c: number, d: any, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: bigint) => any;
1200
+ readonly revokeInstallationsSignatureRequest: (a: number, b: any, c: number, d: number, e: number, f: number) => [number, number, number];
1201
+ readonly signaturerequesthandle_addEcdsaSignature: (a: number, b: any) => any;
1202
+ readonly signaturerequesthandle_addPasskeySignature: (a: number, b: any) => any;
1203
+ readonly signaturerequesthandle_addScwSignature: (a: number, b: any, c: any, d: bigint, e: number, f: bigint) => any;
1204
+ readonly signaturerequesthandle_signatureText: (a: number) => any;
1205
+ readonly verifySignedWithPublicKey: (a: number, b: number, c: any, d: any) => [number, number];
1206
+ readonly contentTypeReply: () => any;
1155
1207
  readonly __wbg_client_free: (a: number, b: number) => void;
1156
- readonly __wbg_conversation_free: (a: number, b: number) => void;
1157
- readonly __wbg_conversationlistitem_free: (a: number, b: number) => void;
1158
- readonly __wbg_conversations_free: (a: number, b: number) => void;
1159
1208
  readonly __wbg_devicesync_free: (a: number, b: number) => void;
1160
- readonly __wbg_get_conversationlistitem_conversation: (a: number) => number;
1161
- readonly __wbg_get_conversationlistitem_isCommitLogForked: (a: number) => number;
1162
- readonly __wbg_get_conversationlistitem_lastMessage: (a: number) => any;
1163
- readonly __wbg_set_conversationlistitem_conversation: (a: number, b: number) => void;
1164
- readonly __wbg_set_conversationlistitem_isCommitLogForked: (a: number, b: number) => void;
1165
- readonly __wbg_set_conversationlistitem_lastMessage: (a: number, b: number) => void;
1166
- readonly __wbg_signaturerequesthandle_free: (a: number, b: number) => void;
1167
- readonly __wbg_streamcloser_free: (a: number, b: number) => void;
1168
- readonly applySignatureRequest: (a: number, b: number, c: number, d: number, e: number) => any;
1169
1209
  readonly client_accountIdentifier: (a: number) => any;
1170
- readonly client_addWalletSignatureRequest: (a: number, b: any) => any;
1171
1210
  readonly client_apiAggregateStatistics: (a: number) => [number, number];
1172
1211
  readonly client_apiIdentityStatistics: (a: number) => any;
1173
1212
  readonly client_apiStatistics: (a: number) => any;
1174
1213
  readonly client_appVersion: (a: number) => [number, number];
1175
- readonly client_applySignatureRequest: (a: number, b: number) => any;
1176
1214
  readonly client_canMessage: (a: number, b: number, c: number) => any;
1177
- readonly client_changeRecoveryIdentifierSignatureRequest: (a: number, b: any) => any;
1178
1215
  readonly client_clearAllStatistics: (a: number) => void;
1179
1216
  readonly client_conversations: (a: number) => number;
1180
- readonly client_createInboxSignatureRequest: (a: number) => [number, number, number];
1181
1217
  readonly client_device_sync: (a: number) => number;
1182
1218
  readonly client_findInboxIdByIdentity: (a: number, b: any) => any;
1183
1219
  readonly client_inboxId: (a: number) => [number, number];
@@ -1186,13 +1222,57 @@ export interface InitOutput {
1186
1222
  readonly client_installationIdBytes: (a: number) => any;
1187
1223
  readonly client_isRegistered: (a: number) => number;
1188
1224
  readonly client_libxmtpVersion: (a: number) => [number, number];
1189
- readonly client_registerIdentity: (a: number, b: number) => any;
1190
- readonly client_revokeAllOtherInstallationsSignatureRequest: (a: number) => any;
1191
- readonly client_revokeInstallationsSignatureRequest: (a: number, b: number, c: number) => any;
1192
- readonly client_revokeWalletSignatureRequest: (a: number, b: any) => any;
1193
- readonly client_signWithInstallationKey: (a: number, b: number, c: number) => [number, number, number];
1194
1225
  readonly client_syncPreferences: (a: number) => any;
1195
- readonly client_verifySignedWithInstallationKey: (a: number, b: number, c: number, d: any) => [number, number];
1226
+ readonly contentTypeAttachment: () => any;
1227
+ readonly contentTypeIntent: () => any;
1228
+ readonly contentTypeLeaveRequest: () => any;
1229
+ readonly contentTypeMarkdown: () => any;
1230
+ readonly contentTypeReadReceipt: () => any;
1231
+ readonly contentTypeText: () => any;
1232
+ readonly createClient: (a: number, b: number, c: number, d: number, e: any, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: bigint, r: number, s: number, t: number) => any;
1233
+ readonly devicesync_archiveMetadata: (a: number, b: any, c: any) => any;
1234
+ readonly devicesync_createArchive: (a: number, b: any, c: any) => any;
1235
+ readonly devicesync_importArchive: (a: number, b: any, c: any) => any;
1236
+ readonly devicesync_listAvailableArchives: (a: number, b: bigint) => [number, number, number, number];
1237
+ readonly devicesync_processSyncArchive: (a: number, b: number, c: number) => any;
1238
+ readonly devicesync_sendSyncArchive: (a: number, b: any, c: number, d: number, e: number, f: number) => any;
1239
+ readonly devicesync_sendSyncRequest: (a: number, b: any, c: number, d: number) => any;
1240
+ readonly devicesync_syncAllDeviceSyncGroups: (a: number) => any;
1241
+ readonly encodeAttachment: (a: any) => [number, number, number];
1242
+ readonly encodeIntent: (a: any) => [number, number, number];
1243
+ readonly encodeMarkdown: (a: number, b: number) => [number, number, number];
1244
+ readonly encodeReadReceipt: (a: any) => [number, number, number];
1245
+ readonly encodeText: (a: number, b: number) => [number, number, number];
1246
+ readonly generateInboxId: (a: any, b: number, c: bigint) => [number, number, number, number];
1247
+ readonly getInboxIdForIdentifier: (a: number, b: any) => any;
1248
+ readonly __wbg_streamcloser_free: (a: number, b: number) => void;
1249
+ readonly contentTypeActions: () => any;
1250
+ readonly contentTypeGroupUpdated: () => any;
1251
+ readonly contentTypeMultiRemoteAttachment: () => any;
1252
+ readonly contentTypeReaction: () => any;
1253
+ readonly contentTypeTransactionReference: () => any;
1254
+ readonly contentTypeWalletSendCalls: () => any;
1255
+ readonly encodeActions: (a: any) => [number, number, number];
1256
+ readonly encodeMultiRemoteAttachment: (a: any) => [number, number, number];
1257
+ readonly encodeReaction: (a: any) => [number, number, number];
1258
+ readonly encodeTransactionReference: (a: any) => [number, number, number];
1259
+ readonly encodeWalletSendCalls: (a: any) => [number, number, number];
1260
+ readonly streamcloser_end: (a: number) => void;
1261
+ readonly streamcloser_endAndWait: (a: number) => any;
1262
+ readonly streamcloser_isClosed: (a: number) => number;
1263
+ readonly streamcloser_waitForReady: (a: number) => any;
1264
+ readonly __wbg_conversation_free: (a: number, b: number) => void;
1265
+ readonly __wbg_conversationlistitem_free: (a: number, b: number) => void;
1266
+ readonly __wbg_conversations_free: (a: number, b: number) => void;
1267
+ readonly __wbg_get_conversationlistitem_conversation: (a: number) => number;
1268
+ readonly __wbg_get_conversationlistitem_isCommitLogForked: (a: number) => number;
1269
+ readonly __wbg_get_conversationlistitem_lastMessage: (a: number) => any;
1270
+ readonly __wbg_set_conversationlistitem_conversation: (a: number, b: number) => void;
1271
+ readonly __wbg_set_conversationlistitem_isCommitLogForked: (a: number, b: number) => void;
1272
+ readonly __wbg_set_conversationlistitem_lastMessage: (a: number, b: number) => void;
1273
+ readonly client_getConsentState: (a: number, b: number, c: number, d: number) => any;
1274
+ readonly client_setConsentStates: (a: number, b: number, c: number) => any;
1275
+ readonly contentTypeRemoteAttachment: () => any;
1196
1276
  readonly conversation_addAdmin: (a: number, b: number, c: number) => any;
1197
1277
  readonly conversation_addMembers: (a: number, b: number, c: number) => any;
1198
1278
  readonly conversation_addMembersByIdentity: (a: number, b: number, c: number) => any;
@@ -1200,6 +1280,7 @@ export interface InitOutput {
1200
1280
  readonly conversation_addedByInboxId: (a: number) => [number, number, number, number];
1201
1281
  readonly conversation_adminList: (a: number) => [number, number, number, number];
1202
1282
  readonly conversation_appData: (a: number) => [number, number, number, number];
1283
+ readonly conversation_consentState: (a: number) => [number, number, number];
1203
1284
  readonly conversation_countMessages: (a: number, b: number) => any;
1204
1285
  readonly conversation_createdAtNs: (a: number) => bigint;
1205
1286
  readonly conversation_dmPeerInboxId: (a: number) => [number, number, number, number];
@@ -1250,6 +1331,7 @@ export interface InitOutput {
1250
1331
  readonly conversation_superAdminList: (a: number) => [number, number, number, number];
1251
1332
  readonly conversation_sync: (a: number) => any;
1252
1333
  readonly conversation_updateAppData: (a: number, b: number, c: number) => any;
1334
+ readonly conversation_updateConsentState: (a: number, b: number) => [number, number];
1253
1335
  readonly conversation_updateGroupDescription: (a: number, b: number, c: number) => any;
1254
1336
  readonly conversation_updateGroupImageUrlSquare: (a: number, b: number, c: number) => any;
1255
1337
  readonly conversation_updateGroupName: (a: number, b: number, c: number) => any;
@@ -1276,38 +1358,19 @@ export interface InitOutput {
1276
1358
  readonly conversations_streamPreferences: (a: number, b: any) => [number, number, number];
1277
1359
  readonly conversations_sync: (a: number) => any;
1278
1360
  readonly conversations_syncAllConversations: (a: number, b: number, c: number) => any;
1279
- readonly createClient: (a: number, b: number, c: number, d: number, e: any, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: bigint, r: number, s: number, t: number) => any;
1280
- readonly devicesync_archiveMetadata: (a: number, b: any, c: any) => any;
1281
- readonly devicesync_createArchive: (a: number, b: any, c: any) => any;
1282
- readonly devicesync_importArchive: (a: number, b: any, c: any) => any;
1283
- readonly devicesync_listAvailableArchives: (a: number, b: bigint) => [number, number, number, number];
1284
- readonly devicesync_processSyncArchive: (a: number, b: number, c: number) => any;
1285
- readonly devicesync_sendSyncArchive: (a: number, b: any, c: number, d: number, e: number, f: number) => any;
1286
- readonly devicesync_sendSyncRequest: (a: number, b: any, c: number, d: number) => any;
1287
- readonly devicesync_syncAllDeviceSyncGroups: (a: number) => any;
1288
- readonly revokeInstallationsSignatureRequest: (a: number, b: number, c: number, d: number, e: any, f: number, g: number, h: number, i: number) => [number, number, number];
1289
- readonly signaturerequesthandle_addEcdsaSignature: (a: number, b: any) => any;
1290
- readonly signaturerequesthandle_addPasskeySignature: (a: number, b: any) => any;
1291
- readonly signaturerequesthandle_addScwSignature: (a: number, b: any, c: any, d: bigint, e: number, f: bigint) => any;
1292
- readonly signaturerequesthandle_signatureText: (a: number) => any;
1293
- readonly streamcloser_end: (a: number) => void;
1294
- readonly streamcloser_endAndWait: (a: number) => any;
1295
- readonly streamcloser_isClosed: (a: number) => number;
1296
- readonly streamcloser_waitForReady: (a: number) => any;
1297
- readonly verifySignedWithPublicKey: (a: number, b: number, c: any, d: any) => [number, number];
1298
- readonly contentTypeActions: () => any;
1299
- readonly contentTypeAttachment: () => any;
1300
- readonly contentTypeIntent: () => any;
1301
- readonly contentTypeMultiRemoteAttachment: () => any;
1302
- readonly contentTypeReadReceipt: () => any;
1303
- readonly contentTypeReply: () => any;
1304
- readonly contentTypeTransactionReference: () => any;
1305
- readonly encodeActions: (a: any) => [number, number, number];
1306
- readonly encodeAttachment: (a: any) => [number, number, number];
1307
- readonly encodeIntent: (a: any) => [number, number, number];
1308
- readonly encodeMultiRemoteAttachment: (a: any) => [number, number, number];
1309
- readonly encodeReadReceipt: (a: any) => [number, number, number];
1310
- readonly encodeTransactionReference: (a: any) => [number, number, number];
1361
+ readonly decryptAttachment: (a: number, b: number, c: any) => [number, number, number];
1362
+ readonly encodeRemoteAttachment: (a: any) => [number, number, number];
1363
+ readonly encryptAttachment: (a: any) => [number, number, number];
1364
+ readonly metadataFieldName: (a: number) => [number, number];
1365
+ readonly opfsClearAll: () => any;
1366
+ readonly opfsDeleteFile: (a: number, b: number) => any;
1367
+ readonly opfsExportDb: (a: number, b: number) => any;
1368
+ readonly opfsFileCount: () => any;
1369
+ readonly opfsFileExists: (a: number, b: number) => any;
1370
+ readonly opfsImportDb: (a: number, b: number, c: any) => any;
1371
+ readonly opfsInit: () => any;
1372
+ readonly opfsListFiles: () => any;
1373
+ readonly opfsPoolCapacity: () => any;
1311
1374
  readonly rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
1312
1375
  readonly rust_zstd_wasm_shim_free: (a: number) => void;
1313
1376
  readonly rust_zstd_wasm_shim_malloc: (a: number) => number;
@@ -44,6 +44,196 @@ export class AuthHandle {
44
44
  }
45
45
  if (Symbol.dispose) AuthHandle.prototype[Symbol.dispose] = AuthHandle.prototype.free;
46
46
 
47
+ export class Backend {
48
+ static __wrap(ptr) {
49
+ ptr = ptr >>> 0;
50
+ const obj = Object.create(Backend.prototype);
51
+ obj.__wbg_ptr = ptr;
52
+ BackendFinalization.register(obj, obj.__wbg_ptr, obj);
53
+ return obj;
54
+ }
55
+ __destroy_into_raw() {
56
+ const ptr = this.__wbg_ptr;
57
+ this.__wbg_ptr = 0;
58
+ BackendFinalization.unregister(this);
59
+ return ptr;
60
+ }
61
+ free() {
62
+ const ptr = this.__destroy_into_raw();
63
+ wasm.__wbg_backend_free(ptr, 0);
64
+ }
65
+ /**
66
+ * @returns {string}
67
+ */
68
+ get appVersion() {
69
+ let deferred1_0;
70
+ let deferred1_1;
71
+ try {
72
+ const ret = wasm.backend_appVersion(this.__wbg_ptr);
73
+ deferred1_0 = ret[0];
74
+ deferred1_1 = ret[1];
75
+ return getStringFromWasm0(ret[0], ret[1]);
76
+ } finally {
77
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
78
+ }
79
+ }
80
+ /**
81
+ * @returns {XmtpEnv}
82
+ */
83
+ get env() {
84
+ const ret = wasm.backend_env(this.__wbg_ptr);
85
+ return ret;
86
+ }
87
+ /**
88
+ * @returns {string | undefined}
89
+ */
90
+ get gatewayHost() {
91
+ const ret = wasm.backend_gatewayHost(this.__wbg_ptr);
92
+ let v1;
93
+ if (ret[0] !== 0) {
94
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
95
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
96
+ }
97
+ return v1;
98
+ }
99
+ /**
100
+ * @returns {string | undefined}
101
+ */
102
+ get v3Host() {
103
+ const ret = wasm.backend_v3Host(this.__wbg_ptr);
104
+ let v1;
105
+ if (ret[0] !== 0) {
106
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
107
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
108
+ }
109
+ return v1;
110
+ }
111
+ }
112
+ if (Symbol.dispose) Backend.prototype[Symbol.dispose] = Backend.prototype.free;
113
+
114
+ export class BackendBuilder {
115
+ static __wrap(ptr) {
116
+ ptr = ptr >>> 0;
117
+ const obj = Object.create(BackendBuilder.prototype);
118
+ obj.__wbg_ptr = ptr;
119
+ BackendBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
120
+ return obj;
121
+ }
122
+ __destroy_into_raw() {
123
+ const ptr = this.__wbg_ptr;
124
+ this.__wbg_ptr = 0;
125
+ BackendBuilderFinalization.unregister(this);
126
+ return ptr;
127
+ }
128
+ free() {
129
+ const ptr = this.__destroy_into_raw();
130
+ wasm.__wbg_backendbuilder_free(ptr, 0);
131
+ }
132
+ /**
133
+ * @param {any} callback
134
+ */
135
+ authCallback(callback) {
136
+ wasm.backendbuilder_authCallback(this.__wbg_ptr, callback);
137
+ }
138
+ /**
139
+ * @param {AuthHandle} handle
140
+ */
141
+ authHandle(handle) {
142
+ _assertClass(handle, AuthHandle);
143
+ var ptr0 = handle.__destroy_into_raw();
144
+ wasm.backendbuilder_authHandle(this.__wbg_ptr, ptr0);
145
+ }
146
+ /**
147
+ * @returns {Backend}
148
+ */
149
+ build() {
150
+ const ptr = this.__destroy_into_raw();
151
+ const ret = wasm.backendbuilder_build(ptr);
152
+ if (ret[2]) {
153
+ throw takeFromExternrefTable0(ret[1]);
154
+ }
155
+ return Backend.__wrap(ret[0]);
156
+ }
157
+ /**
158
+ * @param {XmtpEnv} env
159
+ */
160
+ constructor(env) {
161
+ const ret = wasm.backendbuilder_new(env);
162
+ this.__wbg_ptr = ret >>> 0;
163
+ BackendBuilderFinalization.register(this, this.__wbg_ptr, this);
164
+ return this;
165
+ }
166
+ /**
167
+ * @param {string} api_url
168
+ * @returns {BackendBuilder}
169
+ */
170
+ setApiUrl(api_url) {
171
+ const ptr = this.__destroy_into_raw();
172
+ const ptr0 = passStringToWasm0(api_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
173
+ const len0 = WASM_VECTOR_LEN;
174
+ const ret = wasm.backendbuilder_setApiUrl(ptr, ptr0, len0);
175
+ return BackendBuilder.__wrap(ret);
176
+ }
177
+ /**
178
+ * @param {string} app_version
179
+ * @returns {BackendBuilder}
180
+ */
181
+ setAppVersion(app_version) {
182
+ const ptr = this.__destroy_into_raw();
183
+ const ptr0 = passStringToWasm0(app_version, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
184
+ const len0 = WASM_VECTOR_LEN;
185
+ const ret = wasm.backendbuilder_setAppVersion(ptr, ptr0, len0);
186
+ return BackendBuilder.__wrap(ret);
187
+ }
188
+ /**
189
+ * @param {string} gateway_host
190
+ * @returns {BackendBuilder}
191
+ */
192
+ setGatewayHost(gateway_host) {
193
+ const ptr = this.__destroy_into_raw();
194
+ const ptr0 = passStringToWasm0(gateway_host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
195
+ const len0 = WASM_VECTOR_LEN;
196
+ const ret = wasm.backendbuilder_setGatewayHost(ptr, ptr0, len0);
197
+ return BackendBuilder.__wrap(ret);
198
+ }
199
+ /**
200
+ * @param {boolean} readonly
201
+ * @returns {BackendBuilder}
202
+ */
203
+ setReadonly(readonly) {
204
+ const ptr = this.__destroy_into_raw();
205
+ const ret = wasm.backendbuilder_setReadonly(ptr, readonly);
206
+ return BackendBuilder.__wrap(ret);
207
+ }
208
+ /**
209
+ * @returns {XmtpEnv}
210
+ */
211
+ get env() {
212
+ const ret = wasm.__wbg_get_backendbuilder_env(this.__wbg_ptr);
213
+ return ret;
214
+ }
215
+ /**
216
+ * @returns {boolean | undefined}
217
+ */
218
+ get readonly() {
219
+ const ret = wasm.__wbg_get_backendbuilder_readonly(this.__wbg_ptr);
220
+ return ret === 0xFFFFFF ? undefined : ret !== 0;
221
+ }
222
+ /**
223
+ * @param {XmtpEnv} arg0
224
+ */
225
+ set env(arg0) {
226
+ wasm.__wbg_set_backendbuilder_env(this.__wbg_ptr, arg0);
227
+ }
228
+ /**
229
+ * @param {boolean | null} [arg0]
230
+ */
231
+ set readonly(arg0) {
232
+ wasm.__wbg_set_backendbuilder_readonly(this.__wbg_ptr, isLikeNone(arg0) ? 0xFFFFFF : arg0 ? 1 : 0);
233
+ }
234
+ }
235
+ if (Symbol.dispose) BackendBuilder.prototype[Symbol.dispose] = BackendBuilder.prototype.free;
236
+
47
237
  /**
48
238
  * Selection of what elements to include in a backup
49
239
  * @enum {0 | 1}
@@ -2069,6 +2259,19 @@ export class WasmBindgenTestContext {
2069
2259
  }
2070
2260
  if (Symbol.dispose) WasmBindgenTestContext.prototype[Symbol.dispose] = WasmBindgenTestContext.prototype.free;
2071
2261
 
2262
+ /**
2263
+ * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6}
2264
+ */
2265
+ export const XmtpEnv = Object.freeze({
2266
+ Local: 0, "0": "Local",
2267
+ Dev: 1, "1": "Dev",
2268
+ Production: 2, "2": "Production",
2269
+ TestnetStaging: 3, "3": "TestnetStaging",
2270
+ TestnetDev: 4, "4": "TestnetDev",
2271
+ Testnet: 5, "5": "Testnet",
2272
+ Mainnet: 6, "6": "Mainnet",
2273
+ });
2274
+
2072
2275
  /**
2073
2276
  * Used to read benchmark data, and then the runner stores it on the local disk.
2074
2277
  * @returns {Uint8Array | undefined}
@@ -2185,18 +2388,14 @@ export function __wbgtest_module_signature() {
2185
2388
  }
2186
2389
 
2187
2390
  /**
2188
- * @param {string} host
2189
- * @param {string | null | undefined} gatewayHost
2391
+ * @param {Backend} backend
2190
2392
  * @param {SignatureRequestHandle} signatureRequest
2191
2393
  * @returns {Promise<void>}
2192
2394
  */
2193
- export function applySignatureRequest(host, gatewayHost, signatureRequest) {
2194
- const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2195
- const len0 = WASM_VECTOR_LEN;
2196
- var ptr1 = isLikeNone(gatewayHost) ? 0 : passStringToWasm0(gatewayHost, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2197
- var len1 = WASM_VECTOR_LEN;
2395
+ export function applySignatureRequest(backend, signatureRequest) {
2396
+ _assertClass(backend, Backend);
2198
2397
  _assertClass(signatureRequest, SignatureRequestHandle);
2199
- const ret = wasm.applySignatureRequest(ptr0, len0, ptr1, len1, signatureRequest.__wbg_ptr);
2398
+ const ret = wasm.applySignatureRequest(backend.__wbg_ptr, signatureRequest.__wbg_ptr);
2200
2399
  return ret;
2201
2400
  }
2202
2401
 
@@ -2349,6 +2548,32 @@ export function createClient(host, inboxId, accountIdentifier, dbPath, encryptio
2349
2548
  return ret;
2350
2549
  }
2351
2550
 
2551
+ /**
2552
+ * Create a client from a pre-built Backend.
2553
+ *
2554
+ * The Backend encapsulates all API configuration (env, hosts, auth, TLS).
2555
+ * This function only needs identity and database configuration.
2556
+ * @param {Backend} backend
2557
+ * @param {string} inboxId
2558
+ * @param {Identifier} accountIdentifier
2559
+ * @param {string | null} [dbPath]
2560
+ * @param {Uint8Array | null} [encryptionKey]
2561
+ * @param {DeviceSyncMode | null} [deviceSyncMode]
2562
+ * @param {LogOptions | null} [logOptions]
2563
+ * @param {boolean | null} [allowOffline]
2564
+ * @param {bigint | null} [nonce]
2565
+ * @returns {Promise<Client>}
2566
+ */
2567
+ export function createClientWithBackend(backend, inboxId, accountIdentifier, dbPath, encryptionKey, deviceSyncMode, logOptions, allowOffline, nonce) {
2568
+ _assertClass(backend, Backend);
2569
+ const ptr0 = passStringToWasm0(inboxId, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2570
+ const len0 = WASM_VECTOR_LEN;
2571
+ var ptr1 = isLikeNone(dbPath) ? 0 : passStringToWasm0(dbPath, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2572
+ var len1 = WASM_VECTOR_LEN;
2573
+ const ret = wasm.createClientWithBackend(backend.__wbg_ptr, ptr0, len0, accountIdentifier, ptr1, len1, isLikeNone(encryptionKey) ? 0 : addToExternrefTable0(encryptionKey), isLikeNone(deviceSyncMode) ? 2 : deviceSyncMode, isLikeNone(logOptions) ? 0 : addToExternrefTable0(logOptions), isLikeNone(allowOffline) ? 0xFFFFFF : allowOffline ? 1 : 0, !isLikeNone(nonce), isLikeNone(nonce) ? BigInt(0) : nonce);
2574
+ return ret;
2575
+ }
2576
+
2352
2577
  /**
2353
2578
  * Decrypts an encrypted payload from a remote attachment.
2354
2579
  * @param {Uint8Array} encryptedBytes
@@ -2539,35 +2764,26 @@ export function generateInboxId(accountIdentifier, nonce) {
2539
2764
  }
2540
2765
 
2541
2766
  /**
2542
- * @param {string} host
2543
- * @param {string | null | undefined} gatewayHost
2544
- * @param {boolean} isSecure
2767
+ * @param {Backend} backend
2545
2768
  * @param {Identifier} accountIdentifier
2546
2769
  * @returns {Promise<string | undefined>}
2547
2770
  */
2548
- export function getInboxIdForIdentifier(host, gatewayHost, isSecure, accountIdentifier) {
2549
- const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2550
- const len0 = WASM_VECTOR_LEN;
2551
- var ptr1 = isLikeNone(gatewayHost) ? 0 : passStringToWasm0(gatewayHost, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2552
- var len1 = WASM_VECTOR_LEN;
2553
- const ret = wasm.getInboxIdForIdentifier(ptr0, len0, ptr1, len1, isSecure, accountIdentifier);
2771
+ export function getInboxIdForIdentifier(backend, accountIdentifier) {
2772
+ _assertClass(backend, Backend);
2773
+ const ret = wasm.getInboxIdForIdentifier(backend.__wbg_ptr, accountIdentifier);
2554
2774
  return ret;
2555
2775
  }
2556
2776
 
2557
2777
  /**
2558
- * @param {string} host
2559
- * @param {string | null | undefined} gatewayHost
2778
+ * @param {Backend} backend
2560
2779
  * @param {string[]} inboxIds
2561
2780
  * @returns {Promise<InboxState[]>}
2562
2781
  */
2563
- export function inboxStateFromInboxIds(host, gatewayHost, inboxIds) {
2564
- const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2782
+ export function inboxStateFromInboxIds(backend, inboxIds) {
2783
+ _assertClass(backend, Backend);
2784
+ const ptr0 = passArrayJsValueToWasm0(inboxIds, wasm.__wbindgen_malloc);
2565
2785
  const len0 = WASM_VECTOR_LEN;
2566
- var ptr1 = isLikeNone(gatewayHost) ? 0 : passStringToWasm0(gatewayHost, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2567
- var len1 = WASM_VECTOR_LEN;
2568
- const ptr2 = passArrayJsValueToWasm0(inboxIds, wasm.__wbindgen_malloc);
2569
- const len2 = WASM_VECTOR_LEN;
2570
- const ret = wasm.inboxStateFromInboxIds(ptr0, len0, ptr1, len1, ptr2, len2);
2786
+ const ret = wasm.inboxStateFromInboxIds(backend.__wbg_ptr, ptr0, len0);
2571
2787
  return ret;
2572
2788
  }
2573
2789
 
@@ -2693,23 +2909,19 @@ export function opfsPoolCapacity() {
2693
2909
  }
2694
2910
 
2695
2911
  /**
2696
- * @param {string} host
2697
- * @param {string | null | undefined} gatewayHost
2912
+ * @param {Backend} backend
2698
2913
  * @param {Identifier} recoveryIdentifier
2699
2914
  * @param {string} inboxId
2700
2915
  * @param {Uint8Array[]} installationIds
2701
2916
  * @returns {SignatureRequestHandle}
2702
2917
  */
2703
- export function revokeInstallationsSignatureRequest(host, gatewayHost, recoveryIdentifier, inboxId, installationIds) {
2704
- const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2918
+ export function revokeInstallationsSignatureRequest(backend, recoveryIdentifier, inboxId, installationIds) {
2919
+ _assertClass(backend, Backend);
2920
+ const ptr0 = passStringToWasm0(inboxId, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2705
2921
  const len0 = WASM_VECTOR_LEN;
2706
- var ptr1 = isLikeNone(gatewayHost) ? 0 : passStringToWasm0(gatewayHost, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2707
- var len1 = WASM_VECTOR_LEN;
2708
- const ptr2 = passStringToWasm0(inboxId, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2709
- const len2 = WASM_VECTOR_LEN;
2710
- const ptr3 = passArrayJsValueToWasm0(installationIds, wasm.__wbindgen_malloc);
2711
- const len3 = WASM_VECTOR_LEN;
2712
- const ret = wasm.revokeInstallationsSignatureRequest(ptr0, len0, ptr1, len1, recoveryIdentifier, ptr2, len2, ptr3, len3);
2922
+ const ptr1 = passArrayJsValueToWasm0(installationIds, wasm.__wbindgen_malloc);
2923
+ const len1 = WASM_VECTOR_LEN;
2924
+ const ret = wasm.revokeInstallationsSignatureRequest(backend.__wbg_ptr, recoveryIdentifier, ptr0, len0, ptr1, len1);
2713
2925
  if (ret[2]) {
2714
2926
  throw takeFromExternrefTable0(ret[1]);
2715
2927
  }
@@ -3754,22 +3966,22 @@ function __wbg_get_imports() {
3754
3966
  return ret;
3755
3967
  }, arguments); },
3756
3968
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
3757
- // Cast intrinsic for `Closure(Closure { dtor_idx: 7063, function: Function { arguments: [], shim_idx: 7064, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3969
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 7145, function: Function { arguments: [], shim_idx: 7146, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3758
3970
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__he86c9d9bb368f43f, wasm_bindgen__convert__closures_____invoke__h7478175f8808d1fa);
3759
3971
  return ret;
3760
3972
  },
3761
3973
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
3762
- // Cast intrinsic for `Closure(Closure { dtor_idx: 7253, function: Function { arguments: [], shim_idx: 7254, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3974
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 7347, function: Function { arguments: [], shim_idx: 7348, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3763
3975
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h213ec6c0cfaa8daa, wasm_bindgen__convert__closures_____invoke__h7d2ee1dee7ec118b);
3764
3976
  return ret;
3765
3977
  },
3766
3978
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
3767
- // Cast intrinsic for `Closure(Closure { dtor_idx: 7423, function: Function { arguments: [], shim_idx: 7424, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3979
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 8370, function: Function { arguments: [], shim_idx: 8371, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3768
3980
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h006fa4718e4400fc, wasm_bindgen__convert__closures_____invoke__h48de3f26adb3eb8d);
3769
3981
  return ret;
3770
3982
  },
3771
3983
  __wbindgen_cast_0000000000000004: function(arg0, arg1) {
3772
- // Cast intrinsic for `Closure(Closure { dtor_idx: 7815, function: Function { arguments: [Externref], shim_idx: 7816, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3984
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 8855, function: Function { arguments: [Externref], shim_idx: 8856, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3773
3985
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hd56fbfc240f3eed8, wasm_bindgen__convert__closures_____invoke__h01ab1ec45c07a95b);
3774
3986
  return ret;
3775
3987
  },
@@ -3893,6 +4105,12 @@ const __wbindgen_enum_RequestRedirect = ["follow", "error", "manual"];
3893
4105
  const AuthHandleFinalization = (typeof FinalizationRegistry === 'undefined')
3894
4106
  ? { register: () => {}, unregister: () => {} }
3895
4107
  : new FinalizationRegistry(ptr => wasm.__wbg_authhandle_free(ptr >>> 0, 1));
4108
+ const BackendFinalization = (typeof FinalizationRegistry === 'undefined')
4109
+ ? { register: () => {}, unregister: () => {} }
4110
+ : new FinalizationRegistry(ptr => wasm.__wbg_backend_free(ptr >>> 0, 1));
4111
+ const BackendBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
4112
+ ? { register: () => {}, unregister: () => {} }
4113
+ : new FinalizationRegistry(ptr => wasm.__wbg_backendbuilder_free(ptr >>> 0, 1));
3896
4114
  const ClientFinalization = (typeof FinalizationRegistry === 'undefined')
3897
4115
  ? { register: () => {}, unregister: () => {} }
3898
4116
  : new FinalizationRegistry(ptr => wasm.__wbg_client_free(ptr >>> 0, 1));
Binary file
@@ -1,72 +1,64 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const generateInboxId: (a: any, b: number, c: bigint) => [number, number, number, number];
5
- export const getInboxIdForIdentifier: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
4
+ export const __wbg_authhandle_free: (a: number, b: number) => void;
5
+ export const authhandle_id: (a: number) => number;
6
+ export const authhandle_new: () => number;
7
+ export const authhandle_set: (a: number, b: any) => any;
6
8
  export const client_fetchLatestInboxUpdatesCount: (a: number, b: number, c: number, d: number) => any;
7
9
  export const client_fetchOwnInboxUpdatesCount: (a: number, b: number) => any;
8
10
  export const client_getKeyPackageStatusesForInstallationIds: (a: number, b: number, c: number) => any;
9
11
  export const client_getLatestInboxState: (a: number, b: number, c: number) => any;
10
12
  export const client_inboxState: (a: number, b: number) => any;
11
- export const contentTypeGroupUpdated: () => any;
12
- export const contentTypeLeaveRequest: () => any;
13
- export const contentTypeMarkdown: () => any;
14
- export const contentTypeReaction: () => any;
15
- export const contentTypeRemoteAttachment: () => any;
16
- export const contentTypeText: () => any;
17
- export const contentTypeWalletSendCalls: () => any;
18
- export const decryptAttachment: (a: number, b: number, c: any) => [number, number, number];
19
- export const encodeMarkdown: (a: number, b: number) => [number, number, number];
20
- export const encodeReaction: (a: any) => [number, number, number];
21
- export const encodeRemoteAttachment: (a: any) => [number, number, number];
22
- export const encodeText: (a: number, b: number) => [number, number, number];
23
- export const encodeWalletSendCalls: (a: any) => [number, number, number];
24
- export const encryptAttachment: (a: any) => [number, number, number];
25
- export const inboxStateFromInboxIds: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
26
- export const metadataFieldName: (a: number) => [number, number];
27
- export const __wbg_authhandle_free: (a: number, b: number) => void;
28
- export const authhandle_id: (a: number) => number;
29
- export const authhandle_new: () => number;
30
- export const authhandle_set: (a: number, b: any) => any;
31
- export const client_getConsentState: (a: number, b: number, c: number, d: number) => any;
32
- export const client_setConsentStates: (a: number, b: number, c: number) => any;
33
- export const conversation_consentState: (a: number) => [number, number, number];
34
- export const conversation_updateConsentState: (a: number, b: number) => [number, number];
35
- export const opfsClearAll: () => any;
36
- export const opfsDeleteFile: (a: number, b: number) => any;
37
- export const opfsExportDb: (a: number, b: number) => any;
38
- export const opfsFileCount: () => any;
39
- export const opfsFileExists: (a: number, b: number) => any;
40
- export const opfsImportDb: (a: number, b: number, c: any) => any;
41
- export const opfsInit: () => any;
42
- export const opfsListFiles: () => any;
43
- export const opfsPoolCapacity: () => any;
13
+ export const inboxStateFromInboxIds: (a: number, b: number, c: number) => any;
14
+ export const __wbg_backend_free: (a: number, b: number) => void;
15
+ export const __wbg_backendbuilder_free: (a: number, b: number) => void;
16
+ export const __wbg_get_backendbuilder_env: (a: number) => number;
17
+ export const __wbg_get_backendbuilder_readonly: (a: number) => number;
18
+ export const __wbg_set_backendbuilder_env: (a: number, b: number) => void;
19
+ export const __wbg_set_backendbuilder_readonly: (a: number, b: number) => void;
20
+ export const __wbg_signaturerequesthandle_free: (a: number, b: number) => void;
21
+ export const applySignatureRequest: (a: number, b: number) => any;
22
+ export const backend_appVersion: (a: number) => [number, number];
23
+ export const backend_env: (a: number) => number;
24
+ export const backend_gatewayHost: (a: number) => [number, number];
25
+ export const backend_v3Host: (a: number) => [number, number];
26
+ export const backendbuilder_authCallback: (a: number, b: any) => void;
27
+ export const backendbuilder_authHandle: (a: number, b: number) => void;
28
+ export const backendbuilder_build: (a: number) => [number, number, number];
29
+ export const backendbuilder_new: (a: number) => number;
30
+ export const backendbuilder_setApiUrl: (a: number, b: number, c: number) => number;
31
+ export const backendbuilder_setAppVersion: (a: number, b: number, c: number) => number;
32
+ export const backendbuilder_setGatewayHost: (a: number, b: number, c: number) => number;
33
+ export const backendbuilder_setReadonly: (a: number, b: number) => number;
34
+ export const client_addWalletSignatureRequest: (a: number, b: any) => any;
35
+ export const client_applySignatureRequest: (a: number, b: number) => any;
36
+ export const client_changeRecoveryIdentifierSignatureRequest: (a: number, b: any) => any;
37
+ export const client_createInboxSignatureRequest: (a: number) => [number, number, number];
38
+ export const client_registerIdentity: (a: number, b: number) => any;
39
+ export const client_revokeAllOtherInstallationsSignatureRequest: (a: number) => any;
40
+ export const client_revokeInstallationsSignatureRequest: (a: number, b: number, c: number) => any;
41
+ export const client_revokeWalletSignatureRequest: (a: number, b: any) => any;
42
+ export const client_signWithInstallationKey: (a: number, b: number, c: number) => [number, number, number];
43
+ export const client_verifySignedWithInstallationKey: (a: number, b: number, c: number, d: any) => [number, number];
44
+ export const createClientWithBackend: (a: number, b: number, c: number, d: any, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: bigint) => any;
45
+ export const revokeInstallationsSignatureRequest: (a: number, b: any, c: number, d: number, e: number, f: number) => [number, number, number];
46
+ export const signaturerequesthandle_addEcdsaSignature: (a: number, b: any) => any;
47
+ export const signaturerequesthandle_addPasskeySignature: (a: number, b: any) => any;
48
+ export const signaturerequesthandle_addScwSignature: (a: number, b: any, c: any, d: bigint, e: number, f: bigint) => any;
49
+ export const signaturerequesthandle_signatureText: (a: number) => any;
50
+ export const verifySignedWithPublicKey: (a: number, b: number, c: any, d: any) => [number, number];
51
+ export const contentTypeReply: () => any;
44
52
  export const __wbg_client_free: (a: number, b: number) => void;
45
- export const __wbg_conversation_free: (a: number, b: number) => void;
46
- export const __wbg_conversationlistitem_free: (a: number, b: number) => void;
47
- export const __wbg_conversations_free: (a: number, b: number) => void;
48
53
  export const __wbg_devicesync_free: (a: number, b: number) => void;
49
- export const __wbg_get_conversationlistitem_conversation: (a: number) => number;
50
- export const __wbg_get_conversationlistitem_isCommitLogForked: (a: number) => number;
51
- export const __wbg_get_conversationlistitem_lastMessage: (a: number) => any;
52
- export const __wbg_set_conversationlistitem_conversation: (a: number, b: number) => void;
53
- export const __wbg_set_conversationlistitem_isCommitLogForked: (a: number, b: number) => void;
54
- export const __wbg_set_conversationlistitem_lastMessage: (a: number, b: number) => void;
55
- export const __wbg_signaturerequesthandle_free: (a: number, b: number) => void;
56
- export const __wbg_streamcloser_free: (a: number, b: number) => void;
57
- export const applySignatureRequest: (a: number, b: number, c: number, d: number, e: number) => any;
58
54
  export const client_accountIdentifier: (a: number) => any;
59
- export const client_addWalletSignatureRequest: (a: number, b: any) => any;
60
55
  export const client_apiAggregateStatistics: (a: number) => [number, number];
61
56
  export const client_apiIdentityStatistics: (a: number) => any;
62
57
  export const client_apiStatistics: (a: number) => any;
63
58
  export const client_appVersion: (a: number) => [number, number];
64
- export const client_applySignatureRequest: (a: number, b: number) => any;
65
59
  export const client_canMessage: (a: number, b: number, c: number) => any;
66
- export const client_changeRecoveryIdentifierSignatureRequest: (a: number, b: any) => any;
67
60
  export const client_clearAllStatistics: (a: number) => void;
68
61
  export const client_conversations: (a: number) => number;
69
- export const client_createInboxSignatureRequest: (a: number) => [number, number, number];
70
62
  export const client_device_sync: (a: number) => number;
71
63
  export const client_findInboxIdByIdentity: (a: number, b: any) => any;
72
64
  export const client_inboxId: (a: number) => [number, number];
@@ -75,13 +67,57 @@ export const client_installationId: (a: number) => [number, number];
75
67
  export const client_installationIdBytes: (a: number) => any;
76
68
  export const client_isRegistered: (a: number) => number;
77
69
  export const client_libxmtpVersion: (a: number) => [number, number];
78
- export const client_registerIdentity: (a: number, b: number) => any;
79
- export const client_revokeAllOtherInstallationsSignatureRequest: (a: number) => any;
80
- export const client_revokeInstallationsSignatureRequest: (a: number, b: number, c: number) => any;
81
- export const client_revokeWalletSignatureRequest: (a: number, b: any) => any;
82
- export const client_signWithInstallationKey: (a: number, b: number, c: number) => [number, number, number];
83
70
  export const client_syncPreferences: (a: number) => any;
84
- export const client_verifySignedWithInstallationKey: (a: number, b: number, c: number, d: any) => [number, number];
71
+ export const contentTypeAttachment: () => any;
72
+ export const contentTypeIntent: () => any;
73
+ export const contentTypeLeaveRequest: () => any;
74
+ export const contentTypeMarkdown: () => any;
75
+ export const contentTypeReadReceipt: () => any;
76
+ export const contentTypeText: () => any;
77
+ export const createClient: (a: number, b: number, c: number, d: number, e: any, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: bigint, r: number, s: number, t: number) => any;
78
+ export const devicesync_archiveMetadata: (a: number, b: any, c: any) => any;
79
+ export const devicesync_createArchive: (a: number, b: any, c: any) => any;
80
+ export const devicesync_importArchive: (a: number, b: any, c: any) => any;
81
+ export const devicesync_listAvailableArchives: (a: number, b: bigint) => [number, number, number, number];
82
+ export const devicesync_processSyncArchive: (a: number, b: number, c: number) => any;
83
+ export const devicesync_sendSyncArchive: (a: number, b: any, c: number, d: number, e: number, f: number) => any;
84
+ export const devicesync_sendSyncRequest: (a: number, b: any, c: number, d: number) => any;
85
+ export const devicesync_syncAllDeviceSyncGroups: (a: number) => any;
86
+ export const encodeAttachment: (a: any) => [number, number, number];
87
+ export const encodeIntent: (a: any) => [number, number, number];
88
+ export const encodeMarkdown: (a: number, b: number) => [number, number, number];
89
+ export const encodeReadReceipt: (a: any) => [number, number, number];
90
+ export const encodeText: (a: number, b: number) => [number, number, number];
91
+ export const generateInboxId: (a: any, b: number, c: bigint) => [number, number, number, number];
92
+ export const getInboxIdForIdentifier: (a: number, b: any) => any;
93
+ export const __wbg_streamcloser_free: (a: number, b: number) => void;
94
+ export const contentTypeActions: () => any;
95
+ export const contentTypeGroupUpdated: () => any;
96
+ export const contentTypeMultiRemoteAttachment: () => any;
97
+ export const contentTypeReaction: () => any;
98
+ export const contentTypeTransactionReference: () => any;
99
+ export const contentTypeWalletSendCalls: () => any;
100
+ export const encodeActions: (a: any) => [number, number, number];
101
+ export const encodeMultiRemoteAttachment: (a: any) => [number, number, number];
102
+ export const encodeReaction: (a: any) => [number, number, number];
103
+ export const encodeTransactionReference: (a: any) => [number, number, number];
104
+ export const encodeWalletSendCalls: (a: any) => [number, number, number];
105
+ export const streamcloser_end: (a: number) => void;
106
+ export const streamcloser_endAndWait: (a: number) => any;
107
+ export const streamcloser_isClosed: (a: number) => number;
108
+ export const streamcloser_waitForReady: (a: number) => any;
109
+ export const __wbg_conversation_free: (a: number, b: number) => void;
110
+ export const __wbg_conversationlistitem_free: (a: number, b: number) => void;
111
+ export const __wbg_conversations_free: (a: number, b: number) => void;
112
+ export const __wbg_get_conversationlistitem_conversation: (a: number) => number;
113
+ export const __wbg_get_conversationlistitem_isCommitLogForked: (a: number) => number;
114
+ export const __wbg_get_conversationlistitem_lastMessage: (a: number) => any;
115
+ export const __wbg_set_conversationlistitem_conversation: (a: number, b: number) => void;
116
+ export const __wbg_set_conversationlistitem_isCommitLogForked: (a: number, b: number) => void;
117
+ export const __wbg_set_conversationlistitem_lastMessage: (a: number, b: number) => void;
118
+ export const client_getConsentState: (a: number, b: number, c: number, d: number) => any;
119
+ export const client_setConsentStates: (a: number, b: number, c: number) => any;
120
+ export const contentTypeRemoteAttachment: () => any;
85
121
  export const conversation_addAdmin: (a: number, b: number, c: number) => any;
86
122
  export const conversation_addMembers: (a: number, b: number, c: number) => any;
87
123
  export const conversation_addMembersByIdentity: (a: number, b: number, c: number) => any;
@@ -89,6 +125,7 @@ export const conversation_addSuperAdmin: (a: number, b: number, c: number) => an
89
125
  export const conversation_addedByInboxId: (a: number) => [number, number, number, number];
90
126
  export const conversation_adminList: (a: number) => [number, number, number, number];
91
127
  export const conversation_appData: (a: number) => [number, number, number, number];
128
+ export const conversation_consentState: (a: number) => [number, number, number];
92
129
  export const conversation_countMessages: (a: number, b: number) => any;
93
130
  export const conversation_createdAtNs: (a: number) => bigint;
94
131
  export const conversation_dmPeerInboxId: (a: number) => [number, number, number, number];
@@ -139,6 +176,7 @@ export const conversation_stream: (a: number, b: any) => [number, number, number
139
176
  export const conversation_superAdminList: (a: number) => [number, number, number, number];
140
177
  export const conversation_sync: (a: number) => any;
141
178
  export const conversation_updateAppData: (a: number, b: number, c: number) => any;
179
+ export const conversation_updateConsentState: (a: number, b: number) => [number, number];
142
180
  export const conversation_updateGroupDescription: (a: number, b: number, c: number) => any;
143
181
  export const conversation_updateGroupImageUrlSquare: (a: number, b: number, c: number) => any;
144
182
  export const conversation_updateGroupName: (a: number, b: number, c: number) => any;
@@ -165,38 +203,19 @@ export const conversations_streamMessageDeletions: (a: number, b: any) => [numbe
165
203
  export const conversations_streamPreferences: (a: number, b: any) => [number, number, number];
166
204
  export const conversations_sync: (a: number) => any;
167
205
  export const conversations_syncAllConversations: (a: number, b: number, c: number) => any;
168
- export const createClient: (a: number, b: number, c: number, d: number, e: any, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: bigint, r: number, s: number, t: number) => any;
169
- export const devicesync_archiveMetadata: (a: number, b: any, c: any) => any;
170
- export const devicesync_createArchive: (a: number, b: any, c: any) => any;
171
- export const devicesync_importArchive: (a: number, b: any, c: any) => any;
172
- export const devicesync_listAvailableArchives: (a: number, b: bigint) => [number, number, number, number];
173
- export const devicesync_processSyncArchive: (a: number, b: number, c: number) => any;
174
- export const devicesync_sendSyncArchive: (a: number, b: any, c: number, d: number, e: number, f: number) => any;
175
- export const devicesync_sendSyncRequest: (a: number, b: any, c: number, d: number) => any;
176
- export const devicesync_syncAllDeviceSyncGroups: (a: number) => any;
177
- export const revokeInstallationsSignatureRequest: (a: number, b: number, c: number, d: number, e: any, f: number, g: number, h: number, i: number) => [number, number, number];
178
- export const signaturerequesthandle_addEcdsaSignature: (a: number, b: any) => any;
179
- export const signaturerequesthandle_addPasskeySignature: (a: number, b: any) => any;
180
- export const signaturerequesthandle_addScwSignature: (a: number, b: any, c: any, d: bigint, e: number, f: bigint) => any;
181
- export const signaturerequesthandle_signatureText: (a: number) => any;
182
- export const streamcloser_end: (a: number) => void;
183
- export const streamcloser_endAndWait: (a: number) => any;
184
- export const streamcloser_isClosed: (a: number) => number;
185
- export const streamcloser_waitForReady: (a: number) => any;
186
- export const verifySignedWithPublicKey: (a: number, b: number, c: any, d: any) => [number, number];
187
- export const contentTypeActions: () => any;
188
- export const contentTypeAttachment: () => any;
189
- export const contentTypeIntent: () => any;
190
- export const contentTypeMultiRemoteAttachment: () => any;
191
- export const contentTypeReadReceipt: () => any;
192
- export const contentTypeReply: () => any;
193
- export const contentTypeTransactionReference: () => any;
194
- export const encodeActions: (a: any) => [number, number, number];
195
- export const encodeAttachment: (a: any) => [number, number, number];
196
- export const encodeIntent: (a: any) => [number, number, number];
197
- export const encodeMultiRemoteAttachment: (a: any) => [number, number, number];
198
- export const encodeReadReceipt: (a: any) => [number, number, number];
199
- export const encodeTransactionReference: (a: any) => [number, number, number];
206
+ export const decryptAttachment: (a: number, b: number, c: any) => [number, number, number];
207
+ export const encodeRemoteAttachment: (a: any) => [number, number, number];
208
+ export const encryptAttachment: (a: any) => [number, number, number];
209
+ export const metadataFieldName: (a: number) => [number, number];
210
+ export const opfsClearAll: () => any;
211
+ export const opfsDeleteFile: (a: number, b: number) => any;
212
+ export const opfsExportDb: (a: number, b: number) => any;
213
+ export const opfsFileCount: () => any;
214
+ export const opfsFileExists: (a: number, b: number) => any;
215
+ export const opfsImportDb: (a: number, b: number, c: any) => any;
216
+ export const opfsInit: () => any;
217
+ export const opfsListFiles: () => any;
218
+ export const opfsPoolCapacity: () => any;
200
219
  export const rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
201
220
  export const rust_zstd_wasm_shim_free: (a: number) => void;
202
221
  export const rust_zstd_wasm_shim_malloc: (a: number) => number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmtp/wasm-bindings",
3
- "version": "1.10.0-dev.0d30e0e",
3
+ "version": "1.10.0-dev.2334796",
4
4
  "description": "WASM bindings for the libXMTP rust library",
5
5
  "keywords": [
6
6
  "xmtp",
@@ -66,7 +66,7 @@
66
66
  "@vitest/browser-playwright": "^4.0.8",
67
67
  "@xmtp/content-type-remote-attachment": "^2.0.3",
68
68
  "binaryen": "^125.0.0",
69
- "playwright": "^1.56.1",
69
+ "playwright": "=1.57",
70
70
  "prettier": "^3.7.4",
71
71
  "prettier-plugin-packagejson": "^3.0.0",
72
72
  "tsx": "^4.20.6",