@tuwaio/pulsar-core 0.1.9 → 0.1.10

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.
Files changed (2) hide show
  1. package/README.md +27 -17
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -54,23 +54,32 @@ This is the main factory function that creates your transaction store. It takes
54
54
  #### **Configuration Example**
55
55
 
56
56
  ```ts
57
- import { createPulsarStore } from '@tuwaio/pulsar-core';
58
- // Example adapter for EVM chains
57
+ import { createBoundedUseStore, createPulsarStore, Transaction } from '@tuwaio/pulsar-core';
59
58
  import { evmAdapter } from '@tuwaio/pulsar-evm';
60
- import { wagmiConfig, chains } from './path/to/your/wagmi/config';
61
-
62
- const pulsarStore = createPulsarStore({
63
- // A unique name for Zustand's persistence middleware. This will be the key in localStorage.
64
- name: 'my-app-pulsar-storage',
65
- // An array of adapters for different blockchain ecosystems.
66
- // Each adapter provides chain-specific logic.
67
- adapter: [
68
- evmAdapter(wagmiConfig, chains),
69
- // ... add other adapters like solanaAdapter here
70
- ],
71
- });
72
-
73
- export default pulsarStore;
59
+
60
+ import { appChains, config } from '@/configs/wagmiConfig';
61
+
62
+ const storageName = 'transactions-tracking-storage';
63
+
64
+ export enum TxType {
65
+ example = 'example',
66
+ }
67
+
68
+ type ExampleTx = Transaction & {
69
+ type: TxType.example;
70
+ payload: {
71
+ value: number;
72
+ };
73
+ };
74
+
75
+ export type TransactionUnion = ExampleTx;
76
+
77
+ export const usePulsarStore = createBoundedUseStore(
78
+ createPulsarStore<TransactionUnion>({
79
+ name: storageName,
80
+ adapter: evmAdapter(config, appChains),
81
+ }),
82
+ );
74
83
  ```
75
84
 
76
85
  ### The Returned Store API
@@ -98,8 +107,9 @@ The `createPulsarStore` function returns a vanilla Zustand store with the follow
98
107
 
99
108
  Pulsar is a modular ecosystem. Here’s how the pieces fit together:
100
109
 
101
- - **`@tuwaio/pulsar-core` (this package):** Provides the generic, headless state machine (`createPulsarStore`). It knows _how_ to manage state but doesn't know anything about specific blockchains.
110
+ - **`@tuwaio/pulsar-core`:** Provides the generic, headless state machine (`createPulsarStore`). It knows _how_ to manage state but doesn't know anything about specific blockchains.
102
111
  - **`@tuwaio/pulsar-evm`**: An adapter that plugs into the `adapters` config. It teaches the core store how to interact with EVM chains (e.g., how to check transaction receipts, get wallet info from Wagmi, etc.).
112
+ - **`@tuwaio/pulsar-solana`**: An adapter that plugs into the `adapters` config. It extends the core store to work with the Solana ecosystem, teaching it how to track transactions, get wallet info from `@wallet-ui/react`, and use Solana RPCs.
103
113
  - **`@tuwaio/pulsar-react`**: Provides React bindings and hooks (like `useInitializeTransactionsPool`) to easily connect the Pulsar store to your React application's lifecycle.
104
114
 
105
115
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuwaio/pulsar-core",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "private": false,
5
5
  "author": "Oleksandr Tkach",
6
6
  "license": "Apache-2.0",