@xmtp/browser-sdk 6.5.0 → 7.0.0-dev.57a7203
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/README.md +17 -0
- package/dist/index.d.ts +342 -100
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/workers/client.js +1 -1
- package/dist/workers/client.js.map +1 -1
- package/package.json +17 -8
- package/src/Client.ts +360 -14
- package/src/Conversation.ts +40 -40
- package/src/WorkerClient.ts +77 -8
- package/src/WorkerConversation.ts +29 -37
- package/src/constants.ts +5 -0
- package/src/index.ts +11 -1
- package/src/types/actions/client.ts +90 -2
- package/src/types/actions/conversation.ts +13 -12
- package/src/types/options.ts +44 -11
- package/src/utils/WorkerBridge.ts +1 -1
- package/src/utils/createBackend.ts +45 -0
- package/src/utils/createClient.ts +65 -27
- package/src/utils/inboxId.ts +5 -15
- package/src/utils/inboxState.ts +5 -9
- package/src/utils/installations.ts +8 -17
- package/src/utils/signer.ts +37 -1
- package/src/workers/client.ts +64 -23
package/README.md
CHANGED
|
@@ -57,6 +57,23 @@ pnpm install @xmtp/browser-sdk
|
|
|
57
57
|
yarn add @xmtp/browser-sdk
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
+
## Signer utilities
|
|
61
|
+
|
|
62
|
+
The SDK exports `createEOASigner` and `createSCWSigner` helper functions for creating XMTP-compatible signers. These require `viem` as a peer dependency, which is optional and only needs to be installed if you use these utilities.
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npm install viem
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Example**
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
import { createEOASigner } from "@xmtp/browser-sdk";
|
|
72
|
+
|
|
73
|
+
// Create an EOA signer (generates a random key if none provided)
|
|
74
|
+
const eoaSigner = createEOASigner();
|
|
75
|
+
```
|
|
76
|
+
|
|
60
77
|
## Developing
|
|
61
78
|
|
|
62
79
|
Run `yarn dev` to build the SDK and watch for changes, which will trigger a rebuild.
|