@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
@@ -11145,39 +11145,8 @@ async function get(path, opts = {}) {
11145
11145
  }
11146
11146
  // Create a new request promise and store it
11147
11147
  const requestPromise = (async () => {
11148
- var _a;
11149
11148
  try {
11150
- // For realtime chains, prefer WebSocket reads (lower latency, already connected)
11151
- const config = await getConfig();
11152
11149
  const pathIsDocument = normalizedPath.split("/").length % 2 === 0;
11153
- 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) {
11154
- try {
11155
- const { wsGet, wsQuery, hasActiveConnection } = await Promise.resolve().then(function () { return subscriptionV2; });
11156
- if (hasActiveConnection()) {
11157
- if (pathIsDocument) {
11158
- const wsResult = await wsGet(normalizedPath);
11159
- const responseData = normalizeReadResult(wsResult, true);
11160
- if (!opts.bypassCache) {
11161
- getCache[cacheKey] = { data: responseData, expiresAt: now + GET_CACHE_TTL };
11162
- }
11163
- return responseData;
11164
- }
11165
- else if (!opts.limit) {
11166
- const wsResult = await wsQuery(normalizedPath, {
11167
- filter: undefined,
11168
- sort: undefined,
11169
- includeSubPaths: opts.includeSubPaths,
11170
- });
11171
- const responseData = normalizeReadResult(wsResult, false);
11172
- if (!opts.bypassCache) {
11173
- getCache[cacheKey] = { data: responseData, expiresAt: now + GET_CACHE_TTL };
11174
- }
11175
- return responseData;
11176
- }
11177
- }
11178
- }
11179
- catch ( /* fall through to HTTP */_b) { /* fall through to HTTP */ }
11180
- }
11181
11150
  // Cache miss or bypass - proceed with HTTP API request
11182
11151
  let response;
11183
11152
  // Build common query params
@@ -11430,7 +11399,7 @@ async function set(path, document, options) {
11430
11399
  return result;
11431
11400
  }
11432
11401
  async function setMany(many, options) {
11433
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
11402
+ var _a, _b, _c, _d, _e, _f, _g;
11434
11403
  // Returns the data that was set, or undefined if the document was already set.
11435
11404
  try {
11436
11405
  const config = await getConfig();
@@ -11467,40 +11436,13 @@ async function setMany(many, options) {
11467
11436
  }
11468
11437
  let setResponse;
11469
11438
  try {
11470
- // For realtime chains, prefer WebSocket if a connection is active (lower latency)
11471
- const useWs = ((_c = config.chain) === null || _c === void 0 ? void 0 : _c.startsWith('realtime_')) && !config.isServer;
11472
- if (useWs) {
11473
- try {
11474
- const { wsSet, hasActiveConnection } = await Promise.resolve().then(function () { return subscriptionV2; });
11475
- if (hasActiveConnection()) {
11476
- // Connection is active — send via WS. If this throws, the write
11477
- // may have been applied server-side (ack lost). Do NOT fall through
11478
- // to HTTP, as that would double-apply non-idempotent ops (Increment).
11479
- const wsResult = await wsSet(documents);
11480
- setResponse = { data: wsResult, status: 200 };
11481
- }
11482
- }
11483
- catch (wsError) {
11484
- // Only fall through to HTTP if the request was never sent (connection not available).
11485
- // If the request was sent and ack was lost (timeout), the server may have
11486
- // applied it — re-sending via HTTP risks double-write for non-idempotent ops.
11487
- const msg = (_d = wsError === null || wsError === void 0 ? void 0 : wsError.message) !== null && _d !== void 0 ? _d : '';
11488
- const neverSent = msg.includes('not available') || msg.includes('connection timeout');
11489
- if (!neverSent) {
11490
- throw wsError;
11491
- }
11492
- // Safe to retry via HTTP — request was never sent
11493
- }
11494
- }
11495
- if (!setResponse) {
11496
- setResponse = await makeApiRequest('PUT', `items`, { documents }, options === null || options === void 0 ? void 0 : options._overrides);
11497
- }
11439
+ setResponse = await makeApiRequest('PUT', `items`, { documents }, options === null || options === void 0 ? void 0 : options._overrides);
11498
11440
  }
11499
11441
  catch (error) {
11500
11442
  if ((error === null || error === void 0 ? void 0 : error.statusCode) === 402 && (error === null || error === void 0 ? void 0 : error.error) === 'INSUFFICIENT_BALANCE') {
11501
- const deficitLamports = Number((_e = error.deficitLamports) !== null && _e !== void 0 ? _e : 0);
11502
- const deficitSol = Number((_f = error.deficitSol) !== null && _f !== void 0 ? _f : deficitLamports / 1000000000);
11503
- 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);
11443
+ const deficitLamports = Number((_c = error.deficitLamports) !== null && _c !== void 0 ? _c : 0);
11444
+ const deficitSol = Number((_d = error.deficitSol) !== null && _d !== void 0 ? _d : deficitLamports / 1000000000);
11445
+ 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);
11504
11446
  }
11505
11447
  throw error;
11506
11448
  }
@@ -11547,7 +11489,7 @@ async function setMany(many, options) {
11547
11489
  else if (setResponse.data &&
11548
11490
  typeof setResponse.data === 'object' &&
11549
11491
  setResponse.data.success === true) {
11550
- const _k = setResponse.data, { success: _success } = _k, rest = __rest$1(_k, ["success"]);
11492
+ const _h = setResponse.data, { success: _success } = _h, rest = __rest$1(_h, ["success"]);
11551
11493
  return Object.assign(Object.assign(Object.assign({}, documents.map(d => d.document)), rest), { transactionId: null });
11552
11494
  }
11553
11495
  else {
@@ -13075,23 +13017,6 @@ async function wsGetMany(paths) {
13075
13017
  }));
13076
13018
  }
13077
13019
 
13078
- var subscriptionV2 = /*#__PURE__*/Object.freeze({
13079
- __proto__: null,
13080
- clearCacheV2: clearCacheV2,
13081
- closeAllSubscriptionsV2: closeAllSubscriptionsV2,
13082
- getCachedDataV2: getCachedDataV2,
13083
- hasActiveConnection: hasActiveConnection,
13084
- reconnectWithNewAuthV2: reconnectWithNewAuthV2,
13085
- subscribeV2: subscribeV2,
13086
- wsDelete: wsDelete,
13087
- wsGet: wsGet,
13088
- wsGetMany: wsGetMany,
13089
- wsIntent: wsIntent,
13090
- wsIntentReliable: wsIntentReliable,
13091
- wsQuery: wsQuery,
13092
- wsSet: wsSet
13093
- });
13094
-
13095
13020
  /**
13096
13021
  * WebSocket Subscription Module
13097
13022
  *
@@ -14902,7 +14827,7 @@ class OffchainAuthProvider {
14902
14827
  // Create modal container
14903
14828
  this.modalContainer = document.createElement("div");
14904
14829
  this.modalContainer.id = "poofnet-unsupported-modal";
14905
- this.modalContainer.innerHTML = this.getUnsupportedModalHTML();
14830
+ this.modalContainer.appendChild(this.buildUnsupportedModalContent());
14906
14831
  document.body.appendChild(this.modalContainer);
14907
14832
  // Add styles
14908
14833
  const style = document.createElement("style");
@@ -14958,38 +14883,6 @@ class OffchainAuthProvider {
14958
14883
  document.addEventListener("keydown", escHandler);
14959
14884
  });
14960
14885
  }
14961
- getUnsupportedModalHTML() {
14962
- return `
14963
- <div class="poofnet-modal-overlay">
14964
- <div class="poofnet-modal-content">
14965
- <button id="poofnet-close-btn" class="poofnet-close-btn" aria-label="Close">
14966
- <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
14967
- <path d="M1 1L13 13M1 13L13 1" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
14968
- </svg>
14969
- </button>
14970
- <div class="poofnet-modal-header">
14971
- <div class="poofnet-modal-icon">⚠️</div>
14972
- <h2 class="poofnet-modal-title">Transaction Not Supported</h2>
14973
- <p class="poofnet-modal-subtitle">Poofnet Simulated Blockchain</p>
14974
- </div>
14975
-
14976
- <div class="poofnet-modal-body">
14977
- <div class="poofnet-info-box" style="background: #fef3c7;">
14978
- <span class="poofnet-info-icon">ℹ️</span>
14979
- <span class="poofnet-info-text" style="color: #92400e;">
14980
- Poofnet is a simulated blockchain and does not support real Solana transactions.
14981
- Deploy your project to mainnet to test real transactions.
14982
- </span>
14983
- </div>
14984
- </div>
14985
-
14986
- <div class="poofnet-modal-footer">
14987
- <button id="poofnet-cancel-btn" class="poofnet-btn poofnet-btn-cancel" style="flex: 1;">Close</button>
14988
- </div>
14989
- </div>
14990
- </div>
14991
- `;
14992
- }
14993
14886
  async showTransactionModal(message) {
14994
14887
  return new Promise((resolve) => {
14995
14888
  // Parse the transaction message for display
@@ -15003,7 +14896,7 @@ class OffchainAuthProvider {
15003
14896
  // Create modal container
15004
14897
  this.modalContainer = document.createElement("div");
15005
14898
  this.modalContainer.id = "poofnet-tx-modal";
15006
- this.modalContainer.innerHTML = this.getModalHTML(parsed, message);
14899
+ this.modalContainer.appendChild(this.buildTransactionModalContent(parsed, message));
15007
14900
  document.body.appendChild(this.modalContainer);
15008
14901
  // Add styles
15009
14902
  const style = document.createElement("style");
@@ -15086,24 +14979,59 @@ class OffchainAuthProvider {
15086
14979
  }, 200);
15087
14980
  }
15088
14981
  }
15089
- /**
15090
- * Escape a value for safe interpolation into an HTML string.
15091
- *
15092
- * Transaction messages are attacker-influenceable (they originate from
15093
- * server responses / app-supplied data), so every value derived from them
15094
- * MUST be escaped before being placed into innerHTML. Without this, a field
15095
- * key/value, path segment, document id, or raw message containing markup
15096
- * such as `<img src=x onerror=...>` would execute in the dApp origin and
15097
- * could exfiltrate the stored session (idToken/refreshToken).
15098
- */
15099
- escapeHtml(value) {
15100
- const str = value === null || value === undefined ? "" : String(value);
15101
- return str
15102
- .replace(/&/g, "&amp;")
15103
- .replace(/</g, "&lt;")
15104
- .replace(/>/g, "&gt;")
15105
- .replace(/"/g, "&quot;")
15106
- .replace(/'/g, "&#39;");
14982
+ createElement(tag, className, text) {
14983
+ const el = document.createElement(tag);
14984
+ if (className)
14985
+ el.className = className;
14986
+ if (text !== undefined)
14987
+ el.textContent = text;
14988
+ return el;
14989
+ }
14990
+ appendTextElement(parent, tag, className, text) {
14991
+ const el = this.createElement(tag, className, text);
14992
+ parent.appendChild(el);
14993
+ return el;
14994
+ }
14995
+ buildModalShell(icon, title) {
14996
+ const overlay = this.createElement("div", "poofnet-modal-overlay");
14997
+ const content = this.createElement("div", "poofnet-modal-content");
14998
+ overlay.appendChild(content);
14999
+ const close = this.createElement("button", "poofnet-close-btn", "×");
15000
+ close.id = "poofnet-close-btn";
15001
+ close.setAttribute("aria-label", "Close");
15002
+ close.type = "button";
15003
+ content.appendChild(close);
15004
+ const header = this.createElement("div", "poofnet-modal-header");
15005
+ this.appendTextElement(header, "div", "poofnet-modal-icon", icon);
15006
+ this.appendTextElement(header, "h2", "poofnet-modal-title", title);
15007
+ this.appendTextElement(header, "p", "poofnet-modal-subtitle", "Poofnet Simulated Blockchain");
15008
+ content.appendChild(header);
15009
+ const body = this.createElement("div", "poofnet-modal-body");
15010
+ content.appendChild(body);
15011
+ const footer = this.createElement("div", "poofnet-modal-footer");
15012
+ content.appendChild(footer);
15013
+ return { overlay, body, footer };
15014
+ }
15015
+ buildInfoBox(text, warning = false) {
15016
+ const info = this.createElement("div", "poofnet-info-box");
15017
+ if (warning)
15018
+ info.style.background = "#fef3c7";
15019
+ this.appendTextElement(info, "span", "poofnet-info-icon", "ℹ️");
15020
+ const infoText = this.createElement("span", "poofnet-info-text", text);
15021
+ if (warning)
15022
+ infoText.style.color = "#92400e";
15023
+ info.appendChild(infoText);
15024
+ return info;
15025
+ }
15026
+ buildUnsupportedModalContent() {
15027
+ const { overlay, body, footer } = this.buildModalShell("⚠️", "Transaction Not Supported");
15028
+ 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));
15029
+ const close = this.createElement("button", "poofnet-btn poofnet-btn-cancel", "Close");
15030
+ close.id = "poofnet-cancel-btn";
15031
+ close.type = "button";
15032
+ close.style.flex = "1";
15033
+ footer.appendChild(close);
15034
+ return overlay;
15107
15035
  }
15108
15036
  formatPath(path) {
15109
15037
  const parts = path.split("/").filter(Boolean);
@@ -15136,59 +15064,11 @@ class OffchainAuthProvider {
15136
15064
  return `Delete from ${collection}`;
15137
15065
  return isNew ? `Create in ${collection}` : `Update ${collection}`;
15138
15066
  }
15139
- getModalHTML(parsed, rawMessage) {
15067
+ buildTransactionModalContent(parsed, rawMessage) {
15140
15068
  const instructions = parsed.instructions || [];
15141
15069
  // Group instructions by type for summary
15142
15070
  const sets = instructions.filter((i) => i.type === "set");
15143
15071
  const deletes = instructions.filter((i) => i.type === "delete");
15144
- const instructionsList = instructions
15145
- .map((inst) => {
15146
- const { collection, documentId } = this.formatPath(inst.path);
15147
- const isDelete = inst.type === "delete";
15148
- const icon = isDelete ? "🗑️" : "✏️";
15149
- const actionClass = isDelete
15150
- ? "poofnet-action-delete"
15151
- : "poofnet-action-set";
15152
- // Format data fields for display
15153
- let fieldsHtml = "";
15154
- if (inst.data && !isDelete) {
15155
- const fields = Object.entries(inst.data)
15156
- .filter(([key]) => !key.startsWith("_")) // Hide internal fields
15157
- .slice(0, 4);
15158
- if (fields.length > 0) {
15159
- fieldsHtml = `
15160
- <div class="poofnet-fields">
15161
- ${fields
15162
- .map(([key, value]) => `
15163
- <div class="poofnet-field">
15164
- <span class="poofnet-field-key">${this.escapeHtml(key)}:</span>
15165
- <span class="poofnet-field-value">${this.escapeHtml(this.formatFieldValue(value))}</span>
15166
- </div>
15167
- `)
15168
- .join("")}
15169
- ${Object.keys(inst.data).filter((k) => !k.startsWith("_"))
15170
- .length > 4
15171
- ? `<div class="poofnet-field-more">+${Object.keys(inst.data).filter((k) => !k.startsWith("_")).length - 4} more fields</div>`
15172
- : ""}
15173
- </div>
15174
- `;
15175
- }
15176
- }
15177
- return `
15178
- <div class="poofnet-instruction ${actionClass}">
15179
- <div class="poofnet-instruction-header">
15180
- <span class="poofnet-instruction-icon">${icon}</span>
15181
- <span class="poofnet-instruction-action">${isDelete ? "Delete" : "Save"}</span>
15182
- <span class="poofnet-instruction-collection">${this.escapeHtml(collection)}</span>
15183
- </div>
15184
- ${documentId
15185
- ? `<div class="poofnet-instruction-id">ID: ${this.escapeHtml(documentId)}</div>`
15186
- : ""}
15187
- ${fieldsHtml}
15188
- </div>
15189
- `;
15190
- })
15191
- .join("");
15192
15072
  // Create summary text
15193
15073
  let summaryText = "";
15194
15074
  if (sets.length > 0 && deletes.length > 0) {
@@ -15200,50 +15080,65 @@ class OffchainAuthProvider {
15200
15080
  else if (deletes.length > 0) {
15201
15081
  summaryText = `${deletes.length} delete${deletes.length > 1 ? "s" : ""}`;
15202
15082
  }
15203
- return `
15204
- <div class="poofnet-modal-overlay">
15205
- <div class="poofnet-modal-content">
15206
- <button id="poofnet-close-btn" class="poofnet-close-btn" aria-label="Close">
15207
- <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
15208
- <path d="M1 1L13 13M1 13L13 1" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
15209
- </svg>
15210
- </button>
15211
- <div class="poofnet-modal-header">
15212
- <div class="poofnet-modal-icon">🔐</div>
15213
- <h2 class="poofnet-modal-title">Confirm Transaction</h2>
15214
- <p class="poofnet-modal-subtitle">Poofnet Simulated Blockchain</p>
15215
- </div>
15216
-
15217
- <div class="poofnet-modal-body">
15218
- ${instructions.length > 0
15219
- ? `
15220
- ${summaryText
15221
- ? `<div class="poofnet-summary">${summaryText}</div>`
15222
- : ""}
15223
- <div class="poofnet-instructions-list">
15224
- ${instructionsList}
15225
- </div>
15226
- `
15227
- : `
15228
- <div class="poofnet-section">
15229
- <h3 class="poofnet-section-title">Message</h3>
15230
- <pre class="poofnet-raw-message">${this.escapeHtml(rawMessage.slice(0, 200))}${rawMessage.length > 200 ? "..." : ""}</pre>
15231
- </div>
15232
- `}
15233
-
15234
- <div class="poofnet-info-box">
15235
- <span class="poofnet-info-icon">ℹ️</span>
15236
- <span class="poofnet-info-text">This is a simulated transaction. No real fees will be charged.</span>
15237
- </div>
15238
- </div>
15239
-
15240
- <div class="poofnet-modal-footer">
15241
- <button id="poofnet-cancel-btn" class="poofnet-btn poofnet-btn-cancel">Cancel</button>
15242
- <button id="poofnet-confirm-btn" class="poofnet-btn poofnet-btn-confirm">Confirm</button>
15243
- </div>
15244
- </div>
15245
- </div>
15246
- `;
15083
+ const { overlay, body, footer } = this.buildModalShell("🔐", "Confirm Transaction");
15084
+ if (instructions.length > 0) {
15085
+ if (summaryText) {
15086
+ this.appendTextElement(body, "div", "poofnet-summary", summaryText);
15087
+ }
15088
+ const list = this.createElement("div", "poofnet-instructions-list");
15089
+ for (const inst of instructions) {
15090
+ list.appendChild(this.buildInstructionElement(inst));
15091
+ }
15092
+ body.appendChild(list);
15093
+ }
15094
+ else {
15095
+ const section = this.createElement("div", "poofnet-section");
15096
+ this.appendTextElement(section, "h3", "poofnet-section-title", "Message");
15097
+ const raw = this.createElement("pre", "poofnet-raw-message", rawMessage.slice(0, 200) + (rawMessage.length > 200 ? "..." : ""));
15098
+ section.appendChild(raw);
15099
+ body.appendChild(section);
15100
+ }
15101
+ body.appendChild(this.buildInfoBox("This is a simulated transaction. No real fees will be charged."));
15102
+ const cancel = this.createElement("button", "poofnet-btn poofnet-btn-cancel", "Cancel");
15103
+ cancel.id = "poofnet-cancel-btn";
15104
+ cancel.type = "button";
15105
+ footer.appendChild(cancel);
15106
+ const confirm = this.createElement("button", "poofnet-btn poofnet-btn-confirm", "Confirm");
15107
+ confirm.id = "poofnet-confirm-btn";
15108
+ confirm.type = "button";
15109
+ footer.appendChild(confirm);
15110
+ return overlay;
15111
+ }
15112
+ buildInstructionElement(inst) {
15113
+ const { collection, documentId } = this.formatPath(inst.path);
15114
+ const isDelete = inst.type === "delete";
15115
+ const card = this.createElement("div", `poofnet-instruction ${isDelete ? "poofnet-action-delete" : "poofnet-action-set"}`);
15116
+ const header = this.createElement("div", "poofnet-instruction-header");
15117
+ this.appendTextElement(header, "span", "poofnet-instruction-icon", isDelete ? "🗑️" : "✏️");
15118
+ this.appendTextElement(header, "span", "poofnet-instruction-action", isDelete ? "Delete" : "Save");
15119
+ this.appendTextElement(header, "span", "poofnet-instruction-collection", collection);
15120
+ card.appendChild(header);
15121
+ if (documentId) {
15122
+ this.appendTextElement(card, "div", "poofnet-instruction-id", `ID: ${documentId}`);
15123
+ }
15124
+ if (inst.data && !isDelete) {
15125
+ const fieldKeys = Object.keys(inst.data).filter((key) => !key.startsWith("_"));
15126
+ const visibleFields = fieldKeys.slice(0, 4);
15127
+ if (visibleFields.length > 0) {
15128
+ const fields = this.createElement("div", "poofnet-fields");
15129
+ for (const key of visibleFields) {
15130
+ const row = this.createElement("div", "poofnet-field");
15131
+ this.appendTextElement(row, "span", "poofnet-field-key", `${key}:`);
15132
+ this.appendTextElement(row, "span", "poofnet-field-value", this.formatFieldValue(inst.data[key]));
15133
+ fields.appendChild(row);
15134
+ }
15135
+ if (fieldKeys.length > 4) {
15136
+ this.appendTextElement(fields, "div", "poofnet-field-more", `+${fieldKeys.length - 4} more fields`);
15137
+ }
15138
+ card.appendChild(fields);
15139
+ }
15140
+ }
15141
+ return card;
15247
15142
  }
15248
15143
  getModalStyles() {
15249
15144
  return `
@@ -18579,9 +18474,7 @@ const emailProviderSingleton = new EmailAuthProvider();
18579
18474
  function openEmailModal() {
18580
18475
  return new Promise((resolve) => {
18581
18476
  var _a;
18582
- const root = document.createElement('div');
18583
- root.id = 'bounded-auth-modal';
18584
- root.innerHTML = MODAL_HTML;
18477
+ const root = createEmailModalTree();
18585
18478
  const style = document.createElement('style');
18586
18479
  style.textContent = MODAL_CSS;
18587
18480
  root.appendChild(style);
@@ -18669,26 +18562,97 @@ function openEmailModal() {
18669
18562
  });
18670
18563
  });
18671
18564
  }
18672
- const MODAL_HTML = `
18673
- <div class="ba-overlay">
18674
- <div class="ba-card" role="dialog" aria-modal="true" aria-label="Sign in">
18675
- <button id="ba-close" class="ba-x" aria-label="Close">&times;</button>
18676
- <div class="ba-brand"><span class="ba-dot"></span> Sign in</div>
18677
- <div id="ba-email-step">
18678
- <label class="ba-label" for="ba-email">Email</label>
18679
- <input id="ba-email" class="ba-input" type="email" inputmode="email" autocomplete="email" placeholder="you@example.com" />
18680
- <button id="ba-email-btn" class="ba-btn">Continue</button>
18681
- </div>
18682
- <div id="ba-otp-step" class="hidden">
18683
- <label class="ba-label" for="ba-otp">Enter the code sent to <span id="ba-sent-to" class="ba-em"></span></label>
18684
- <input id="ba-otp" class="ba-input ba-code" inputmode="numeric" autocomplete="one-time-code" maxlength="8" placeholder="······" />
18685
- <button id="ba-otp-btn" class="ba-btn">Verify &amp; continue</button>
18686
- <button id="ba-back" class="ba-link">Use a different email</button>
18687
- </div>
18688
- <div id="ba-msg" class="ba-msg"></div>
18689
- <div class="ba-foot">Secured by Bounded</div>
18690
- </div>
18691
- </div>`;
18565
+ function createEmailModalTree() {
18566
+ const root = document.createElement('div');
18567
+ root.id = 'bounded-auth-modal';
18568
+ const overlay = document.createElement('div');
18569
+ overlay.className = 'ba-overlay';
18570
+ root.appendChild(overlay);
18571
+ const card = document.createElement('div');
18572
+ card.className = 'ba-card';
18573
+ card.setAttribute('role', 'dialog');
18574
+ card.setAttribute('aria-modal', 'true');
18575
+ card.setAttribute('aria-label', 'Sign in');
18576
+ overlay.appendChild(card);
18577
+ const close = document.createElement('button');
18578
+ close.id = 'ba-close';
18579
+ close.className = 'ba-x';
18580
+ close.setAttribute('aria-label', 'Close');
18581
+ close.type = 'button';
18582
+ close.textContent = '×';
18583
+ card.appendChild(close);
18584
+ const brand = document.createElement('div');
18585
+ brand.className = 'ba-brand';
18586
+ const dot = document.createElement('span');
18587
+ dot.className = 'ba-dot';
18588
+ brand.appendChild(dot);
18589
+ brand.appendChild(document.createTextNode(' Sign in'));
18590
+ card.appendChild(brand);
18591
+ const emailStep = document.createElement('div');
18592
+ emailStep.id = 'ba-email-step';
18593
+ card.appendChild(emailStep);
18594
+ const emailLabel = document.createElement('label');
18595
+ emailLabel.className = 'ba-label';
18596
+ emailLabel.htmlFor = 'ba-email';
18597
+ emailLabel.textContent = 'Email';
18598
+ emailStep.appendChild(emailLabel);
18599
+ const emailInput = document.createElement('input');
18600
+ emailInput.id = 'ba-email';
18601
+ emailInput.className = 'ba-input';
18602
+ emailInput.type = 'email';
18603
+ emailInput.inputMode = 'email';
18604
+ emailInput.autocomplete = 'email';
18605
+ emailInput.placeholder = 'you@example.com';
18606
+ emailStep.appendChild(emailInput);
18607
+ const emailButton = document.createElement('button');
18608
+ emailButton.id = 'ba-email-btn';
18609
+ emailButton.className = 'ba-btn';
18610
+ emailButton.type = 'button';
18611
+ emailButton.textContent = 'Continue';
18612
+ emailStep.appendChild(emailButton);
18613
+ const otpStep = document.createElement('div');
18614
+ otpStep.id = 'ba-otp-step';
18615
+ otpStep.className = 'hidden';
18616
+ card.appendChild(otpStep);
18617
+ const otpLabel = document.createElement('label');
18618
+ otpLabel.className = 'ba-label';
18619
+ otpLabel.htmlFor = 'ba-otp';
18620
+ otpLabel.appendChild(document.createTextNode('Enter the code sent to '));
18621
+ const sentTo = document.createElement('span');
18622
+ sentTo.id = 'ba-sent-to';
18623
+ sentTo.className = 'ba-em';
18624
+ otpLabel.appendChild(sentTo);
18625
+ otpStep.appendChild(otpLabel);
18626
+ const otpInput = document.createElement('input');
18627
+ otpInput.id = 'ba-otp';
18628
+ otpInput.className = 'ba-input ba-code';
18629
+ otpInput.inputMode = 'numeric';
18630
+ otpInput.autocomplete = 'one-time-code';
18631
+ otpInput.maxLength = 8;
18632
+ otpInput.placeholder = '······';
18633
+ otpStep.appendChild(otpInput);
18634
+ const otpButton = document.createElement('button');
18635
+ otpButton.id = 'ba-otp-btn';
18636
+ otpButton.className = 'ba-btn';
18637
+ otpButton.type = 'button';
18638
+ otpButton.textContent = 'Verify & continue';
18639
+ otpStep.appendChild(otpButton);
18640
+ const backButton = document.createElement('button');
18641
+ backButton.id = 'ba-back';
18642
+ backButton.className = 'ba-link';
18643
+ backButton.type = 'button';
18644
+ backButton.textContent = 'Use a different email';
18645
+ otpStep.appendChild(backButton);
18646
+ const msg = document.createElement('div');
18647
+ msg.id = 'ba-msg';
18648
+ msg.className = 'ba-msg';
18649
+ card.appendChild(msg);
18650
+ const foot = document.createElement('div');
18651
+ foot.className = 'ba-foot';
18652
+ foot.textContent = 'Secured by Bounded';
18653
+ card.appendChild(foot);
18654
+ return root;
18655
+ }
18692
18656
  const MODAL_CSS = `
18693
18657
  #bounded-auth-modal .ba-overlay{position:fixed;inset:0;background:rgba(8,10,18,.62);backdrop-filter:blur(4px);
18694
18658
  display:flex;align-items:center;justify-content:center;z-index:2147483000;opacity:1;transition:opacity .16s ease;
@@ -19076,17 +19040,17 @@ function clearIncompatibleSession() {
19076
19040
  // Lazy loaders for web-only providers.
19077
19041
  // Using dynamic import() ensures Metro (RN) never resolves these modules.
19078
19042
  async function loadPhantomWalletProvider() {
19079
- const mod = await Promise.resolve().then(function () { return require('./phantom-wallet-provider-CFFRpATv.js'); });
19043
+ const mod = await Promise.resolve().then(function () { return require('./phantom-wallet-provider-B4iCTaUq.js'); });
19080
19044
  return { PhantomWalletProvider: mod.PhantomWalletProvider };
19081
19045
  }
19082
19046
  // Web Privy provider (depends on react-dom + @privy-io/react-auth). Lazy so Metro
19083
19047
  // never bundles it into the RN build — RN uses the @privy-io/expo provider instead.
19084
19048
  async function loadPrivyWalletProvider() {
19085
- const mod = await Promise.resolve().then(function () { return require('./privy-wallet-provider-CuClH2mS.js'); });
19049
+ const mod = await Promise.resolve().then(function () { return require('./privy-wallet-provider-B3FEM7RO.js'); });
19086
19050
  return mod.PrivyWalletProvider;
19087
19051
  }
19088
19052
  async function loadSolanaMobileWalletProvider() {
19089
- const mod = await Promise.resolve().then(function () { return require('./solana-mobile-wallet-provider-DHxdYO4I.js'); });
19053
+ const mod = await Promise.resolve().then(function () { return require('./solana-mobile-wallet-provider-CWidNUHT.js'); });
19090
19054
  return mod.SolanaMobileWalletProvider;
19091
19055
  }
19092
19056
  async function hotSwapToMWAProvider(config) {
@@ -19851,10 +19815,7 @@ class PrivyExpoProvider {
19851
19815
  const rpcUrl = this.getRpcUrl(solTransactionData.network);
19852
19816
  const connection = new web3_js.Connection(rpcUrl, 'confirmed');
19853
19817
  const remainingAccounts = convertRemainingAccounts(solTransactionData.txArgs[0].remainingAccounts);
19854
- let app_id = solTransactionData.appId;
19855
- if (typeof globalThis !== 'undefined' && globalThis.CUSTOM_BOUNDED_APP_ID_HEADER) {
19856
- app_id = globalThis.CUSTOM_BOUNDED_APP_ID_HEADER;
19857
- }
19818
+ const app_id = solTransactionData.appId;
19858
19819
  if (!app_id) {
19859
19820
  throw new Error('App ID is required');
19860
19821
  }
@@ -20196,4 +20157,4 @@ exports.wsGet = wsGet;
20196
20157
  exports.wsGetMany = wsGetMany;
20197
20158
  exports.wsQuery = wsQuery;
20198
20159
  exports.wsSet = wsSet;
20199
- //# sourceMappingURL=index.native-BIm0gZmJ.js.map
20160
+ //# sourceMappingURL=index.native-fDOSSF3W.js.map