@pollar/core 0.8.2 → 0.9.0-rc.1
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 +35 -0
- package/dist/adapters/react-native-appstate.d.mts +1 -1
- package/dist/adapters/react-native-appstate.d.ts +1 -1
- package/dist/index.d.mts +996 -96
- package/dist/index.d.ts +996 -96
- package/dist/index.js +546 -112
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +545 -113
- package/dist/index.mjs.map +1 -1
- package/dist/index.rn.d.mts +2 -2
- package/dist/index.rn.d.ts +2 -2
- package/dist/index.rn.js +691 -262
- package/dist/index.rn.js.map +1 -1
- package/dist/index.rn.mjs +690 -263
- package/dist/index.rn.mjs.map +1 -1
- package/dist/{types-84G_htcn.d.mts → types-Dyky8g0p.d.mts} +5 -12
- package/dist/{types-84G_htcn.d.ts → types-Dyky8g0p.d.ts} +5 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -205,6 +205,41 @@ Same as React (`useSyncExternalStore`), plus the entry-file polyfills and inject
|
|
|
205
205
|
React Native sections above. OAuth and external-wallet logins require `openAuthUrl` / `walletAdapter` to be injected
|
|
206
206
|
(the built-in popup/extension adapters are web-only).
|
|
207
207
|
|
|
208
|
+
## Logging
|
|
209
|
+
|
|
210
|
+
The SDK logs through a level-gated logger. Configure it on `PollarClient`:
|
|
211
|
+
|
|
212
|
+
```ts
|
|
213
|
+
const client = new PollarClient({
|
|
214
|
+
apiKey: 'pk_...',
|
|
215
|
+
logLevel: 'warn', // 'silent' | 'error' | 'warn' | 'info' | 'debug' (default 'info')
|
|
216
|
+
});
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Levels are ordered `silent` < `error` < `warn` < `info` < `debug`; setting one emits that level and every more
|
|
220
|
+
important one. `silent` disables all SDK logging. State-transition chatter (`auth:…`, `transaction:…`, `network:…`)
|
|
221
|
+
and retry warnings live at `debug`, so the default `info` keeps the console quiet while still showing lifecycle events
|
|
222
|
+
(Initialized, Session stored/restored, Tokens refreshed) and all warnings/errors.
|
|
223
|
+
|
|
224
|
+
Route logs to your own sink (pino, Sentry breadcrumbs, a test spy…) with `logger` — filtering by `logLevel` still
|
|
225
|
+
applies on top:
|
|
226
|
+
|
|
227
|
+
```ts
|
|
228
|
+
import { PollarClient, type PollarLogger } from '@pollar/core';
|
|
229
|
+
|
|
230
|
+
const sink: PollarLogger = {
|
|
231
|
+
error: (...a) => myLogger.error(...a),
|
|
232
|
+
warn: (...a) => myLogger.warn(...a),
|
|
233
|
+
info: (...a) => myLogger.info(...a),
|
|
234
|
+
debug: (...a) => myLogger.debug(...a),
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
const client = new PollarClient({ apiKey: 'pk_...', logLevel: 'debug', logger: sink });
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
`client.getLogger()` returns the configured logger (used internally by `@pollar/react` so its own logs honor the same
|
|
241
|
+
level + sink). `@pollar/stellar-wallets-kit-adapter` accepts the same `logLevel` / `logger` on its options.
|
|
242
|
+
|
|
208
243
|
## Preserved-on-disk storage shape
|
|
209
244
|
|
|
210
245
|
0.7.0 persists exactly:
|