@bounded-sh/client 0.0.37 → 0.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -3425,7 +3425,7 @@ const IDB_STORE = 'keys';
3425
3425
  const IDB_KEY = 'ed25519';
3426
3426
  const GUEST_KEY_REQUIREMENT = 'Guest auth requires non-extractable WebCrypto Ed25519 keys persisted in IndexedDB; ' +
3427
3427
  'stored-secret guest credentials are disabled.';
3428
- function toBase64$1(bytes) {
3428
+ function toBase64(bytes) {
3429
3429
  let bin = '';
3430
3430
  for (let i = 0; i < bytes.length; i++)
3431
3431
  bin += String.fromCharCode(bytes[i]);
@@ -3489,7 +3489,7 @@ async function webCryptoKey() {
3489
3489
  async sign(message) {
3490
3490
  const data = new TextEncoder().encode(message);
3491
3491
  const sig = new Uint8Array(await s.sign({ name: 'Ed25519' }, pair.privateKey, data));
3492
- return toBase64$1(sig);
3492
+ return toBase64(sig);
3493
3493
  },
3494
3494
  };
3495
3495
  }
@@ -3765,19 +3765,22 @@ async function signViaSignerPopup(action) {
3765
3765
  } }, 5 * 60 * 1000);
3766
3766
  });
3767
3767
  }
3768
- function toBase64(bytes) {
3769
- return bufferExports.Buffer.from(bytes).toString('base64');
3770
- }
3771
- // Serialize a legacy or versioned Solana transaction to base64 for the signer
3772
- // page. We do NOT require existing signatures (the smart wallet signs on the
3773
- // page); Crossmint extracts the instructions and wraps them for the smart wallet.
3768
+ // Serialize a legacy or versioned Solana transaction to BASE58 for the signer
3769
+ // page. Crossmint's smart-wallet createTransaction endpoint requires the
3770
+ // `serializedTransaction` string to be base58 — it rejects base64 with
3771
+ // "Invalid base58 string" (verified against Crossmint staging 2026-07-07). The
3772
+ // `wallets-sdk` object path bs58-encodes internally, so base58 is the contract.
3773
+ //
3774
+ // We do NOT require existing signatures (the smart wallet signs on the page);
3775
+ // Crossmint extracts the instructions, overrides the fee payer to its sponsor,
3776
+ // and re-wraps them for the smart wallet.
3774
3777
  function serializeTransaction(transaction) {
3775
3778
  const isLegacy = 'recentBlockhash' in transaction &&
3776
3779
  !('message' in transaction && 'staticAccountKeys' in transaction.message);
3777
3780
  const bytes = isLegacy
3778
3781
  ? transaction.serialize({ requireAllSignatures: false, verifySignatures: false })
3779
3782
  : transaction.serialize();
3780
- return toBase64(bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes));
3783
+ return bs58.encode(bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes));
3781
3784
  }
3782
3785
  /**
3783
3786
  * Whether the active session carries an embedded wallet (so the provider should