@bounded-sh/client 0.0.36 → 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.
@@ -15,6 +15,8 @@ export type { HostedAuthMethod, OidcLoginOptions, PopupLoginOptions } from "./au
15
15
  export { get, getMany, docId, set, setMany, setFile, getFiles, search, queryAggregate, runQuery, runQueryMany, runExpression, runExpressionMany, signMessage, signTransaction, signAndSubmitTransaction, count, aggregate, GetOptions, SearchOptions, SetOptions, CountOptions, AggregateOptions, AggregateOperation, AggregateResult, AggregateSpec, AggregateRow, QueryAggregateOptions, } from "@bounded-sh/core";
16
16
  export type { GetOptions as BoundedGetOptions } from "@bounded-sh/core";
17
17
  export { subscribe } from "@bounded-sh/core";
18
+ export { BoundedDeclineError, deriveDecline, dispatchDeclineEvent, DECLINE_EVENT_NAME } from "@bounded-sh/core";
19
+ export type { BoundedDecline, DeclineReason, DeclineBoundary } from "@bounded-sh/core";
18
20
  export * from "@bounded-sh/core";
19
21
  export { useAuth } from "./auth/hooks/useAuth";
20
22
  export { deserializeTransaction } from "./auth/providers/sol/sol-utils";
@@ -165,6 +165,15 @@ class OffchainAuthProvider {
165
165
  }
166
166
  return null;
167
167
  }
168
+ // Forward per-call login overrides (theme/title/subtitle and the `method`
169
+ // directive) to the wrapped provider. Without this, the top-level login()
170
+ // forwarder (which duck-types `setLoginOverrides` on the active provider)
171
+ // skips the wrapper and the override — including `method` — is dropped on
172
+ // offchain/Poofnet builds.
173
+ setLoginOverrides(opts) {
174
+ var _a, _b;
175
+ (_b = (_a = this.wrappedProvider).setLoginOverrides) === null || _b === void 0 ? void 0 : _b.call(_a, opts);
176
+ }
168
177
  async logout() {
169
178
  await this.wrappedProvider.logout();
170
179
  }
@@ -198,6 +207,15 @@ class OffchainAuthProvider {
198
207
  async getNativeMethods() {
199
208
  return this.wrappedProvider.getNativeMethods();
200
209
  }
210
+ // Forward wallet export to the wrapped provider (only Privy embedded wallets
211
+ // implement it). Duck-typed so wrappers around non-embedded providers throw
212
+ // a clear error rather than a "not a function" crash.
213
+ async exportWallet(address) {
214
+ if (typeof this.wrappedProvider.exportWallet !== 'function') {
215
+ throw new Error('Wallet export is not available for this wallet.');
216
+ }
217
+ await this.wrappedProvider.exportWallet(address);
218
+ }
201
219
  // ============ signMessage delegates to wrapped provider ============
202
220
  async signMessage(message) {
203
221
  var _a, _b, _c, _d, _e, _f;
@@ -3427,7 +3445,7 @@ const IDB_STORE = 'keys';
3427
3445
  const IDB_KEY = 'ed25519';
3428
3446
  const GUEST_KEY_REQUIREMENT = 'Guest auth requires non-extractable WebCrypto Ed25519 keys persisted in IndexedDB; ' +
3429
3447
  'stored-secret guest credentials are disabled.';
3430
- function toBase64$1(bytes) {
3448
+ function toBase64(bytes) {
3431
3449
  let bin = '';
3432
3450
  for (let i = 0; i < bytes.length; i++)
3433
3451
  bin += String.fromCharCode(bytes[i]);
@@ -3491,7 +3509,7 @@ async function webCryptoKey() {
3491
3509
  async sign(message) {
3492
3510
  const data = new TextEncoder().encode(message);
3493
3511
  const sig = new Uint8Array(await s.sign({ name: 'Ed25519' }, pair.privateKey, data));
3494
- return toBase64$1(sig);
3512
+ return toBase64(sig);
3495
3513
  },
3496
3514
  };
3497
3515
  }
@@ -3767,19 +3785,22 @@ async function signViaSignerPopup(action) {
3767
3785
  } }, 5 * 60 * 1000);
3768
3786
  });
3769
3787
  }
3770
- function toBase64(bytes) {
3771
- return bufferExports.Buffer.from(bytes).toString('base64');
3772
- }
3773
- // Serialize a legacy or versioned Solana transaction to base64 for the signer
3774
- // page. We do NOT require existing signatures (the smart wallet signs on the
3775
- // page); Crossmint extracts the instructions and wraps them for the smart wallet.
3788
+ // Serialize a legacy or versioned Solana transaction to BASE58 for the signer
3789
+ // page. Crossmint's smart-wallet createTransaction endpoint requires the
3790
+ // `serializedTransaction` string to be base58 — it rejects base64 with
3791
+ // "Invalid base58 string" (verified against Crossmint staging 2026-07-07). The
3792
+ // `wallets-sdk` object path bs58-encodes internally, so base58 is the contract.
3793
+ //
3794
+ // We do NOT require existing signatures (the smart wallet signs on the page);
3795
+ // Crossmint extracts the instructions, overrides the fee payer to its sponsor,
3796
+ // and re-wraps them for the smart wallet.
3776
3797
  function serializeTransaction(transaction) {
3777
3798
  const isLegacy = 'recentBlockhash' in transaction &&
3778
3799
  !('message' in transaction && 'staticAccountKeys' in transaction.message);
3779
3800
  const bytes = isLegacy
3780
3801
  ? transaction.serialize({ requireAllSignatures: false, verifySignatures: false })
3781
3802
  : transaction.serialize();
3782
- return toBase64(bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes));
3803
+ return bs58.encode(bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes));
3783
3804
  }
3784
3805
  /**
3785
3806
  * Whether the active session carries an embedded wallet (so the provider should
@@ -4864,7 +4885,7 @@ function useAuth() {
4864
4885
  // Provide a fallback so server render doesn't break
4865
4886
  if (isSSR) {
4866
4887
  return {
4867
- login: async () => undefined,
4888
+ login: async (_options) => undefined,
4868
4889
  logout: async () => undefined,
4869
4890
  loading: true,
4870
4891
  user: null,
@@ -4886,10 +4907,10 @@ function useAuth() {
4886
4907
  stopLoading();
4887
4908
  };
4888
4909
  }, []);
4889
- const login$1 = async () => {
4910
+ const login$1 = async (options) => {
4890
4911
  try {
4891
4912
  setLoading(true);
4892
- const user = await login();
4913
+ const user = await login(options);
4893
4914
  setUser(user);
4894
4915
  }
4895
4916
  catch (error) {
@@ -5327,6 +5348,14 @@ class PrivyExpoProvider {
5327
5348
  }
5328
5349
  }
5329
5350
 
5351
+ Object.defineProperty(exports, "BoundedDeclineError", {
5352
+ enumerable: true,
5353
+ get: function () { return core.BoundedDeclineError; }
5354
+ });
5355
+ Object.defineProperty(exports, "DECLINE_EVENT_NAME", {
5356
+ enumerable: true,
5357
+ get: function () { return core.DECLINE_EVENT_NAME; }
5358
+ });
5330
5359
  Object.defineProperty(exports, "aggregate", {
5331
5360
  enumerable: true,
5332
5361
  get: function () { return core.aggregate; }
@@ -5335,6 +5364,14 @@ Object.defineProperty(exports, "count", {
5335
5364
  enumerable: true,
5336
5365
  get: function () { return core.count; }
5337
5366
  });
5367
+ Object.defineProperty(exports, "deriveDecline", {
5368
+ enumerable: true,
5369
+ get: function () { return core.deriveDecline; }
5370
+ });
5371
+ Object.defineProperty(exports, "dispatchDeclineEvent", {
5372
+ enumerable: true,
5373
+ get: function () { return core.dispatchDeclineEvent; }
5374
+ });
5338
5375
  Object.defineProperty(exports, "docId", {
5339
5376
  enumerable: true,
5340
5377
  get: function () { return core.docId; }