@bounded-sh/client 0.0.3 → 0.0.5
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/dist/hooks/useQuery.d.ts +58 -0
- package/dist/{index-DyfiK3_X.esm.js → index-30RA_Bdf.esm.js} +268 -18
- package/dist/index-30RA_Bdf.esm.js.map +1 -0
- package/dist/{index-DJg-Dduo.esm.js → index-B9DtkVXb.esm.js} +2 -2
- package/dist/{index-DJg-Dduo.esm.js.map → index-B9DtkVXb.esm.js.map} +1 -1
- package/dist/{index-CYVVTWs4.js → index-CdqFc68L.js} +2 -2
- package/dist/{index-CYVVTWs4.js.map → index-CdqFc68L.js.map} +1 -1
- package/dist/{index-C2JpxGAC.js → index-CplhW55m.js} +2 -2
- package/dist/{index-C2JpxGAC.js.map → index-CplhW55m.js.map} +1 -1
- package/dist/{index-C2yvle9S.esm.js → index-DXdFMfDw.esm.js} +2 -2
- package/dist/{index-C2yvle9S.esm.js.map → index-DXdFMfDw.esm.js.map} +1 -1
- package/dist/{index-2UpSvA7V.js → index-ZYhdEVCA.js} +272 -17
- package/dist/index-ZYhdEVCA.js.map +1 -0
- package/dist/{index.browser-pymH6o1X.esm.js → index.browser-Cictefil.esm.js} +2 -2
- package/dist/{index.browser-pymH6o1X.esm.js.map → index.browser-Cictefil.esm.js.map} +1 -1
- package/dist/{index.browser-BTJZmhY1.js → index.browser-sADlt75X.js} +2 -2
- package/dist/{index.browser-BTJZmhY1.js.map → index.browser-sADlt75X.js.map} +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/{index.native-BTjBgNiE.esm.js → index.native-C8GJTcIy.esm.js} +204 -14
- package/dist/index.native-C8GJTcIy.esm.js.map +1 -0
- package/dist/{index.native-BvsmNFXn.js → index.native-DpYQ8GUh.js} +207 -13
- package/dist/index.native-DpYQ8GUh.js.map +1 -0
- package/dist/index.native.d.ts +1 -1
- package/dist/index.native.esm.js +1 -1
- package/dist/index.native.js +5 -1
- package/dist/index.native.js.map +1 -1
- package/dist/{phantom-wallet-provider-BXMvoOrI.js → phantom-wallet-provider-B8gezRxB.js} +3 -3
- package/dist/{phantom-wallet-provider-BXMvoOrI.js.map → phantom-wallet-provider-B8gezRxB.js.map} +1 -1
- package/dist/{phantom-wallet-provider-CTossIFB.esm.js → phantom-wallet-provider-FOSnYV4t.esm.js} +3 -3
- package/dist/{phantom-wallet-provider-CTossIFB.esm.js.map → phantom-wallet-provider-FOSnYV4t.esm.js.map} +1 -1
- package/dist/{privy-wallet-provider-1qE_f-DF.esm.js → privy-wallet-provider-BPOjNW9O.esm.js} +3 -3
- package/dist/{privy-wallet-provider-1qE_f-DF.esm.js.map → privy-wallet-provider-BPOjNW9O.esm.js.map} +1 -1
- package/dist/{privy-wallet-provider-D64DJ3u4.js → privy-wallet-provider-DfR-7xpE.js} +3 -3
- package/dist/{privy-wallet-provider-D64DJ3u4.js.map → privy-wallet-provider-DfR-7xpE.js.map} +1 -1
- package/dist/{solana-mobile-wallet-provider-C1wQ1DRK.js → solana-mobile-wallet-provider-CBAeRxGQ.js} +2 -2
- package/dist/{solana-mobile-wallet-provider-C1wQ1DRK.js.map → solana-mobile-wallet-provider-CBAeRxGQ.js.map} +1 -1
- package/dist/{solana-mobile-wallet-provider-9M8U6AA7.esm.js → solana-mobile-wallet-provider-CoS-38SL.esm.js} +2 -2
- package/dist/{solana-mobile-wallet-provider-9M8U6AA7.esm.js.map → solana-mobile-wallet-provider-CoS-38SL.esm.js.map} +1 -1
- package/package.json +2 -2
- package/dist/index-2UpSvA7V.js.map +0 -1
- package/dist/index-DyfiK3_X.esm.js.map +0 -1
- package/dist/index.native-BTjBgNiE.esm.js.map +0 -1
- package/dist/index.native-BvsmNFXn.js.map +0 -1
|
@@ -10651,6 +10651,87 @@ const pendingRequests = {};
|
|
|
10651
10651
|
const GET_CACHE_TTL = 500; // Adjust this value as needed (in milliseconds)
|
|
10652
10652
|
// Last time we cleaned up the cache
|
|
10653
10653
|
let lastCacheCleanup = Date.now();
|
|
10654
|
+
/**
|
|
10655
|
+
* Return the leaf document key (last path segment) for a document path.
|
|
10656
|
+
*
|
|
10657
|
+
* Bounded rows carry `_id` (and `pathId`) set to the FULL document path
|
|
10658
|
+
* (e.g. `"rooms/r1/prompts/8rd49se3sg"`). Apps that build a child path from a
|
|
10659
|
+
* row naturally want the bare doc key, not the whole path — using the full path
|
|
10660
|
+
* doubles it (`rooms/r1/prompts/rooms/r1/prompts/8rd.../votes/...`) → 403/404.
|
|
10661
|
+
* `docId` extracts that leaf key. Tolerates leading slashes and a trailing `*`.
|
|
10662
|
+
*
|
|
10663
|
+
* @example docId("rooms/r1/prompts/8rd49se3sg") // "8rd49se3sg"
|
|
10664
|
+
*/
|
|
10665
|
+
function docId(path) {
|
|
10666
|
+
if (typeof path !== 'string')
|
|
10667
|
+
return '';
|
|
10668
|
+
let p = path.startsWith('/') ? path.slice(1) : path;
|
|
10669
|
+
if (p.endsWith('*') && p.length > 1)
|
|
10670
|
+
p = p.slice(0, -1);
|
|
10671
|
+
if (p.endsWith('/'))
|
|
10672
|
+
p = p.slice(0, -1);
|
|
10673
|
+
const segments = p.split('/').filter(Boolean);
|
|
10674
|
+
return segments.length ? segments[segments.length - 1] : '';
|
|
10675
|
+
}
|
|
10676
|
+
/**
|
|
10677
|
+
* Additively attach a convenience bare `id` (the leaf doc key) to a returned row.
|
|
10678
|
+
*
|
|
10679
|
+
* Rows already carry `_id`/`pathId` = the full document path; this leaves those
|
|
10680
|
+
* untouched and adds `id` = the last path segment so `row.id` is the doc key apps
|
|
10681
|
+
* expect. No-ops for non-objects, arrays, and rows that already define `id`
|
|
10682
|
+
* (never clobber a user field named `id`). Source for the leaf is `_id` (falling
|
|
10683
|
+
* back to `pathId`/`relativePath`/`absolutePath`).
|
|
10684
|
+
*/
|
|
10685
|
+
function withBareId(row) {
|
|
10686
|
+
var _a, _b, _c;
|
|
10687
|
+
if (!row || typeof row !== 'object' || Array.isArray(row))
|
|
10688
|
+
return row;
|
|
10689
|
+
const r = row;
|
|
10690
|
+
if ('id' in r)
|
|
10691
|
+
return row; // don't clobber an explicit user field
|
|
10692
|
+
const source = (_c = (_b = (_a = r._id) !== null && _a !== void 0 ? _a : r.pathId) !== null && _b !== void 0 ? _b : r.relativePath) !== null && _c !== void 0 ? _c : r.absolutePath;
|
|
10693
|
+
if (typeof source !== 'string' || source.length === 0)
|
|
10694
|
+
return row;
|
|
10695
|
+
const leaf = docId(source);
|
|
10696
|
+
if (!leaf)
|
|
10697
|
+
return row;
|
|
10698
|
+
return Object.assign(Object.assign({}, r), { id: leaf });
|
|
10699
|
+
}
|
|
10700
|
+
/**
|
|
10701
|
+
* Normalize a raw read response from the worker into the SDK's stable shape and
|
|
10702
|
+
* attach the bare `id` to every returned row (Bug 1 + Bug 2).
|
|
10703
|
+
*
|
|
10704
|
+
* - Single-document path: returns EXACTLY ONE shape — the resolved document, or
|
|
10705
|
+
* `null` if missing (Firebase/Mongo convention). Unwraps the ambiguous
|
|
10706
|
+
* `{ data, status }` envelope the worker sometimes emits for a single doc so a
|
|
10707
|
+
* single-doc `get` never sometimes-returns the doc and sometimes the envelope.
|
|
10708
|
+
* - Collection path: preserves the `{ data, nextCursor, ... }` envelope and maps
|
|
10709
|
+
* the bare `id` onto each row in `data`.
|
|
10710
|
+
*/
|
|
10711
|
+
function normalizeReadResult(responseData, pathIsDocument) {
|
|
10712
|
+
if (pathIsDocument) {
|
|
10713
|
+
let doc = responseData;
|
|
10714
|
+
// Unwrap the single-doc envelope `{ data, status }` (Bug 2). A real document
|
|
10715
|
+
// never has the exact shape `{ data, status }` with nothing else meaningful,
|
|
10716
|
+
// so detect the envelope by `data` being present alongside a numeric `status`.
|
|
10717
|
+
if (doc && typeof doc === 'object' && !Array.isArray(doc) &&
|
|
10718
|
+
'data' in doc && 'status' in doc && typeof doc.status === 'number') {
|
|
10719
|
+
doc = doc.data;
|
|
10720
|
+
}
|
|
10721
|
+
if (doc === undefined || doc === null)
|
|
10722
|
+
return null;
|
|
10723
|
+
return withBareId(doc);
|
|
10724
|
+
}
|
|
10725
|
+
// Collection read. The worker body is `{ data: rows[], nextCursor?, status? }`.
|
|
10726
|
+
if (responseData && typeof responseData === 'object' && !Array.isArray(responseData) && Array.isArray(responseData.data)) {
|
|
10727
|
+
return Object.assign(Object.assign({}, responseData), { data: responseData.data.map((row) => withBareId(row)) });
|
|
10728
|
+
}
|
|
10729
|
+
// Some paths return a bare array of rows — map id onto each.
|
|
10730
|
+
if (Array.isArray(responseData)) {
|
|
10731
|
+
return responseData.map((row) => withBareId(row));
|
|
10732
|
+
}
|
|
10733
|
+
return responseData;
|
|
10734
|
+
}
|
|
10654
10735
|
function hashForKey$1(value) {
|
|
10655
10736
|
let h = 5381;
|
|
10656
10737
|
for (let i = 0; i < value.length; i++) {
|
|
@@ -11075,7 +11156,7 @@ async function get(path, opts = {}) {
|
|
|
11075
11156
|
if (hasActiveConnection()) {
|
|
11076
11157
|
if (pathIsDocument) {
|
|
11077
11158
|
const wsResult = await wsGet(normalizedPath);
|
|
11078
|
-
const responseData = wsResult;
|
|
11159
|
+
const responseData = normalizeReadResult(wsResult, true);
|
|
11079
11160
|
if (!opts.bypassCache) {
|
|
11080
11161
|
getCache[cacheKey] = { data: responseData, expiresAt: now + GET_CACHE_TTL };
|
|
11081
11162
|
}
|
|
@@ -11087,7 +11168,7 @@ async function get(path, opts = {}) {
|
|
|
11087
11168
|
sort: undefined,
|
|
11088
11169
|
includeSubPaths: opts.includeSubPaths,
|
|
11089
11170
|
});
|
|
11090
|
-
const responseData = wsResult;
|
|
11171
|
+
const responseData = normalizeReadResult(wsResult, false);
|
|
11091
11172
|
if (!opts.bypassCache) {
|
|
11092
11173
|
getCache[cacheKey] = { data: responseData, expiresAt: now + GET_CACHE_TTL };
|
|
11093
11174
|
}
|
|
@@ -11118,7 +11199,11 @@ async function get(path, opts = {}) {
|
|
|
11118
11199
|
const apiPath = `items?path=${path}${promptQueryParam}${filterParam}${sortParam}${includeSubPathsParam}${shapeParam}${limitParam}${cursorParam}`;
|
|
11119
11200
|
response = await makeApiRequest('GET', apiPath, null, opts._overrides);
|
|
11120
11201
|
}
|
|
11121
|
-
|
|
11202
|
+
// Normalize the worker's raw body into the SDK's stable shape:
|
|
11203
|
+
// - single-doc path → the resolved document or null (Bug 2), and
|
|
11204
|
+
// - collection path → `{ data, nextCursor }` preserved,
|
|
11205
|
+
// with the bare `id` (leaf doc key) attached to every returned row (Bug 1).
|
|
11206
|
+
const responseData = normalizeReadResult(response.data, pathIsDocument);
|
|
11122
11207
|
// Cache the response (unless bypassing cache)
|
|
11123
11208
|
if (!opts.bypassCache) {
|
|
11124
11209
|
getCache[cacheKey] = {
|
|
@@ -11216,11 +11301,16 @@ async function getMany(paths, opts = {}) {
|
|
|
11216
11301
|
const normalizedPath = uncachedPaths[i];
|
|
11217
11302
|
const serverResult = serverResultsMap.get(normalizedPath);
|
|
11218
11303
|
if (serverResult) {
|
|
11219
|
-
|
|
11220
|
-
|
|
11304
|
+
// getMany batches single-doc paths — attach the bare `id` (leaf doc
|
|
11305
|
+
// key) to each returned doc, additive (Bug 1), matching get().
|
|
11306
|
+
const normalizedResult = serverResult.error
|
|
11307
|
+
? serverResult
|
|
11308
|
+
: Object.assign(Object.assign({}, serverResult), { data: withBareId(serverResult.data) });
|
|
11309
|
+
results[originalIndex] = normalizedResult;
|
|
11310
|
+
if (!normalizedResult.error && !opts.bypassCache) {
|
|
11221
11311
|
const cacheKey = `${principalKey}|${normalizedPath}:`;
|
|
11222
11312
|
getCache[cacheKey] = {
|
|
11223
|
-
data:
|
|
11313
|
+
data: normalizedResult.data,
|
|
11224
11314
|
expiresAt: now + GET_CACHE_TTL
|
|
11225
11315
|
};
|
|
11226
11316
|
}
|
|
@@ -11765,6 +11855,7 @@ var operations = /*#__PURE__*/Object.freeze({
|
|
|
11765
11855
|
aggregate: aggregate,
|
|
11766
11856
|
clearReadCacheForAuthChange: clearReadCacheForAuthChange,
|
|
11767
11857
|
count: count,
|
|
11858
|
+
docId: docId,
|
|
11768
11859
|
get: get,
|
|
11769
11860
|
getFiles: getFiles,
|
|
11770
11861
|
getMany: getMany,
|
|
@@ -12352,14 +12443,46 @@ function handleServerMessage(connection, message) {
|
|
|
12352
12443
|
}
|
|
12353
12444
|
}
|
|
12354
12445
|
}
|
|
12446
|
+
/**
|
|
12447
|
+
* Additively attach the bare `id` (leaf doc key) to a subscription row (Bug 1).
|
|
12448
|
+
* Rows carry `_id`/`pathId` = the full document path; this leaves those as-is and
|
|
12449
|
+
* adds `id` = the last path segment so `row.id` is the doc key apps expect. No-ops
|
|
12450
|
+
* for non-objects and rows that already define `id`.
|
|
12451
|
+
*/
|
|
12452
|
+
function withSubscriptionId(row) {
|
|
12453
|
+
var _a, _b, _c;
|
|
12454
|
+
if (!row || typeof row !== 'object' || Array.isArray(row))
|
|
12455
|
+
return row;
|
|
12456
|
+
if ('id' in row)
|
|
12457
|
+
return row;
|
|
12458
|
+
const source = (_c = (_b = (_a = row._id) !== null && _a !== void 0 ? _a : row.pathId) !== null && _b !== void 0 ? _b : row.relativePath) !== null && _c !== void 0 ? _c : row.absolutePath;
|
|
12459
|
+
if (typeof source !== 'string' || source.length === 0)
|
|
12460
|
+
return row;
|
|
12461
|
+
const leaf = docId(source);
|
|
12462
|
+
if (!leaf)
|
|
12463
|
+
return row;
|
|
12464
|
+
return Object.assign(Object.assign({}, row), { id: leaf });
|
|
12465
|
+
}
|
|
12466
|
+
/**
|
|
12467
|
+
* The `onData` payload follows the path: a collection delivers a bare array of
|
|
12468
|
+
* rows, a single-doc path delivers the document (or null). Attach the bare `id`
|
|
12469
|
+
* to each returned row in either case, additive (Bug 1).
|
|
12470
|
+
*/
|
|
12471
|
+
function addIdsToSubscriptionData(data) {
|
|
12472
|
+
if (Array.isArray(data))
|
|
12473
|
+
return data.map(withSubscriptionId);
|
|
12474
|
+
return withSubscriptionId(data);
|
|
12475
|
+
}
|
|
12355
12476
|
function notifyCallbacks(subscription, data) {
|
|
12356
12477
|
var _a;
|
|
12478
|
+
// Attach the bare `id` (leaf doc key) to every delivered row (Bug 1).
|
|
12479
|
+
const decorated = addIdsToSubscriptionData(data);
|
|
12357
12480
|
// Snapshot the callbacks array so that unsubscriptions during
|
|
12358
12481
|
// notification don't cause callbacks to be skipped.
|
|
12359
12482
|
const callbacks = subscription.callbacks.slice();
|
|
12360
12483
|
for (const callback of callbacks) {
|
|
12361
12484
|
try {
|
|
12362
|
-
(_a = callback.onData) === null || _a === void 0 ? void 0 : _a.call(callback,
|
|
12485
|
+
(_a = callback.onData) === null || _a === void 0 ? void 0 : _a.call(callback, decorated);
|
|
12363
12486
|
}
|
|
12364
12487
|
catch (error) {
|
|
12365
12488
|
console.error('[WS v2] Error in subscription callback:', error);
|
|
@@ -12450,7 +12573,7 @@ async function subscribeV2(path, subscriptionOptions, roomRoutePath) {
|
|
|
12450
12573
|
if (cachedEntry && Date.now() - cachedEntry.timestamp < CACHE_TTL && subscriptionOptions.onData) {
|
|
12451
12574
|
setTimeout(() => {
|
|
12452
12575
|
var _a;
|
|
12453
|
-
(_a = subscriptionOptions.onData) === null || _a === void 0 ? void 0 : _a.call(subscriptionOptions, cachedEntry.data);
|
|
12576
|
+
(_a = subscriptionOptions.onData) === null || _a === void 0 ? void 0 : _a.call(subscriptionOptions, addIdsToSubscriptionData(cachedEntry.data));
|
|
12454
12577
|
}, 0);
|
|
12455
12578
|
}
|
|
12456
12579
|
// Get or create connection for this routing target (room-scoped when a
|
|
@@ -12480,7 +12603,7 @@ async function subscribeV2(path, subscriptionOptions, roomRoutePath) {
|
|
|
12480
12603
|
if (existingSubscription.lastData !== undefined && subscriptionOptions.onData) {
|
|
12481
12604
|
setTimeout(() => {
|
|
12482
12605
|
var _a;
|
|
12483
|
-
(_a = subscriptionOptions.onData) === null || _a === void 0 ? void 0 : _a.call(subscriptionOptions, existingSubscription.lastData);
|
|
12606
|
+
(_a = subscriptionOptions.onData) === null || _a === void 0 ? void 0 : _a.call(subscriptionOptions, addIdsToSubscriptionData(existingSubscription.lastData));
|
|
12484
12607
|
}, 0);
|
|
12485
12608
|
}
|
|
12486
12609
|
return async () => {
|
|
@@ -12988,6 +13111,73 @@ function serverTimestamp() {
|
|
|
12988
13111
|
return { operation: 'time', value: 'now' };
|
|
12989
13112
|
}
|
|
12990
13113
|
|
|
13114
|
+
/**
|
|
13115
|
+
* Time units in Bounded — read this once and never get a 1000× timestamp bug.
|
|
13116
|
+
*
|
|
13117
|
+
* **Bounded's policy/proof layer is Unix SECONDS.** `@time.now` in a rule,
|
|
13118
|
+
* `rollingSum` `windowSeconds`, `scheduledAt`, and any timestamp *field your
|
|
13119
|
+
* policy compares against `@time.now`* are all **seconds**. (This is also what
|
|
13120
|
+
* the chain uses — Solana's on-chain clock is `unix_timestamp` in seconds — so a
|
|
13121
|
+
* single seconds unit works for both onchain and offchain rules.)
|
|
13122
|
+
*
|
|
13123
|
+
* **JavaScript is MILLISECONDS.** `Date.now()`, `new Date().getTime()`, and the
|
|
13124
|
+
* auto-stamped system fields `_createdAt` / `_updatedAt` are all **ms**.
|
|
13125
|
+
*
|
|
13126
|
+
* Comparing across the two (e.g. `@time.now - myField` where `myField` was set
|
|
13127
|
+
* from `Date.now()`) is 1000× off, so a freshness / TTL check silently treats
|
|
13128
|
+
* every row as ancient (or far-future) and drops it — which reads as "realtime
|
|
13129
|
+
* isn't delivering" when the data is actually fine.
|
|
13130
|
+
*
|
|
13131
|
+
* **The rules:**
|
|
13132
|
+
* - To **write** a timestamp a policy will read, prefer **`serverTimestamp()`**
|
|
13133
|
+
* (from this package) — the *server* stamps it in seconds, so it matches
|
|
13134
|
+
* `@time.now` AND can't be forged by the client (use it for TTLs, rate windows,
|
|
13135
|
+
* anti-cheat). Use `now()` only when you need the value in client code before
|
|
13136
|
+
* the write.
|
|
13137
|
+
* - To **compare** timestamps in client/render code, use `now()` (seconds), not
|
|
13138
|
+
* `Date.now()` (ms), and `toSeconds()` to convert the ms system fields
|
|
13139
|
+
* (`_createdAt`/`_updatedAt`) or any `Date.now()` value first.
|
|
13140
|
+
*/
|
|
13141
|
+
/**
|
|
13142
|
+
* Current time as a **Unix timestamp in seconds** — the unit Bounded policy rules
|
|
13143
|
+
* use (`@time.now`). Use this (not `Date.now()`) when you need a timestamp in
|
|
13144
|
+
* client code (e.g. a freshness check). For a value you *store* and a policy
|
|
13145
|
+
* reads, prefer the server-authoritative {@link serverTimestamp} instead.
|
|
13146
|
+
*
|
|
13147
|
+
* ```ts
|
|
13148
|
+
* // stale if >15s old — seconds vs seconds ✓
|
|
13149
|
+
* if (now() - doc.lastSeenSeconds > 15) renderStale();
|
|
13150
|
+
* ```
|
|
13151
|
+
*/
|
|
13152
|
+
function now() {
|
|
13153
|
+
return Math.floor(Date.now() / 1000);
|
|
13154
|
+
}
|
|
13155
|
+
/**
|
|
13156
|
+
* Convert a JavaScript millisecond timestamp to Bounded's **seconds**. Accepts a
|
|
13157
|
+
* `Date`, or an ms number such as `Date.now()` or a doc's `_createdAt` /
|
|
13158
|
+
* `_updatedAt` system field.
|
|
13159
|
+
*
|
|
13160
|
+
* ```ts
|
|
13161
|
+
* // doc is >15s old (compare the ms system field in seconds):
|
|
13162
|
+
* if (now() - toSeconds(doc._updatedAt) > 15) renderStale();
|
|
13163
|
+
* ```
|
|
13164
|
+
*/
|
|
13165
|
+
function toSeconds(msOrDate) {
|
|
13166
|
+
const ms = msOrDate instanceof Date ? msOrDate.getTime() : msOrDate;
|
|
13167
|
+
return Math.floor(ms / 1000);
|
|
13168
|
+
}
|
|
13169
|
+
/**
|
|
13170
|
+
* Convert a Bounded **seconds** timestamp back to JavaScript **milliseconds** —
|
|
13171
|
+
* e.g. to build a `Date` or do client-side date math/formatting.
|
|
13172
|
+
*
|
|
13173
|
+
* ```ts
|
|
13174
|
+
* new Date(toMillis(doc.createdAtSeconds)).toLocaleString();
|
|
13175
|
+
* ```
|
|
13176
|
+
*/
|
|
13177
|
+
function toMillis(seconds) {
|
|
13178
|
+
return seconds * 1000;
|
|
13179
|
+
}
|
|
13180
|
+
|
|
12991
13181
|
// ---------------------------------------------------------------------------
|
|
12992
13182
|
// realtime-store.ts — Client-side state manager for realtime apps.
|
|
12993
13183
|
//
|
|
@@ -21054,17 +21244,17 @@ function clearIncompatibleSession() {
|
|
|
21054
21244
|
// Lazy loaders for web-only providers.
|
|
21055
21245
|
// Using dynamic import() ensures Metro (RN) never resolves these modules.
|
|
21056
21246
|
async function loadPhantomWalletProvider() {
|
|
21057
|
-
const mod = await Promise.resolve().then(function () { return require('./phantom-wallet-provider-
|
|
21247
|
+
const mod = await Promise.resolve().then(function () { return require('./phantom-wallet-provider-B8gezRxB.js'); });
|
|
21058
21248
|
return { PhantomWalletProvider: mod.PhantomWalletProvider };
|
|
21059
21249
|
}
|
|
21060
21250
|
// Web Privy provider (depends on react-dom + @privy-io/react-auth). Lazy so Metro
|
|
21061
21251
|
// never bundles it into the RN build — RN uses the @privy-io/expo provider instead.
|
|
21062
21252
|
async function loadPrivyWalletProvider() {
|
|
21063
|
-
const mod = await Promise.resolve().then(function () { return require('./privy-wallet-provider-
|
|
21253
|
+
const mod = await Promise.resolve().then(function () { return require('./privy-wallet-provider-DfR-7xpE.js'); });
|
|
21064
21254
|
return mod.PrivyWalletProvider;
|
|
21065
21255
|
}
|
|
21066
21256
|
async function loadSolanaMobileWalletProvider() {
|
|
21067
|
-
const mod = await Promise.resolve().then(function () { return require('./solana-mobile-wallet-provider-
|
|
21257
|
+
const mod = await Promise.resolve().then(function () { return require('./solana-mobile-wallet-provider-CBAeRxGQ.js'); });
|
|
21068
21258
|
return mod.SolanaMobileWalletProvider;
|
|
21069
21259
|
}
|
|
21070
21260
|
async function hotSwapToMWAProvider(config) {
|
|
@@ -22075,6 +22265,7 @@ exports.deriveUserIdentityFromIdToken = deriveUserIdentityFromIdToken;
|
|
|
22075
22265
|
exports.deserializeTransaction = deserializeTransaction;
|
|
22076
22266
|
exports.detectAndroid = detectAndroid;
|
|
22077
22267
|
exports.detectMobile = detectMobile;
|
|
22268
|
+
exports.docId = docId;
|
|
22078
22269
|
exports.functions = functions;
|
|
22079
22270
|
exports.genAuthNonce = genAuthNonce;
|
|
22080
22271
|
exports.genSolanaMessage = genSolanaMessage;
|
|
@@ -22107,6 +22298,7 @@ exports.loginWithPopup = loginWithPopup;
|
|
|
22107
22298
|
exports.loginWithPrivy = loginWithPrivy;
|
|
22108
22299
|
exports.loginWithRedirect = loginWithRedirect;
|
|
22109
22300
|
exports.logout = logout;
|
|
22301
|
+
exports.now = now;
|
|
22110
22302
|
exports.onAuthLoadingChanged = onAuthLoadingChanged;
|
|
22111
22303
|
exports.onAuthStateChanged = onAuthStateChanged;
|
|
22112
22304
|
exports.queryAggregate = queryAggregate;
|
|
@@ -22135,6 +22327,8 @@ exports.signTransaction = signTransaction;
|
|
|
22135
22327
|
exports.status = status;
|
|
22136
22328
|
exports.subscribe = subscribe;
|
|
22137
22329
|
exports.subscribeView = subscribeView;
|
|
22330
|
+
exports.toMillis = toMillis;
|
|
22331
|
+
exports.toSeconds = toSeconds;
|
|
22138
22332
|
exports.useAuth = useAuth;
|
|
22139
22333
|
exports.verifyEmailOtp = verifyEmailOtp;
|
|
22140
22334
|
exports.withEffects = withEffects;
|
|
@@ -22143,4 +22337,4 @@ exports.wsGet = wsGet;
|
|
|
22143
22337
|
exports.wsGetMany = wsGetMany;
|
|
22144
22338
|
exports.wsQuery = wsQuery;
|
|
22145
22339
|
exports.wsSet = wsSet;
|
|
22146
|
-
//# sourceMappingURL=index.native-
|
|
22340
|
+
//# sourceMappingURL=index.native-DpYQ8GUh.js.map
|