Skip to content

Commit

Permalink
Merge pull request #393 from xmtp/ar/fix-create-key-bundle-typescript
Browse files Browse the repository at this point in the history
fix: Fix keybundle generic
  • Loading branch information
alexrisch authored May 28, 2024
2 parents 1ffb0be + 358e63f commit 98f6e3b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
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

0 comments on commit 98f6e3b

Please sign in to comment.