@bounded-sh/client 0.0.12 → 0.0.14

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 (34) hide show
  1. package/dist/auth/providers/offchain-auth-provider.d.ts +7 -13
  2. package/dist/auth/providers/phantom-wallet-provider.d.ts +0 -5
  3. package/dist/auth/providers/solana-mobile-wallet-provider.d.ts +0 -5
  4. package/dist/index.js +218 -269
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +218 -269
  7. package/dist/index.mjs.map +1 -1
  8. package/dist/{index.native-CrneKxG9.mjs → index.native-B4qib0WI.mjs} +218 -257
  9. package/dist/index.native-B4qib0WI.mjs.map +1 -0
  10. package/dist/{index.native-BIm0gZmJ.js → index.native-fDOSSF3W.js} +218 -257
  11. package/dist/index.native-fDOSSF3W.js.map +1 -0
  12. package/dist/index.native.js +1 -1
  13. package/dist/index.native.mjs +1 -1
  14. package/dist/{phantom-wallet-provider-CFFRpATv.js → phantom-wallet-provider-B4iCTaUq.js} +3 -6
  15. package/dist/phantom-wallet-provider-B4iCTaUq.js.map +1 -0
  16. package/dist/{phantom-wallet-provider-RQfO7Nq9.mjs → phantom-wallet-provider-DGvW6ecv.mjs} +3 -6
  17. package/dist/phantom-wallet-provider-DGvW6ecv.mjs.map +1 -0
  18. package/dist/{privy-wallet-provider-CuClH2mS.js → privy-wallet-provider-B3FEM7RO.js} +4 -10
  19. package/dist/privy-wallet-provider-B3FEM7RO.js.map +1 -0
  20. package/dist/{privy-wallet-provider-BC6yOHHr.mjs → privy-wallet-provider-CpA0SzjA.mjs} +4 -10
  21. package/dist/privy-wallet-provider-CpA0SzjA.mjs.map +1 -0
  22. package/dist/{solana-mobile-wallet-provider-oPS17lYV.mjs → solana-mobile-wallet-provider-B-Ue0EG9.mjs} +4 -7
  23. package/dist/solana-mobile-wallet-provider-B-Ue0EG9.mjs.map +1 -0
  24. package/dist/{solana-mobile-wallet-provider-DHxdYO4I.js → solana-mobile-wallet-provider-CWidNUHT.js} +4 -7
  25. package/dist/solana-mobile-wallet-provider-CWidNUHT.js.map +1 -0
  26. package/package.json +2 -2
  27. package/dist/index.native-BIm0gZmJ.js.map +0 -1
  28. package/dist/index.native-CrneKxG9.mjs.map +0 -1
  29. package/dist/phantom-wallet-provider-CFFRpATv.js.map +0 -1
  30. package/dist/phantom-wallet-provider-RQfO7Nq9.mjs.map +0 -1
  31. package/dist/privy-wallet-provider-BC6yOHHr.mjs.map +0 -1
  32. package/dist/privy-wallet-provider-CuClH2mS.js.map +0 -1
  33. package/dist/solana-mobile-wallet-provider-DHxdYO4I.js.map +0 -1
  34. package/dist/solana-mobile-wallet-provider-oPS17lYV.mjs.map +0 -1
@@ -11124,39 +11124,8 @@ async function get(path, opts = {}) {
11124
11124
  }
11125
11125
  // Create a new request promise and store it
11126
11126
  const requestPromise = (async () => {
11127
- var _a;
11128
11127
  try {
11129
- // For realtime chains, prefer WebSocket reads (lower latency, already connected)
11130
- const config = await getConfig();
11131
11128
  const pathIsDocument = normalizedPath.split("/").length % 2 === 0;
11132
- if (((_a = config.chain) === null || _a === void 0 ? void 0 : _a.startsWith('realtime_')) && !config.isServer && !opts.prompt && !opts.shape && !opts.cursor && !opts.includeSubPaths && !opts.filter && !opts.sort) {
11133
- try {
11134
- const { wsGet, wsQuery, hasActiveConnection } = await Promise.resolve().then(function () { return subscriptionV2; });
11135
- if (hasActiveConnection()) {
11136
- if (pathIsDocument) {
11137
- const wsResult = await wsGet(normalizedPath);
11138
- const responseData = normalizeReadResult(wsResult, true);
11139
- if (!opts.bypassCache) {
11140
- getCache[cacheKey] = { data: responseData, expiresAt: now + GET_CACHE_TTL };
11141
- }
11142
- return responseData;
11143
- }
11144
- else if (!opts.limit) {
11145
- const wsResult = await wsQuery(normalizedPath, {
11146
- filter: undefined,
11147
- sort: undefined,
11148
- includeSubPaths: opts.includeSubPaths,
11149
- });
11150
- const responseData = normalizeReadResult(wsResult, false);
11151
- if (!opts.bypassCache) {
11152
- getCache[cacheKey] = { data: responseData, expiresAt: now + GET_CACHE_TTL };
11153
- }
11154
- return responseData;
11155
- }
11156
- }
11157
- }
11158
- catch ( /* fall through to HTTP */_b) { /* fall through to HTTP */ }
11159
- }
11160
11129
  // Cache miss or bypass - proceed with HTTP API request
11161
11130
  let response;
11162
11131
  // Build common query params
@@ -11409,7 +11378,7 @@ async function set(path, document, options) {
11409
11378
  return result;
11410
11379
  }
11411
11380
  async function setMany(many, options) {
11412
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
11381
+ var _a, _b, _c, _d, _e, _f, _g;
11413
11382
  // Returns the data that was set, or undefined if the document was already set.
11414
11383
  try {
11415
11384
  const config = await getConfig();
@@ -11446,40 +11415,13 @@ async function setMany(many, options) {
11446
11415
  }
11447
11416
  let setResponse;
11448
11417
  try {
11449
- // For realtime chains, prefer WebSocket if a connection is active (lower latency)
11450
- const useWs = ((_c = config.chain) === null || _c === void 0 ? void 0 : _c.startsWith('realtime_')) && !config.isServer;
11451
- if (useWs) {
11452
- try {
11453
- const { wsSet, hasActiveConnection } = await Promise.resolve().then(function () { return subscriptionV2; });
11454
- if (hasActiveConnection()) {
11455
- // Connection is active — send via WS. If this throws, the write
11456
- // may have been applied server-side (ack lost). Do NOT fall through
11457
- // to HTTP, as that would double-apply non-idempotent ops (Increment).
11458
- const wsResult = await wsSet(documents);
11459
- setResponse = { data: wsResult, status: 200 };
11460
- }
11461
- }
11462
- catch (wsError) {
11463
- // Only fall through to HTTP if the request was never sent (connection not available).
11464
- // If the request was sent and ack was lost (timeout), the server may have
11465
- // applied it — re-sending via HTTP risks double-write for non-idempotent ops.
11466
- const msg = (_d = wsError === null || wsError === void 0 ? void 0 : wsError.message) !== null && _d !== void 0 ? _d : '';
11467
- const neverSent = msg.includes('not available') || msg.includes('connection timeout');
11468
- if (!neverSent) {
11469
- throw wsError;
11470
- }
11471
- // Safe to retry via HTTP — request was never sent
11472
- }
11473
- }
11474
- if (!setResponse) {
11475
- setResponse = await makeApiRequest('PUT', `items`, { documents }, options === null || options === void 0 ? void 0 : options._overrides);
11476
- }
11418
+ setResponse = await makeApiRequest('PUT', `items`, { documents }, options === null || options === void 0 ? void 0 : options._overrides);
11477
11419
  }
11478
11420
  catch (error) {
11479
11421
  if ((error === null || error === void 0 ? void 0 : error.statusCode) === 402 && (error === null || error === void 0 ? void 0 : error.error) === 'INSUFFICIENT_BALANCE') {
11480
- const deficitLamports = Number((_e = error.deficitLamports) !== null && _e !== void 0 ? _e : 0);
11481
- const deficitSol = Number((_f = error.deficitSol) !== null && _f !== void 0 ? _f : deficitLamports / 1000000000);
11482
- throw new InsufficientBalanceError(String((_g = error.address) !== null && _g !== void 0 ? _g : ''), Number((_h = error.balanceLamports) !== null && _h !== void 0 ? _h : 0), Number((_j = error.estimatedCostLamports) !== null && _j !== void 0 ? _j : 0), deficitLamports, deficitSol);
11422
+ const deficitLamports = Number((_c = error.deficitLamports) !== null && _c !== void 0 ? _c : 0);
11423
+ const deficitSol = Number((_d = error.deficitSol) !== null && _d !== void 0 ? _d : deficitLamports / 1000000000);
11424
+ throw new InsufficientBalanceError(String((_e = error.address) !== null && _e !== void 0 ? _e : ''), Number((_f = error.balanceLamports) !== null && _f !== void 0 ? _f : 0), Number((_g = error.estimatedCostLamports) !== null && _g !== void 0 ? _g : 0), deficitLamports, deficitSol);
11483
11425
  }
11484
11426
  throw error;
11485
11427
  }
@@ -11526,7 +11468,7 @@ async function setMany(many, options) {
11526
11468
  else if (setResponse.data &&
11527
11469
  typeof setResponse.data === 'object' &&
11528
11470
  setResponse.data.success === true) {
11529
- const _k = setResponse.data, { success: _success } = _k, rest = __rest$1(_k, ["success"]);
11471
+ const _h = setResponse.data, { success: _success } = _h, rest = __rest$1(_h, ["success"]);
11530
11472
  return Object.assign(Object.assign(Object.assign({}, documents.map(d => d.document)), rest), { transactionId: null });
11531
11473
  }
11532
11474
  else {
@@ -13054,23 +12996,6 @@ async function wsGetMany(paths) {
13054
12996
  }));
13055
12997
  }
13056
12998
 
13057
- var subscriptionV2 = /*#__PURE__*/Object.freeze({
13058
- __proto__: null,
13059
- clearCacheV2: clearCacheV2,
13060
- closeAllSubscriptionsV2: closeAllSubscriptionsV2,
13061
- getCachedDataV2: getCachedDataV2,
13062
- hasActiveConnection: hasActiveConnection,
13063
- reconnectWithNewAuthV2: reconnectWithNewAuthV2,
13064
- subscribeV2: subscribeV2,
13065
- wsDelete: wsDelete,
13066
- wsGet: wsGet,
13067
- wsGetMany: wsGetMany,
13068
- wsIntent: wsIntent,
13069
- wsIntentReliable: wsIntentReliable,
13070
- wsQuery: wsQuery,
13071
- wsSet: wsSet
13072
- });
13073
-
13074
12999
  /**
13075
13000
  * WebSocket Subscription Module
13076
13001
  *
@@ -14881,7 +14806,7 @@ class OffchainAuthProvider {
14881
14806
  // Create modal container
14882
14807
  this.modalContainer = document.createElement("div");
14883
14808
  this.modalContainer.id = "poofnet-unsupported-modal";
14884
- this.modalContainer.innerHTML = this.getUnsupportedModalHTML();
14809
+ this.modalContainer.appendChild(this.buildUnsupportedModalContent());
14885
14810
  document.body.appendChild(this.modalContainer);
14886
14811
  // Add styles
14887
14812
  const style = document.createElement("style");
@@ -14937,38 +14862,6 @@ class OffchainAuthProvider {
14937
14862
  document.addEventListener("keydown", escHandler);
14938
14863
  });
14939
14864
  }
14940
- getUnsupportedModalHTML() {
14941
- return `
14942
- <div class="poofnet-modal-overlay">
14943
- <div class="poofnet-modal-content">
14944
- <button id="poofnet-close-btn" class="poofnet-close-btn" aria-label="Close">
14945
- <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
14946
- <path d="M1 1L13 13M1 13L13 1" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
14947
- </svg>
14948
- </button>
14949
- <div class="poofnet-modal-header">
14950
- <div class="poofnet-modal-icon">⚠️</div>
14951
- <h2 class="poofnet-modal-title">Transaction Not Supported</h2>
14952
- <p class="poofnet-modal-subtitle">Poofnet Simulated Blockchain</p>
14953
- </div>
14954
-
14955
- <div class="poofnet-modal-body">
14956
- <div class="poofnet-info-box" style="background: #fef3c7;">
14957
- <span class="poofnet-info-icon">ℹ️</span>
14958
- <span class="poofnet-info-text" style="color: #92400e;">
14959
- Poofnet is a simulated blockchain and does not support real Solana transactions.
14960
- Deploy your project to mainnet to test real transactions.
14961
- </span>
14962
- </div>
14963
- </div>
14964
-
14965
- <div class="poofnet-modal-footer">
14966
- <button id="poofnet-cancel-btn" class="poofnet-btn poofnet-btn-cancel" style="flex: 1;">Close</button>
14967
- </div>
14968
- </div>
14969
- </div>
14970
- `;
14971
- }
14972
14865
  async showTransactionModal(message) {
14973
14866
  return new Promise((resolve) => {
14974
14867
  // Parse the transaction message for display
@@ -14982,7 +14875,7 @@ class OffchainAuthProvider {
14982
14875
  // Create modal container
14983
14876
  this.modalContainer = document.createElement("div");
14984
14877
  this.modalContainer.id = "poofnet-tx-modal";
14985
- this.modalContainer.innerHTML = this.getModalHTML(parsed, message);
14878
+ this.modalContainer.appendChild(this.buildTransactionModalContent(parsed, message));
14986
14879
  document.body.appendChild(this.modalContainer);
14987
14880
  // Add styles
14988
14881
  const style = document.createElement("style");
@@ -15065,24 +14958,59 @@ class OffchainAuthProvider {
15065
14958
  }, 200);
15066
14959
  }
15067
14960
  }
15068
- /**
15069
- * Escape a value for safe interpolation into an HTML string.
15070
- *
15071
- * Transaction messages are attacker-influenceable (they originate from
15072
- * server responses / app-supplied data), so every value derived from them
15073
- * MUST be escaped before being placed into innerHTML. Without this, a field
15074
- * key/value, path segment, document id, or raw message containing markup
15075
- * such as `<img src=x onerror=...>` would execute in the dApp origin and
15076
- * could exfiltrate the stored session (idToken/refreshToken).
15077
- */
15078
- escapeHtml(value) {
15079
- const str = value === null || value === undefined ? "" : String(value);
15080
- return str
15081
- .replace(/&/g, "&amp;")
15082
- .replace(/</g, "&lt;")
15083
- .replace(/>/g, "&gt;")
15084
- .replace(/"/g, "&quot;")
15085
- .replace(/'/g, "&#39;");
14961
+ createElement(tag, className, text) {
14962
+ const el = document.createElement(tag);
14963
+ if (className)
14964
+ el.className = className;
14965
+ if (text !== undefined)
14966
+ el.textContent = text;
14967
+ return el;
14968
+ }
14969
+ appendTextElement(parent, tag, className, text) {
14970
+ const el = this.createElement(tag, className, text);
14971
+ parent.appendChild(el);
14972
+ return el;
14973
+ }
14974
+ buildModalShell(icon, title) {
14975
+ const overlay = this.createElement("div", "poofnet-modal-overlay");
14976
+ const content = this.createElement("div", "poofnet-modal-content");
14977
+ overlay.appendChild(content);
14978
+ const close = this.createElement("button", "poofnet-close-btn", "×");
14979
+ close.id = "poofnet-close-btn";
14980
+ close.setAttribute("aria-label", "Close");
14981
+ close.type = "button";
14982
+ content.appendChild(close);
14983
+ const header = this.createElement("div", "poofnet-modal-header");
14984
+ this.appendTextElement(header, "div", "poofnet-modal-icon", icon);
14985
+ this.appendTextElement(header, "h2", "poofnet-modal-title", title);
14986
+ this.appendTextElement(header, "p", "poofnet-modal-subtitle", "Poofnet Simulated Blockchain");
14987
+ content.appendChild(header);
14988
+ const body = this.createElement("div", "poofnet-modal-body");
14989
+ content.appendChild(body);
14990
+ const footer = this.createElement("div", "poofnet-modal-footer");
14991
+ content.appendChild(footer);
14992
+ return { overlay, body, footer };
14993
+ }
14994
+ buildInfoBox(text, warning = false) {
14995
+ const info = this.createElement("div", "poofnet-info-box");
14996
+ if (warning)
14997
+ info.style.background = "#fef3c7";
14998
+ this.appendTextElement(info, "span", "poofnet-info-icon", "ℹ️");
14999
+ const infoText = this.createElement("span", "poofnet-info-text", text);
15000
+ if (warning)
15001
+ infoText.style.color = "#92400e";
15002
+ info.appendChild(infoText);
15003
+ return info;
15004
+ }
15005
+ buildUnsupportedModalContent() {
15006
+ const { overlay, body, footer } = this.buildModalShell("⚠️", "Transaction Not Supported");
15007
+ body.appendChild(this.buildInfoBox("Poofnet is a simulated blockchain and does not support real Solana transactions. Deploy your project to mainnet to test real transactions.", true));
15008
+ const close = this.createElement("button", "poofnet-btn poofnet-btn-cancel", "Close");
15009
+ close.id = "poofnet-cancel-btn";
15010
+ close.type = "button";
15011
+ close.style.flex = "1";
15012
+ footer.appendChild(close);
15013
+ return overlay;
15086
15014
  }
15087
15015
  formatPath(path) {
15088
15016
  const parts = path.split("/").filter(Boolean);
@@ -15115,59 +15043,11 @@ class OffchainAuthProvider {
15115
15043
  return `Delete from ${collection}`;
15116
15044
  return isNew ? `Create in ${collection}` : `Update ${collection}`;
15117
15045
  }
15118
- getModalHTML(parsed, rawMessage) {
15046
+ buildTransactionModalContent(parsed, rawMessage) {
15119
15047
  const instructions = parsed.instructions || [];
15120
15048
  // Group instructions by type for summary
15121
15049
  const sets = instructions.filter((i) => i.type === "set");
15122
15050
  const deletes = instructions.filter((i) => i.type === "delete");
15123
- const instructionsList = instructions
15124
- .map((inst) => {
15125
- const { collection, documentId } = this.formatPath(inst.path);
15126
- const isDelete = inst.type === "delete";
15127
- const icon = isDelete ? "🗑️" : "✏️";
15128
- const actionClass = isDelete
15129
- ? "poofnet-action-delete"
15130
- : "poofnet-action-set";
15131
- // Format data fields for display
15132
- let fieldsHtml = "";
15133
- if (inst.data && !isDelete) {
15134
- const fields = Object.entries(inst.data)
15135
- .filter(([key]) => !key.startsWith("_")) // Hide internal fields
15136
- .slice(0, 4);
15137
- if (fields.length > 0) {
15138
- fieldsHtml = `
15139
- <div class="poofnet-fields">
15140
- ${fields
15141
- .map(([key, value]) => `
15142
- <div class="poofnet-field">
15143
- <span class="poofnet-field-key">${this.escapeHtml(key)}:</span>
15144
- <span class="poofnet-field-value">${this.escapeHtml(this.formatFieldValue(value))}</span>
15145
- </div>
15146
- `)
15147
- .join("")}
15148
- ${Object.keys(inst.data).filter((k) => !k.startsWith("_"))
15149
- .length > 4
15150
- ? `<div class="poofnet-field-more">+${Object.keys(inst.data).filter((k) => !k.startsWith("_")).length - 4} more fields</div>`
15151
- : ""}
15152
- </div>
15153
- `;
15154
- }
15155
- }
15156
- return `
15157
- <div class="poofnet-instruction ${actionClass}">
15158
- <div class="poofnet-instruction-header">
15159
- <span class="poofnet-instruction-icon">${icon}</span>
15160
- <span class="poofnet-instruction-action">${isDelete ? "Delete" : "Save"}</span>
15161
- <span class="poofnet-instruction-collection">${this.escapeHtml(collection)}</span>
15162
- </div>
15163
- ${documentId
15164
- ? `<div class="poofnet-instruction-id">ID: ${this.escapeHtml(documentId)}</div>`
15165
- : ""}
15166
- ${fieldsHtml}
15167
- </div>
15168
- `;
15169
- })
15170
- .join("");
15171
15051
  // Create summary text
15172
15052
  let summaryText = "";
15173
15053
  if (sets.length > 0 && deletes.length > 0) {
@@ -15179,50 +15059,65 @@ class OffchainAuthProvider {
15179
15059
  else if (deletes.length > 0) {
15180
15060
  summaryText = `${deletes.length} delete${deletes.length > 1 ? "s" : ""}`;
15181
15061
  }
15182
- return `
15183
- <div class="poofnet-modal-overlay">
15184
- <div class="poofnet-modal-content">
15185
- <button id="poofnet-close-btn" class="poofnet-close-btn" aria-label="Close">
15186
- <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
15187
- <path d="M1 1L13 13M1 13L13 1" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
15188
- </svg>
15189
- </button>
15190
- <div class="poofnet-modal-header">
15191
- <div class="poofnet-modal-icon">🔐</div>
15192
- <h2 class="poofnet-modal-title">Confirm Transaction</h2>
15193
- <p class="poofnet-modal-subtitle">Poofnet Simulated Blockchain</p>
15194
- </div>
15195
-
15196
- <div class="poofnet-modal-body">
15197
- ${instructions.length > 0
15198
- ? `
15199
- ${summaryText
15200
- ? `<div class="poofnet-summary">${summaryText}</div>`
15201
- : ""}
15202
- <div class="poofnet-instructions-list">
15203
- ${instructionsList}
15204
- </div>
15205
- `
15206
- : `
15207
- <div class="poofnet-section">
15208
- <h3 class="poofnet-section-title">Message</h3>
15209
- <pre class="poofnet-raw-message">${this.escapeHtml(rawMessage.slice(0, 200))}${rawMessage.length > 200 ? "..." : ""}</pre>
15210
- </div>
15211
- `}
15212
-
15213
- <div class="poofnet-info-box">
15214
- <span class="poofnet-info-icon">ℹ️</span>
15215
- <span class="poofnet-info-text">This is a simulated transaction. No real fees will be charged.</span>
15216
- </div>
15217
- </div>
15218
-
15219
- <div class="poofnet-modal-footer">
15220
- <button id="poofnet-cancel-btn" class="poofnet-btn poofnet-btn-cancel">Cancel</button>
15221
- <button id="poofnet-confirm-btn" class="poofnet-btn poofnet-btn-confirm">Confirm</button>
15222
- </div>
15223
- </div>
15224
- </div>
15225
- `;
15062
+ const { overlay, body, footer } = this.buildModalShell("🔐", "Confirm Transaction");
15063
+ if (instructions.length > 0) {
15064
+ if (summaryText) {
15065
+ this.appendTextElement(body, "div", "poofnet-summary", summaryText);
15066
+ }
15067
+ const list = this.createElement("div", "poofnet-instructions-list");
15068
+ for (const inst of instructions) {
15069
+ list.appendChild(this.buildInstructionElement(inst));
15070
+ }
15071
+ body.appendChild(list);
15072
+ }
15073
+ else {
15074
+ const section = this.createElement("div", "poofnet-section");
15075
+ this.appendTextElement(section, "h3", "poofnet-section-title", "Message");
15076
+ const raw = this.createElement("pre", "poofnet-raw-message", rawMessage.slice(0, 200) + (rawMessage.length > 200 ? "..." : ""));
15077
+ section.appendChild(raw);
15078
+ body.appendChild(section);
15079
+ }
15080
+ body.appendChild(this.buildInfoBox("This is a simulated transaction. No real fees will be charged."));
15081
+ const cancel = this.createElement("button", "poofnet-btn poofnet-btn-cancel", "Cancel");
15082
+ cancel.id = "poofnet-cancel-btn";
15083
+ cancel.type = "button";
15084
+ footer.appendChild(cancel);
15085
+ const confirm = this.createElement("button", "poofnet-btn poofnet-btn-confirm", "Confirm");
15086
+ confirm.id = "poofnet-confirm-btn";
15087
+ confirm.type = "button";
15088
+ footer.appendChild(confirm);
15089
+ return overlay;
15090
+ }
15091
+ buildInstructionElement(inst) {
15092
+ const { collection, documentId } = this.formatPath(inst.path);
15093
+ const isDelete = inst.type === "delete";
15094
+ const card = this.createElement("div", `poofnet-instruction ${isDelete ? "poofnet-action-delete" : "poofnet-action-set"}`);
15095
+ const header = this.createElement("div", "poofnet-instruction-header");
15096
+ this.appendTextElement(header, "span", "poofnet-instruction-icon", isDelete ? "🗑️" : "✏️");
15097
+ this.appendTextElement(header, "span", "poofnet-instruction-action", isDelete ? "Delete" : "Save");
15098
+ this.appendTextElement(header, "span", "poofnet-instruction-collection", collection);
15099
+ card.appendChild(header);
15100
+ if (documentId) {
15101
+ this.appendTextElement(card, "div", "poofnet-instruction-id", `ID: ${documentId}`);
15102
+ }
15103
+ if (inst.data && !isDelete) {
15104
+ const fieldKeys = Object.keys(inst.data).filter((key) => !key.startsWith("_"));
15105
+ const visibleFields = fieldKeys.slice(0, 4);
15106
+ if (visibleFields.length > 0) {
15107
+ const fields = this.createElement("div", "poofnet-fields");
15108
+ for (const key of visibleFields) {
15109
+ const row = this.createElement("div", "poofnet-field");
15110
+ this.appendTextElement(row, "span", "poofnet-field-key", `${key}:`);
15111
+ this.appendTextElement(row, "span", "poofnet-field-value", this.formatFieldValue(inst.data[key]));
15112
+ fields.appendChild(row);
15113
+ }
15114
+ if (fieldKeys.length > 4) {
15115
+ this.appendTextElement(fields, "div", "poofnet-field-more", `+${fieldKeys.length - 4} more fields`);
15116
+ }
15117
+ card.appendChild(fields);
15118
+ }
15119
+ }
15120
+ return card;
15226
15121
  }
15227
15122
  getModalStyles() {
15228
15123
  return `
@@ -18558,9 +18453,7 @@ const emailProviderSingleton = new EmailAuthProvider();
18558
18453
  function openEmailModal() {
18559
18454
  return new Promise((resolve) => {
18560
18455
  var _a;
18561
- const root = document.createElement('div');
18562
- root.id = 'bounded-auth-modal';
18563
- root.innerHTML = MODAL_HTML;
18456
+ const root = createEmailModalTree();
18564
18457
  const style = document.createElement('style');
18565
18458
  style.textContent = MODAL_CSS;
18566
18459
  root.appendChild(style);
@@ -18648,26 +18541,97 @@ function openEmailModal() {
18648
18541
  });
18649
18542
  });
18650
18543
  }
18651
- const MODAL_HTML = `
18652
- <div class="ba-overlay">
18653
- <div class="ba-card" role="dialog" aria-modal="true" aria-label="Sign in">
18654
- <button id="ba-close" class="ba-x" aria-label="Close">&times;</button>
18655
- <div class="ba-brand"><span class="ba-dot"></span> Sign in</div>
18656
- <div id="ba-email-step">
18657
- <label class="ba-label" for="ba-email">Email</label>
18658
- <input id="ba-email" class="ba-input" type="email" inputmode="email" autocomplete="email" placeholder="you@example.com" />
18659
- <button id="ba-email-btn" class="ba-btn">Continue</button>
18660
- </div>
18661
- <div id="ba-otp-step" class="hidden">
18662
- <label class="ba-label" for="ba-otp">Enter the code sent to <span id="ba-sent-to" class="ba-em"></span></label>
18663
- <input id="ba-otp" class="ba-input ba-code" inputmode="numeric" autocomplete="one-time-code" maxlength="8" placeholder="······" />
18664
- <button id="ba-otp-btn" class="ba-btn">Verify &amp; continue</button>
18665
- <button id="ba-back" class="ba-link">Use a different email</button>
18666
- </div>
18667
- <div id="ba-msg" class="ba-msg"></div>
18668
- <div class="ba-foot">Secured by Bounded</div>
18669
- </div>
18670
- </div>`;
18544
+ function createEmailModalTree() {
18545
+ const root = document.createElement('div');
18546
+ root.id = 'bounded-auth-modal';
18547
+ const overlay = document.createElement('div');
18548
+ overlay.className = 'ba-overlay';
18549
+ root.appendChild(overlay);
18550
+ const card = document.createElement('div');
18551
+ card.className = 'ba-card';
18552
+ card.setAttribute('role', 'dialog');
18553
+ card.setAttribute('aria-modal', 'true');
18554
+ card.setAttribute('aria-label', 'Sign in');
18555
+ overlay.appendChild(card);
18556
+ const close = document.createElement('button');
18557
+ close.id = 'ba-close';
18558
+ close.className = 'ba-x';
18559
+ close.setAttribute('aria-label', 'Close');
18560
+ close.type = 'button';
18561
+ close.textContent = '×';
18562
+ card.appendChild(close);
18563
+ const brand = document.createElement('div');
18564
+ brand.className = 'ba-brand';
18565
+ const dot = document.createElement('span');
18566
+ dot.className = 'ba-dot';
18567
+ brand.appendChild(dot);
18568
+ brand.appendChild(document.createTextNode(' Sign in'));
18569
+ card.appendChild(brand);
18570
+ const emailStep = document.createElement('div');
18571
+ emailStep.id = 'ba-email-step';
18572
+ card.appendChild(emailStep);
18573
+ const emailLabel = document.createElement('label');
18574
+ emailLabel.className = 'ba-label';
18575
+ emailLabel.htmlFor = 'ba-email';
18576
+ emailLabel.textContent = 'Email';
18577
+ emailStep.appendChild(emailLabel);
18578
+ const emailInput = document.createElement('input');
18579
+ emailInput.id = 'ba-email';
18580
+ emailInput.className = 'ba-input';
18581
+ emailInput.type = 'email';
18582
+ emailInput.inputMode = 'email';
18583
+ emailInput.autocomplete = 'email';
18584
+ emailInput.placeholder = 'you@example.com';
18585
+ emailStep.appendChild(emailInput);
18586
+ const emailButton = document.createElement('button');
18587
+ emailButton.id = 'ba-email-btn';
18588
+ emailButton.className = 'ba-btn';
18589
+ emailButton.type = 'button';
18590
+ emailButton.textContent = 'Continue';
18591
+ emailStep.appendChild(emailButton);
18592
+ const otpStep = document.createElement('div');
18593
+ otpStep.id = 'ba-otp-step';
18594
+ otpStep.className = 'hidden';
18595
+ card.appendChild(otpStep);
18596
+ const otpLabel = document.createElement('label');
18597
+ otpLabel.className = 'ba-label';
18598
+ otpLabel.htmlFor = 'ba-otp';
18599
+ otpLabel.appendChild(document.createTextNode('Enter the code sent to '));
18600
+ const sentTo = document.createElement('span');
18601
+ sentTo.id = 'ba-sent-to';
18602
+ sentTo.className = 'ba-em';
18603
+ otpLabel.appendChild(sentTo);
18604
+ otpStep.appendChild(otpLabel);
18605
+ const otpInput = document.createElement('input');
18606
+ otpInput.id = 'ba-otp';
18607
+ otpInput.className = 'ba-input ba-code';
18608
+ otpInput.inputMode = 'numeric';
18609
+ otpInput.autocomplete = 'one-time-code';
18610
+ otpInput.maxLength = 8;
18611
+ otpInput.placeholder = '······';
18612
+ otpStep.appendChild(otpInput);
18613
+ const otpButton = document.createElement('button');
18614
+ otpButton.id = 'ba-otp-btn';
18615
+ otpButton.className = 'ba-btn';
18616
+ otpButton.type = 'button';
18617
+ otpButton.textContent = 'Verify & continue';
18618
+ otpStep.appendChild(otpButton);
18619
+ const backButton = document.createElement('button');
18620
+ backButton.id = 'ba-back';
18621
+ backButton.className = 'ba-link';
18622
+ backButton.type = 'button';
18623
+ backButton.textContent = 'Use a different email';
18624
+ otpStep.appendChild(backButton);
18625
+ const msg = document.createElement('div');
18626
+ msg.id = 'ba-msg';
18627
+ msg.className = 'ba-msg';
18628
+ card.appendChild(msg);
18629
+ const foot = document.createElement('div');
18630
+ foot.className = 'ba-foot';
18631
+ foot.textContent = 'Secured by Bounded';
18632
+ card.appendChild(foot);
18633
+ return root;
18634
+ }
18671
18635
  const MODAL_CSS = `
18672
18636
  #bounded-auth-modal .ba-overlay{position:fixed;inset:0;background:rgba(8,10,18,.62);backdrop-filter:blur(4px);
18673
18637
  display:flex;align-items:center;justify-content:center;z-index:2147483000;opacity:1;transition:opacity .16s ease;
@@ -19055,17 +19019,17 @@ function clearIncompatibleSession() {
19055
19019
  // Lazy loaders for web-only providers.
19056
19020
  // Using dynamic import() ensures Metro (RN) never resolves these modules.
19057
19021
  async function loadPhantomWalletProvider() {
19058
- const mod = await import('./phantom-wallet-provider-RQfO7Nq9.mjs');
19022
+ const mod = await import('./phantom-wallet-provider-DGvW6ecv.mjs');
19059
19023
  return { PhantomWalletProvider: mod.PhantomWalletProvider };
19060
19024
  }
19061
19025
  // Web Privy provider (depends on react-dom + @privy-io/react-auth). Lazy so Metro
19062
19026
  // never bundles it into the RN build — RN uses the @privy-io/expo provider instead.
19063
19027
  async function loadPrivyWalletProvider() {
19064
- const mod = await import('./privy-wallet-provider-BC6yOHHr.mjs');
19028
+ const mod = await import('./privy-wallet-provider-CpA0SzjA.mjs');
19065
19029
  return mod.PrivyWalletProvider;
19066
19030
  }
19067
19031
  async function loadSolanaMobileWalletProvider() {
19068
- const mod = await import('./solana-mobile-wallet-provider-oPS17lYV.mjs');
19032
+ const mod = await import('./solana-mobile-wallet-provider-B-Ue0EG9.mjs');
19069
19033
  return mod.SolanaMobileWalletProvider;
19070
19034
  }
19071
19035
  async function hotSwapToMWAProvider(config) {
@@ -19830,10 +19794,7 @@ class PrivyExpoProvider {
19830
19794
  const rpcUrl = this.getRpcUrl(solTransactionData.network);
19831
19795
  const connection = new Connection(rpcUrl, 'confirmed');
19832
19796
  const remainingAccounts = convertRemainingAccounts(solTransactionData.txArgs[0].remainingAccounts);
19833
- let app_id = solTransactionData.appId;
19834
- if (typeof globalThis !== 'undefined' && globalThis.CUSTOM_BOUNDED_APP_ID_HEADER) {
19835
- app_id = globalThis.CUSTOM_BOUNDED_APP_ID_HEADER;
19836
- }
19797
+ const app_id = solTransactionData.appId;
19837
19798
  if (!app_id) {
19838
19799
  throw new Error('App ID is required');
19839
19800
  }
@@ -20071,4 +20032,4 @@ class PrivyExpoProvider {
20071
20032
  }
20072
20033
 
20073
20034
  export { signTransaction as $, sendEmailOtp as A, sendTextOtp as B, verifyEmailOtp as C, verifyTextOtp as D, linkEmail as E, loginWithPrivy as F, loginWithRedirect as G, linkWithRedirect as H, completeLoginFromRedirect as I, loginWithPopup as J, completeLoginInPopup as K, get as L, getMany as M, docId as N, set as O, setMany as P, setFile as Q, getFiles as R, SOLANA_DEVNET_RPC_URL as S, search as T, queryAggregate as U, runQuery as V, WebSessionManager as W, runQueryMany as X, runExpression as Y, runExpressionMany as Z, signMessage as _, buildSetDocumentsTransaction as a, signAndSubmitTransaction as a0, count as a1, aggregate as a2, subscribe as a3, useAuth as a4, deserializeTransaction as a5, getIdToken as a6, setPlatform as a7, MockAuthProvider as a8, DEFAULT_TEST_ADDRESS as a9, refreshSession as aA, resetRealtimeStore as aB, revokeSession as aC, serverTimestamp as aD, signSessionCreateMessage as aE, subscribeView as aF, toMillis as aG, toSeconds as aH, withEffects as aI, wsDelete as aJ, wsGet as aK, wsGetMany as aL, wsQuery as aM, wsSet as aN, index as aO, OffchainAuthProvider as aa, PrivyExpoProvider as ab, EFFECT_INTENT_ADDRESS as ac, FunctionInvokeError as ad, InsufficientBalanceError as ae, LiveIntentError as af, ReactNativeSessionManager as ag, RealtimeStore as ah, ServerSessionManager as ai, clearCache as aj, closeAllSubscriptions as ak, defineLiveModule as al, deriveUserIdentityFromIdToken as am, functions as an, getCachedData as ao, getRealtimeStore as ap, getWebhookKeysUrl as aq, hasActiveConnection as ar, increment as as, invoke as at, isEffectResult as au, live as av, intent as aw, status as ax, now as ay, reconnectWithNewAuth as az, bufferExports as b, convertRemainingAccounts as c, confirmAndCheckTransaction as d, SOLANA_MAINNET_RPC_URL as e, SURFNET_RPC_URL$1 as f, detectMobile as g, detectAndroid as h, getPlatform as i, setAuthLoading as j, genAuthNonce as k, genSolanaMessage as l, createSessionWithSignature as m, getActiveSessionManager as n, bs58 as o, init as p, getCurrentUser as q, onAuthStateChanged as r, setCurrentUser as s, onAuthLoadingChanged as t, getAuthLoading as u, login as v, logout as w, getConfig as x, getAuthProvider as y, signInAnonymously as z };
20074
- //# sourceMappingURL=index.native-CrneKxG9.mjs.map
20035
+ //# sourceMappingURL=index.native-B4qib0WI.mjs.map