Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix keybundle generic #393

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions example/src/types/typeTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,27 @@ export const typeTests = async () => {
await reactionConvo.send({
text: 'text',
})
const keyBundle = await reactionClient.exportKeyBundle()
const keyBundleReactionClient = await Client.createFromKeyBundle<
typeof supportedCodecs
>(keyBundle, {
codecs: supportedCodecs,
})
const reactionKeyBundleConvo = (
await keyBundleReactionClient.conversations.list()
)[0]
await reactionKeyBundleConvo.send({
// @ts-expect-error
sdfsdf: 'sdfsdf',
})
await reactionConvo.send({
reaction: {
action: 'added',
content: '💖',
reference: '123',
schema: 'unicode',
},
})

const messages = await reactionConvo.messages()
const content = messages[0].content()
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class Client<
>(
keyBundle: string,
opts?: Partial<ClientOptions> & { codecs?: ContentCodecs }
): Promise<Client<DefaultContentTypes>> {
): Promise<Client<ContentCodecs>> {
const options = defaultOptions(opts)
const address = await XMTPModule.createFromKeyBundle(
keyBundle,
Expand Down
Loading