@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
package/dist/index.mjs CHANGED
@@ -11125,39 +11125,8 @@ async function get(path, opts = {}) {
11125
11125
  }
11126
11126
  // Create a new request promise and store it
11127
11127
  const requestPromise = (async () => {
11128
- var _a;
11129
11128
  try {
11130
- // For realtime chains, prefer WebSocket reads (lower latency, already connected)
11131
- const config = await getConfig();
11132
11129
  const pathIsDocument = normalizedPath.split("/").length % 2 === 0;
11133
- 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) {
11134
- try {
11135
- const { wsGet, wsQuery, hasActiveConnection } = await Promise.resolve().then(function () { return subscriptionV2; });
11136
- if (hasActiveConnection()) {
11137
- if (pathIsDocument) {
11138
- const wsResult = await wsGet(normalizedPath);
11139
- const responseData = normalizeReadResult(wsResult, true);
11140
- if (!opts.bypassCache) {
11141
- getCache[cacheKey] = { data: responseData, expiresAt: now + GET_CACHE_TTL };
11142
- }
11143
- return responseData;
11144
- }
11145
- else if (!opts.limit) {
11146
- const wsResult = await wsQuery(normalizedPath, {
11147
- filter: undefined,
11148
- sort: undefined,
11149
- includeSubPaths: opts.includeSubPaths,
11150
- });
11151
- const responseData = normalizeReadResult(wsResult, false);
11152
- if (!opts.bypassCache) {
11153
- getCache[cacheKey] = { data: responseData, expiresAt: now + GET_CACHE_TTL };
11154
- }
11155
- return responseData;
11156
- }
11157
- }
11158
- }
11159
- catch ( /* fall through to HTTP */_b) { /* fall through to HTTP */ }
11160
- }
11161
11130
  // Cache miss or bypass - proceed with HTTP API request
11162
11131
  let response;
11163
11132
  // Build common query params
@@ -11410,7 +11379,7 @@ async function set(path, document, options) {
11410
11379
  return result;
11411
11380
  }
11412
11381
  async function setMany(many, options) {
11413
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
11382
+ var _a, _b, _c, _d, _e, _f, _g;
11414
11383
  // Returns the data that was set, or undefined if the document was already set.
11415
11384
  try {
11416
11385
  const config = await getConfig();
@@ -11447,40 +11416,13 @@ async function setMany(many, options) {
11447
11416
  }
11448
11417
  let setResponse;
11449
11418
  try {
11450
- // For realtime chains, prefer WebSocket if a connection is active (lower latency)
11451
- const useWs = ((_c = config.chain) === null || _c === void 0 ? void 0 : _c.startsWith('realtime_')) && !config.isServer;
11452
- if (useWs) {
11453
- try {
11454
- const { wsSet, hasActiveConnection } = await Promise.resolve().then(function () { return subscriptionV2; });
11455
- if (hasActiveConnection()) {
11456
- // Connection is active — send via WS. If this throws, the write
11457
- // may have been applied server-side (ack lost). Do NOT fall through
11458
- // to HTTP, as that would double-apply non-idempotent ops (Increment).
11459
- const wsResult = await wsSet(documents);
11460
- setResponse = { data: wsResult, status: 200 };
11461
- }
11462
- }
11463
- catch (wsError) {
11464
- // Only fall through to HTTP if the request was never sent (connection not available).
11465
- // If the request was sent and ack was lost (timeout), the server may have
11466
- // applied it — re-sending via HTTP risks double-write for non-idempotent ops.
11467
- const msg = (_d = wsError === null || wsError === void 0 ? void 0 : wsError.message) !== null && _d !== void 0 ? _d : '';
11468
- const neverSent = msg.includes('not available') || msg.includes('connection timeout');
11469
- if (!neverSent) {
11470
- throw wsError;
11471
- }
11472
- // Safe to retry via HTTP — request was never sent
11473
- }
11474
- }
11475
- if (!setResponse) {
11476
- setResponse = await makeApiRequest('PUT', `items`, { documents }, options === null || options === void 0 ? void 0 : options._overrides);
11477
- }
11419
+ setResponse = await makeApiRequest('PUT', `items`, { documents }, options === null || options === void 0 ? void 0 : options._overrides);
11478
11420
  }
11479
11421
  catch (error) {
11480
11422
  if ((error === null || error === void 0 ? void 0 : error.statusCode) === 402 && (error === null || error === void 0 ? void 0 : error.error) === 'INSUFFICIENT_BALANCE') {
11481
- const deficitLamports = Number((_e = error.deficitLamports) !== null && _e !== void 0 ? _e : 0);
11482
- const deficitSol = Number((_f = error.deficitSol) !== null && _f !== void 0 ? _f : deficitLamports / 1000000000);
11483
- 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);
11423
+ const deficitLamports = Number((_c = error.deficitLamports) !== null && _c !== void 0 ? _c : 0);
11424
+ const deficitSol = Number((_d = error.deficitSol) !== null && _d !== void 0 ? _d : deficitLamports / 1000000000);
11425
+ 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);
11484
11426
  }
11485
11427
  throw error;
11486
11428
  }
@@ -11527,7 +11469,7 @@ async function setMany(many, options) {
11527
11469
  else if (setResponse.data &&
11528
11470
  typeof setResponse.data === 'object' &&
11529
11471
  setResponse.data.success === true) {
11530
- const _k = setResponse.data, { success: _success } = _k, rest = __rest$1(_k, ["success"]);
11472
+ const _h = setResponse.data, { success: _success } = _h, rest = __rest$1(_h, ["success"]);
11531
11473
  return Object.assign(Object.assign(Object.assign({}, documents.map(d => d.document)), rest), { transactionId: null });
11532
11474
  }
11533
11475
  else {
@@ -13055,23 +12997,6 @@ async function wsGetMany(paths) {
13055
12997
  }));
13056
12998
  }
13057
12999
 
13058
- var subscriptionV2 = /*#__PURE__*/Object.freeze({
13059
- __proto__: null,
13060
- clearCacheV2: clearCacheV2,
13061
- closeAllSubscriptionsV2: closeAllSubscriptionsV2,
13062
- getCachedDataV2: getCachedDataV2,
13063
- hasActiveConnection: hasActiveConnection,
13064
- reconnectWithNewAuthV2: reconnectWithNewAuthV2,
13065
- subscribeV2: subscribeV2,
13066
- wsDelete: wsDelete,
13067
- wsGet: wsGet,
13068
- wsGetMany: wsGetMany,
13069
- wsIntent: wsIntent,
13070
- wsIntentReliable: wsIntentReliable,
13071
- wsQuery: wsQuery,
13072
- wsSet: wsSet
13073
- });
13074
-
13075
13000
  /**
13076
13001
  * WebSocket Subscription Module
13077
13002
  *
@@ -14882,7 +14807,7 @@ class OffchainAuthProvider {
14882
14807
  // Create modal container
14883
14808
  this.modalContainer = document.createElement("div");
14884
14809
  this.modalContainer.id = "poofnet-unsupported-modal";
14885
- this.modalContainer.innerHTML = this.getUnsupportedModalHTML();
14810
+ this.modalContainer.appendChild(this.buildUnsupportedModalContent());
14886
14811
  document.body.appendChild(this.modalContainer);
14887
14812
  // Add styles
14888
14813
  const style = document.createElement("style");
@@ -14938,38 +14863,6 @@ class OffchainAuthProvider {
14938
14863
  document.addEventListener("keydown", escHandler);
14939
14864
  });
14940
14865
  }
14941
- getUnsupportedModalHTML() {
14942
- return `
14943
- <div class="poofnet-modal-overlay">
14944
- <div class="poofnet-modal-content">
14945
- <button id="poofnet-close-btn" class="poofnet-close-btn" aria-label="Close">
14946
- <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
14947
- <path d="M1 1L13 13M1 13L13 1" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
14948
- </svg>
14949
- </button>
14950
- <div class="poofnet-modal-header">
14951
- <div class="poofnet-modal-icon">⚠️</div>
14952
- <h2 class="poofnet-modal-title">Transaction Not Supported</h2>
14953
- <p class="poofnet-modal-subtitle">Poofnet Simulated Blockchain</p>
14954
- </div>
14955
-
14956
- <div class="poofnet-modal-body">
14957
- <div class="poofnet-info-box" style="background: #fef3c7;">
14958
- <span class="poofnet-info-icon">ℹ️</span>
14959
- <span class="poofnet-info-text" style="color: #92400e;">
14960
- Poofnet is a simulated blockchain and does not support real Solana transactions.
14961
- Deploy your project to mainnet to test real transactions.
14962
- </span>
14963
- </div>
14964
- </div>
14965
-
14966
- <div class="poofnet-modal-footer">
14967
- <button id="poofnet-cancel-btn" class="poofnet-btn poofnet-btn-cancel" style="flex: 1;">Close</button>
14968
- </div>
14969
- </div>
14970
- </div>
14971
- `;
14972
- }
14973
14866
  async showTransactionModal(message) {
14974
14867
  return new Promise((resolve) => {
14975
14868
  // Parse the transaction message for display
@@ -14983,7 +14876,7 @@ class OffchainAuthProvider {
14983
14876
  // Create modal container
14984
14877
  this.modalContainer = document.createElement("div");
14985
14878
  this.modalContainer.id = "poofnet-tx-modal";
14986
- this.modalContainer.innerHTML = this.getModalHTML(parsed, message);
14879
+ this.modalContainer.appendChild(this.buildTransactionModalContent(parsed, message));
14987
14880
  document.body.appendChild(this.modalContainer);
14988
14881
  // Add styles
14989
14882
  const style = document.createElement("style");
@@ -15066,24 +14959,59 @@ class OffchainAuthProvider {
15066
14959
  }, 200);
15067
14960
  }
15068
14961
  }
15069
- /**
15070
- * Escape a value for safe interpolation into an HTML string.
15071
- *
15072
- * Transaction messages are attacker-influenceable (they originate from
15073
- * server responses / app-supplied data), so every value derived from them
15074
- * MUST be escaped before being placed into innerHTML. Without this, a field
15075
- * key/value, path segment, document id, or raw message containing markup
15076
- * such as `<img src=x onerror=...>` would execute in the dApp origin and
15077
- * could exfiltrate the stored session (idToken/refreshToken).
15078
- */
15079
- escapeHtml(value) {
15080
- const str = value === null || value === undefined ? "" : String(value);
15081
- return str
15082
- .replace(/&/g, "&amp;")
15083
- .replace(/</g, "&lt;")
15084
- .replace(/>/g, "&gt;")
15085
- .replace(/"/g, "&quot;")
15086
- .replace(/'/g, "&#39;");
14962
+ createElement(tag, className, text) {
14963
+ const el = document.createElement(tag);
14964
+ if (className)
14965
+ el.className = className;
14966
+ if (text !== undefined)
14967
+ el.textContent = text;
14968
+ return el;
14969
+ }
14970
+ appendTextElement(parent, tag, className, text) {
14971
+ const el = this.createElement(tag, className, text);
14972
+ parent.appendChild(el);
14973
+ return el;
14974
+ }
14975
+ buildModalShell(icon, title) {
14976
+ const overlay = this.createElement("div", "poofnet-modal-overlay");
14977
+ const content = this.createElement("div", "poofnet-modal-content");
14978
+ overlay.appendChild(content);
14979
+ const close = this.createElement("button", "poofnet-close-btn", "×");
14980
+ close.id = "poofnet-close-btn";
14981
+ close.setAttribute("aria-label", "Close");
14982
+ close.type = "button";
14983
+ content.appendChild(close);
14984
+ const header = this.createElement("div", "poofnet-modal-header");
14985
+ this.appendTextElement(header, "div", "poofnet-modal-icon", icon);
14986
+ this.appendTextElement(header, "h2", "poofnet-modal-title", title);
14987
+ this.appendTextElement(header, "p", "poofnet-modal-subtitle", "Poofnet Simulated Blockchain");
14988
+ content.appendChild(header);
14989
+ const body = this.createElement("div", "poofnet-modal-body");
14990
+ content.appendChild(body);
14991
+ const footer = this.createElement("div", "poofnet-modal-footer");
14992
+ content.appendChild(footer);
14993
+ return { overlay, body, footer };
14994
+ }
14995
+ buildInfoBox(text, warning = false) {
14996
+ const info = this.createElement("div", "poofnet-info-box");
14997
+ if (warning)
14998
+ info.style.background = "#fef3c7";
14999
+ this.appendTextElement(info, "span", "poofnet-info-icon", "ℹ️");
15000
+ const infoText = this.createElement("span", "poofnet-info-text", text);
15001
+ if (warning)
15002
+ infoText.style.color = "#92400e";
15003
+ info.appendChild(infoText);
15004
+ return info;
15005
+ }
15006
+ buildUnsupportedModalContent() {
15007
+ const { overlay, body, footer } = this.buildModalShell("⚠️", "Transaction Not Supported");
15008
+ 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));
15009
+ const close = this.createElement("button", "poofnet-btn poofnet-btn-cancel", "Close");
15010
+ close.id = "poofnet-cancel-btn";
15011
+ close.type = "button";
15012
+ close.style.flex = "1";
15013
+ footer.appendChild(close);
15014
+ return overlay;
15087
15015
  }
15088
15016
  formatPath(path) {
15089
15017
  const parts = path.split("/").filter(Boolean);
@@ -15116,59 +15044,11 @@ class OffchainAuthProvider {
15116
15044
  return `Delete from ${collection}`;
15117
15045
  return isNew ? `Create in ${collection}` : `Update ${collection}`;
15118
15046
  }
15119
- getModalHTML(parsed, rawMessage) {
15047
+ buildTransactionModalContent(parsed, rawMessage) {
15120
15048
  const instructions = parsed.instructions || [];
15121
15049
  // Group instructions by type for summary
15122
15050
  const sets = instructions.filter((i) => i.type === "set");
15123
15051
  const deletes = instructions.filter((i) => i.type === "delete");
15124
- const instructionsList = instructions
15125
- .map((inst) => {
15126
- const { collection, documentId } = this.formatPath(inst.path);
15127
- const isDelete = inst.type === "delete";
15128
- const icon = isDelete ? "🗑️" : "✏️";
15129
- const actionClass = isDelete
15130
- ? "poofnet-action-delete"
15131
- : "poofnet-action-set";
15132
- // Format data fields for display
15133
- let fieldsHtml = "";
15134
- if (inst.data && !isDelete) {
15135
- const fields = Object.entries(inst.data)
15136
- .filter(([key]) => !key.startsWith("_")) // Hide internal fields
15137
- .slice(0, 4);
15138
- if (fields.length > 0) {
15139
- fieldsHtml = `
15140
- <div class="poofnet-fields">
15141
- ${fields
15142
- .map(([key, value]) => `
15143
- <div class="poofnet-field">
15144
- <span class="poofnet-field-key">${this.escapeHtml(key)}:</span>
15145
- <span class="poofnet-field-value">${this.escapeHtml(this.formatFieldValue(value))}</span>
15146
- </div>
15147
- `)
15148
- .join("")}
15149
- ${Object.keys(inst.data).filter((k) => !k.startsWith("_"))
15150
- .length > 4
15151
- ? `<div class="poofnet-field-more">+${Object.keys(inst.data).filter((k) => !k.startsWith("_")).length - 4} more fields</div>`
15152
- : ""}
15153
- </div>
15154
- `;
15155
- }
15156
- }
15157
- return `
15158
- <div class="poofnet-instruction ${actionClass}">
15159
- <div class="poofnet-instruction-header">
15160
- <span class="poofnet-instruction-icon">${icon}</span>
15161
- <span class="poofnet-instruction-action">${isDelete ? "Delete" : "Save"}</span>
15162
- <span class="poofnet-instruction-collection">${this.escapeHtml(collection)}</span>
15163
- </div>
15164
- ${documentId
15165
- ? `<div class="poofnet-instruction-id">ID: ${this.escapeHtml(documentId)}</div>`
15166
- : ""}
15167
- ${fieldsHtml}
15168
- </div>
15169
- `;
15170
- })
15171
- .join("");
15172
15052
  // Create summary text
15173
15053
  let summaryText = "";
15174
15054
  if (sets.length > 0 && deletes.length > 0) {
@@ -15180,50 +15060,65 @@ class OffchainAuthProvider {
15180
15060
  else if (deletes.length > 0) {
15181
15061
  summaryText = `${deletes.length} delete${deletes.length > 1 ? "s" : ""}`;
15182
15062
  }
15183
- return `
15184
- <div class="poofnet-modal-overlay">
15185
- <div class="poofnet-modal-content">
15186
- <button id="poofnet-close-btn" class="poofnet-close-btn" aria-label="Close">
15187
- <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
15188
- <path d="M1 1L13 13M1 13L13 1" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
15189
- </svg>
15190
- </button>
15191
- <div class="poofnet-modal-header">
15192
- <div class="poofnet-modal-icon">🔐</div>
15193
- <h2 class="poofnet-modal-title">Confirm Transaction</h2>
15194
- <p class="poofnet-modal-subtitle">Poofnet Simulated Blockchain</p>
15195
- </div>
15196
-
15197
- <div class="poofnet-modal-body">
15198
- ${instructions.length > 0
15199
- ? `
15200
- ${summaryText
15201
- ? `<div class="poofnet-summary">${summaryText}</div>`
15202
- : ""}
15203
- <div class="poofnet-instructions-list">
15204
- ${instructionsList}
15205
- </div>
15206
- `
15207
- : `
15208
- <div class="poofnet-section">
15209
- <h3 class="poofnet-section-title">Message</h3>
15210
- <pre class="poofnet-raw-message">${this.escapeHtml(rawMessage.slice(0, 200))}${rawMessage.length > 200 ? "..." : ""}</pre>
15211
- </div>
15212
- `}
15213
-
15214
- <div class="poofnet-info-box">
15215
- <span class="poofnet-info-icon">ℹ️</span>
15216
- <span class="poofnet-info-text">This is a simulated transaction. No real fees will be charged.</span>
15217
- </div>
15218
- </div>
15219
-
15220
- <div class="poofnet-modal-footer">
15221
- <button id="poofnet-cancel-btn" class="poofnet-btn poofnet-btn-cancel">Cancel</button>
15222
- <button id="poofnet-confirm-btn" class="poofnet-btn poofnet-btn-confirm">Confirm</button>
15223
- </div>
15224
- </div>
15225
- </div>
15226
- `;
15063
+ const { overlay, body, footer } = this.buildModalShell("🔐", "Confirm Transaction");
15064
+ if (instructions.length > 0) {
15065
+ if (summaryText) {
15066
+ this.appendTextElement(body, "div", "poofnet-summary", summaryText);
15067
+ }
15068
+ const list = this.createElement("div", "poofnet-instructions-list");
15069
+ for (const inst of instructions) {
15070
+ list.appendChild(this.buildInstructionElement(inst));
15071
+ }
15072
+ body.appendChild(list);
15073
+ }
15074
+ else {
15075
+ const section = this.createElement("div", "poofnet-section");
15076
+ this.appendTextElement(section, "h3", "poofnet-section-title", "Message");
15077
+ const raw = this.createElement("pre", "poofnet-raw-message", rawMessage.slice(0, 200) + (rawMessage.length > 200 ? "..." : ""));
15078
+ section.appendChild(raw);
15079
+ body.appendChild(section);
15080
+ }
15081
+ body.appendChild(this.buildInfoBox("This is a simulated transaction. No real fees will be charged."));
15082
+ const cancel = this.createElement("button", "poofnet-btn poofnet-btn-cancel", "Cancel");
15083
+ cancel.id = "poofnet-cancel-btn";
15084
+ cancel.type = "button";
15085
+ footer.appendChild(cancel);
15086
+ const confirm = this.createElement("button", "poofnet-btn poofnet-btn-confirm", "Confirm");
15087
+ confirm.id = "poofnet-confirm-btn";
15088
+ confirm.type = "button";
15089
+ footer.appendChild(confirm);
15090
+ return overlay;
15091
+ }
15092
+ buildInstructionElement(inst) {
15093
+ const { collection, documentId } = this.formatPath(inst.path);
15094
+ const isDelete = inst.type === "delete";
15095
+ const card = this.createElement("div", `poofnet-instruction ${isDelete ? "poofnet-action-delete" : "poofnet-action-set"}`);
15096
+ const header = this.createElement("div", "poofnet-instruction-header");
15097
+ this.appendTextElement(header, "span", "poofnet-instruction-icon", isDelete ? "🗑️" : "✏️");
15098
+ this.appendTextElement(header, "span", "poofnet-instruction-action", isDelete ? "Delete" : "Save");
15099
+ this.appendTextElement(header, "span", "poofnet-instruction-collection", collection);
15100
+ card.appendChild(header);
15101
+ if (documentId) {
15102
+ this.appendTextElement(card, "div", "poofnet-instruction-id", `ID: ${documentId}`);
15103
+ }
15104
+ if (inst.data && !isDelete) {
15105
+ const fieldKeys = Object.keys(inst.data).filter((key) => !key.startsWith("_"));
15106
+ const visibleFields = fieldKeys.slice(0, 4);
15107
+ if (visibleFields.length > 0) {
15108
+ const fields = this.createElement("div", "poofnet-fields");
15109
+ for (const key of visibleFields) {
15110
+ const row = this.createElement("div", "poofnet-field");
15111
+ this.appendTextElement(row, "span", "poofnet-field-key", `${key}:`);
15112
+ this.appendTextElement(row, "span", "poofnet-field-value", this.formatFieldValue(inst.data[key]));
15113
+ fields.appendChild(row);
15114
+ }
15115
+ if (fieldKeys.length > 4) {
15116
+ this.appendTextElement(fields, "div", "poofnet-field-more", `+${fieldKeys.length - 4} more fields`);
15117
+ }
15118
+ card.appendChild(fields);
15119
+ }
15120
+ }
15121
+ return card;
15227
15122
  }
15228
15123
  getModalStyles() {
15229
15124
  return `
@@ -18559,9 +18454,7 @@ const emailProviderSingleton = new EmailAuthProvider();
18559
18454
  function openEmailModal() {
18560
18455
  return new Promise((resolve) => {
18561
18456
  var _a;
18562
- const root = document.createElement('div');
18563
- root.id = 'bounded-auth-modal';
18564
- root.innerHTML = MODAL_HTML;
18457
+ const root = createEmailModalTree();
18565
18458
  const style = document.createElement('style');
18566
18459
  style.textContent = MODAL_CSS;
18567
18460
  root.appendChild(style);
@@ -18649,26 +18542,97 @@ function openEmailModal() {
18649
18542
  });
18650
18543
  });
18651
18544
  }
18652
- const MODAL_HTML = `
18653
- <div class="ba-overlay">
18654
- <div class="ba-card" role="dialog" aria-modal="true" aria-label="Sign in">
18655
- <button id="ba-close" class="ba-x" aria-label="Close">&times;</button>
18656
- <div class="ba-brand"><span class="ba-dot"></span> Sign in</div>
18657
- <div id="ba-email-step">
18658
- <label class="ba-label" for="ba-email">Email</label>
18659
- <input id="ba-email" class="ba-input" type="email" inputmode="email" autocomplete="email" placeholder="you@example.com" />
18660
- <button id="ba-email-btn" class="ba-btn">Continue</button>
18661
- </div>
18662
- <div id="ba-otp-step" class="hidden">
18663
- <label class="ba-label" for="ba-otp">Enter the code sent to <span id="ba-sent-to" class="ba-em"></span></label>
18664
- <input id="ba-otp" class="ba-input ba-code" inputmode="numeric" autocomplete="one-time-code" maxlength="8" placeholder="······" />
18665
- <button id="ba-otp-btn" class="ba-btn">Verify &amp; continue</button>
18666
- <button id="ba-back" class="ba-link">Use a different email</button>
18667
- </div>
18668
- <div id="ba-msg" class="ba-msg"></div>
18669
- <div class="ba-foot">Secured by Bounded</div>
18670
- </div>
18671
- </div>`;
18545
+ function createEmailModalTree() {
18546
+ const root = document.createElement('div');
18547
+ root.id = 'bounded-auth-modal';
18548
+ const overlay = document.createElement('div');
18549
+ overlay.className = 'ba-overlay';
18550
+ root.appendChild(overlay);
18551
+ const card = document.createElement('div');
18552
+ card.className = 'ba-card';
18553
+ card.setAttribute('role', 'dialog');
18554
+ card.setAttribute('aria-modal', 'true');
18555
+ card.setAttribute('aria-label', 'Sign in');
18556
+ overlay.appendChild(card);
18557
+ const close = document.createElement('button');
18558
+ close.id = 'ba-close';
18559
+ close.className = 'ba-x';
18560
+ close.setAttribute('aria-label', 'Close');
18561
+ close.type = 'button';
18562
+ close.textContent = '×';
18563
+ card.appendChild(close);
18564
+ const brand = document.createElement('div');
18565
+ brand.className = 'ba-brand';
18566
+ const dot = document.createElement('span');
18567
+ dot.className = 'ba-dot';
18568
+ brand.appendChild(dot);
18569
+ brand.appendChild(document.createTextNode(' Sign in'));
18570
+ card.appendChild(brand);
18571
+ const emailStep = document.createElement('div');
18572
+ emailStep.id = 'ba-email-step';
18573
+ card.appendChild(emailStep);
18574
+ const emailLabel = document.createElement('label');
18575
+ emailLabel.className = 'ba-label';
18576
+ emailLabel.htmlFor = 'ba-email';
18577
+ emailLabel.textContent = 'Email';
18578
+ emailStep.appendChild(emailLabel);
18579
+ const emailInput = document.createElement('input');
18580
+ emailInput.id = 'ba-email';
18581
+ emailInput.className = 'ba-input';
18582
+ emailInput.type = 'email';
18583
+ emailInput.inputMode = 'email';
18584
+ emailInput.autocomplete = 'email';
18585
+ emailInput.placeholder = 'you@example.com';
18586
+ emailStep.appendChild(emailInput);
18587
+ const emailButton = document.createElement('button');
18588
+ emailButton.id = 'ba-email-btn';
18589
+ emailButton.className = 'ba-btn';
18590
+ emailButton.type = 'button';
18591
+ emailButton.textContent = 'Continue';
18592
+ emailStep.appendChild(emailButton);
18593
+ const otpStep = document.createElement('div');
18594
+ otpStep.id = 'ba-otp-step';
18595
+ otpStep.className = 'hidden';
18596
+ card.appendChild(otpStep);
18597
+ const otpLabel = document.createElement('label');
18598
+ otpLabel.className = 'ba-label';
18599
+ otpLabel.htmlFor = 'ba-otp';
18600
+ otpLabel.appendChild(document.createTextNode('Enter the code sent to '));
18601
+ const sentTo = document.createElement('span');
18602
+ sentTo.id = 'ba-sent-to';
18603
+ sentTo.className = 'ba-em';
18604
+ otpLabel.appendChild(sentTo);
18605
+ otpStep.appendChild(otpLabel);
18606
+ const otpInput = document.createElement('input');
18607
+ otpInput.id = 'ba-otp';
18608
+ otpInput.className = 'ba-input ba-code';
18609
+ otpInput.inputMode = 'numeric';
18610
+ otpInput.autocomplete = 'one-time-code';
18611
+ otpInput.maxLength = 8;
18612
+ otpInput.placeholder = '······';
18613
+ otpStep.appendChild(otpInput);
18614
+ const otpButton = document.createElement('button');
18615
+ otpButton.id = 'ba-otp-btn';
18616
+ otpButton.className = 'ba-btn';
18617
+ otpButton.type = 'button';
18618
+ otpButton.textContent = 'Verify & continue';
18619
+ otpStep.appendChild(otpButton);
18620
+ const backButton = document.createElement('button');
18621
+ backButton.id = 'ba-back';
18622
+ backButton.className = 'ba-link';
18623
+ backButton.type = 'button';
18624
+ backButton.textContent = 'Use a different email';
18625
+ otpStep.appendChild(backButton);
18626
+ const msg = document.createElement('div');
18627
+ msg.id = 'ba-msg';
18628
+ msg.className = 'ba-msg';
18629
+ card.appendChild(msg);
18630
+ const foot = document.createElement('div');
18631
+ foot.className = 'ba-foot';
18632
+ foot.textContent = 'Secured by Bounded';
18633
+ card.appendChild(foot);
18634
+ return root;
18635
+ }
18672
18636
  const MODAL_CSS = `
18673
18637
  #bounded-auth-modal .ba-overlay{position:fixed;inset:0;background:rgba(8,10,18,.62);backdrop-filter:blur(4px);
18674
18638
  display:flex;align-items:center;justify-content:center;z-index:2147483000;opacity:1;transition:opacity .16s ease;
@@ -20809,10 +20773,7 @@ class PhantomWalletProvider {
20809
20773
  const isSurfnet = rpcUrl === SURFNET_RPC_URL$2;
20810
20774
  try {
20811
20775
  const remainingAccounts = convertRemainingAccounts(solTransactionData.txArgs[0].remainingAccounts);
20812
- let app_id = solTransactionData.appId;
20813
- if (typeof window !== 'undefined' && window.CUSTOM_BOUNDED_APP_ID_HEADER) {
20814
- app_id = window.CUSTOM_BOUNDED_APP_ID_HEADER;
20815
- }
20776
+ const app_id = solTransactionData.appId;
20816
20777
  if (!app_id) {
20817
20778
  throw new Error("App ID is required");
20818
20779
  }
@@ -21409,7 +21370,7 @@ async function awaitSignInGestureAndSign(theme, signFn, noResultError = 'MWA ret
21409
21370
  ].join('; ');
21410
21371
  const closeBtn = document.createElement('button');
21411
21372
  closeBtn.setAttribute('aria-label', 'Close');
21412
- closeBtn.textContent = '×'; // × (multiplication sign), set via textContent to avoid any innerHTML usage
21373
+ closeBtn.textContent = '×';
21413
21374
  closeBtn.style.cssText = [
21414
21375
  'position: absolute',
21415
21376
  'top: 12px',
@@ -22540,10 +22501,7 @@ class SolanaMobileWalletProvider {
22540
22501
  const isSurfnet = rpcUrl === SURFNET_RPC_URL$2;
22541
22502
  try {
22542
22503
  const remainingAccounts = convertRemainingAccounts(solTransactionData.txArgs[0].remainingAccounts);
22543
- let app_id = solTransactionData.appId;
22544
- if (typeof window !== 'undefined' && window.CUSTOM_BOUNDED_APP_ID_HEADER) {
22545
- app_id = window.CUSTOM_BOUNDED_APP_ID_HEADER;
22546
- }
22504
+ const app_id = solTransactionData.appId;
22547
22505
  if (!app_id) {
22548
22506
  throw new Error('App ID is required');
22549
22507
  }
@@ -23169,13 +23127,7 @@ class PrivyWalletProvider {
23169
23127
  const rpcUrl = this.getRpcUrl(solTransactionData.network);
23170
23128
  const connection = new Connection(rpcUrl, "confirmed");
23171
23129
  const remainingAccounts = convertRemainingAccounts(solTransactionData.txArgs[0].remainingAccounts);
23172
- let app_id = solTransactionData.appId;
23173
- if (typeof window !== 'undefined' && window.CUSTOM_BOUNDED_APP_ID_HEADER) {
23174
- const customAppId = window.CUSTOM_BOUNDED_APP_ID_HEADER;
23175
- if (customAppId) {
23176
- app_id = customAppId;
23177
- }
23178
- }
23130
+ const app_id = solTransactionData.appId;
23179
23131
  if (!app_id) {
23180
23132
  throw new Error("App ID is required");
23181
23133
  }
@@ -23801,10 +23753,7 @@ class PrivyExpoProvider {
23801
23753
  const rpcUrl = this.getRpcUrl(solTransactionData.network);
23802
23754
  const connection = new Connection(rpcUrl, 'confirmed');
23803
23755
  const remainingAccounts = convertRemainingAccounts(solTransactionData.txArgs[0].remainingAccounts);
23804
- let app_id = solTransactionData.appId;
23805
- if (typeof globalThis !== 'undefined' && globalThis.CUSTOM_BOUNDED_APP_ID_HEADER) {
23806
- app_id = globalThis.CUSTOM_BOUNDED_APP_ID_HEADER;
23807
- }
23756
+ const app_id = solTransactionData.appId;
23808
23757
  if (!app_id) {
23809
23758
  throw new Error('App ID is required');
23810
23759
  }