@pooflabs/web 0.0.88 → 0.0.89-rc2

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 (57) hide show
  1. package/dist/auth/providers/mock-poofnet-provider.d.ts +58 -0
  2. package/dist/auth/providers/phantom-wallet-provider.d.ts +5 -0
  3. package/dist/{index-BfsQaxom.esm.js → index-4JUcdcnk.esm.js} +2 -2406
  4. package/dist/index-4JUcdcnk.esm.js.map +1 -0
  5. package/dist/{index-Lm0k5Hwv.js → index-BLiaV7Dz.js} +5302 -2462
  6. package/dist/index-BLiaV7Dz.js.map +1 -0
  7. package/dist/{index-CTtGbOzo.js → index-CXmcQaFm.js} +2 -2406
  8. package/dist/index-CXmcQaFm.js.map +1 -0
  9. package/dist/{index-CJRFnq6O.esm.js → index-Cgaz8U9W.esm.js} +5303 -2461
  10. package/dist/index-Cgaz8U9W.esm.js.map +1 -0
  11. package/dist/{index-MF_M5V0O.esm.js → index-DQhWZskl.esm.js} +2 -2407
  12. package/dist/index-DQhWZskl.esm.js.map +1 -0
  13. package/dist/{index-DBYgqO9f.js → index-QJAj_nTx.js} +13 -2418
  14. package/dist/index-QJAj_nTx.js.map +1 -0
  15. package/dist/{index.browser-BxKN5pIs.js → index.browser-B9NfvmrP.js} +2 -2
  16. package/dist/{index.browser-BxKN5pIs.js.map → index.browser-B9NfvmrP.js.map} +1 -1
  17. package/dist/{index.browser-CMijwVwX.esm.js → index.browser-CG2sQjrd.esm.js} +2 -2
  18. package/dist/{index.browser-CMijwVwX.esm.js.map → index.browser-CG2sQjrd.esm.js.map} +1 -1
  19. package/dist/{index.browser-BCr9Sc8V.js → index.browser-UxB-zDuA.js} +2 -2
  20. package/dist/{index.browser-BCr9Sc8V.js.map → index.browser-UxB-zDuA.js.map} +1 -1
  21. package/dist/{index.browser-CGZvkfTO.esm.js → index.browser-kQdoMu7Y.esm.js} +2 -2
  22. package/dist/{index.browser-CGZvkfTO.esm.js.map → index.browser-kQdoMu7Y.esm.js.map} +1 -1
  23. package/dist/index.esm.js +1 -1
  24. package/dist/index.js +1 -1
  25. package/dist/{index.native-GyqT8Dn5.esm.js → index.native-CwpIbypp.esm.js} +5488 -2760
  26. package/dist/index.native-CwpIbypp.esm.js.map +1 -0
  27. package/dist/{index.native-FMbSnE7i.js → index.native-Cycwo-3I.js} +5488 -2762
  28. package/dist/index.native-Cycwo-3I.js.map +1 -0
  29. package/dist/index.native.esm.js +1 -1
  30. package/dist/index.native.js +1 -1
  31. package/dist/{phantom-wallet-provider-4_DBhDbx.js → phantom-wallet-provider-BgDhrraw.js} +140 -25
  32. package/dist/phantom-wallet-provider-BgDhrraw.js.map +1 -0
  33. package/dist/{phantom-wallet-provider-BFSfBW0w.esm.js → phantom-wallet-provider-DM-96ILz.esm.js} +136 -21
  34. package/dist/phantom-wallet-provider-DM-96ILz.esm.js.map +1 -0
  35. package/dist/{privy-wallet-provider-Dl0feuCb.esm.js → privy-wallet-provider-C70AIqHI.esm.js} +3 -3
  36. package/dist/{privy-wallet-provider-Dl0feuCb.esm.js.map → privy-wallet-provider-C70AIqHI.esm.js.map} +1 -1
  37. package/dist/{privy-wallet-provider-DRss_Hua.js → privy-wallet-provider-D4IYOUji.js} +3 -3
  38. package/dist/{privy-wallet-provider-DRss_Hua.js.map → privy-wallet-provider-D4IYOUji.js.map} +1 -1
  39. package/dist/{solana-mobile-wallet-provider-CAZs-TkL.js → solana-mobile-wallet-provider-BrjPc7Wd.js} +9 -10
  40. package/dist/{solana-mobile-wallet-provider-CAZs-TkL.js.map → solana-mobile-wallet-provider-BrjPc7Wd.js.map} +1 -1
  41. package/dist/{solana-mobile-wallet-provider-C5mN8Dxh.esm.js → solana-mobile-wallet-provider-CXXw-pKg.esm.js} +3 -4
  42. package/dist/{solana-mobile-wallet-provider-C5mN8Dxh.esm.js.map → solana-mobile-wallet-provider-CXXw-pKg.esm.js.map} +1 -1
  43. package/package.json +3 -2
  44. package/dist/index-BfsQaxom.esm.js.map +0 -1
  45. package/dist/index-CJRFnq6O.esm.js.map +0 -1
  46. package/dist/index-CTtGbOzo.js.map +0 -1
  47. package/dist/index-CvNX4W0l.js +0 -8
  48. package/dist/index-CvNX4W0l.js.map +0 -1
  49. package/dist/index-DBYgqO9f.js.map +0 -1
  50. package/dist/index-DpiO7Cpe.esm.js +0 -6
  51. package/dist/index-DpiO7Cpe.esm.js.map +0 -1
  52. package/dist/index-Lm0k5Hwv.js.map +0 -1
  53. package/dist/index-MF_M5V0O.esm.js.map +0 -1
  54. package/dist/index.native-FMbSnE7i.js.map +0 -1
  55. package/dist/index.native-GyqT8Dn5.esm.js.map +0 -1
  56. package/dist/phantom-wallet-provider-4_DBhDbx.js.map +0 -1
  57. package/dist/phantom-wallet-provider-BFSfBW0w.esm.js.map +0 -1
@@ -0,0 +1,58 @@
1
+ import { Transaction, VersionedTransaction } from '@solana/web3.js';
2
+ import type { AuthProvider, User, TransactionResult, SolTransaction, EVMTransaction, SetOptions } from '@pooflabs/core';
3
+ /**
4
+ * MockPoofnetProvider — a *simulated* wallet for the Poofnet (offchain) preview
5
+ * environment. Lets a draft app be used without a real wallet round-trip: it
6
+ * derives a keypair locally and signs the canonical auth-nonce message itself,
7
+ * minting a genuine session through the normal /session flow (the backend
8
+ * verifier only checks signature + canonical message + nonce — never keypair
9
+ * provenance — so a derived key is accepted exactly like a real wallet).
10
+ *
11
+ * Identity model (no per-wallet secret is ever stored):
12
+ * - A random per-device id (`poofnet:deviceId`, generated once) is the entropy
13
+ * root, so two different users on a *direct* draft URL never collide.
14
+ * - Wallet #N = Keypair.fromSeed( sha256("poofnet-mock:" + deviceId + ":" + appId + ":" + N) )
15
+ * — deterministic, so wallets survive reloads and are re-derived on demand.
16
+ * - Per-app (appId in the seed) and per-device. Cross-device-same-user is a
17
+ * later layer (would mix in the poof platform address when available).
18
+ *
19
+ * Only ever constructed when chain === "offchain" (see auth/index.ts), and it is
20
+ * wrapped by OffchainAuthProvider so transaction mocking is unchanged. Mainnet
21
+ * never touches this class.
22
+ */
23
+ export declare class MockPoofnetProvider implements AuthProvider {
24
+ /** The keypair for the currently-connected mock wallet (re-derived on login/switch/restore). */
25
+ private activeKeypair;
26
+ /** Floating wallet widget root (web only). */
27
+ private widgetEl;
28
+ private widgetExpanded;
29
+ private getDeviceId;
30
+ private getAppId;
31
+ private getWalletMeta;
32
+ private setWalletMeta;
33
+ private deriveKeypair;
34
+ private labelFor;
35
+ /**
36
+ * Sign the canonical nonce message with `keypair` and exchange it for a real
37
+ * Cognito session via the existing /session endpoint. Byte-for-byte the same
38
+ * flow a real Phantom login uses (see phantom-wallet-provider.ts) — only the
39
+ * signer differs.
40
+ */
41
+ private mintSession;
42
+ /** Instant connect as the last-used wallet (or the first one, created on the spot). */
43
+ login(): Promise<User | null>;
44
+ restoreSession(): Promise<User | null>;
45
+ logout(): Promise<void>;
46
+ /** Switch to (and connect as) an existing mock wallet by index. */
47
+ switchWallet(index: number): Promise<User | null>;
48
+ /** Generate a brand-new mock wallet (next index) and connect as it. */
49
+ generateWallet(): Promise<User | null>;
50
+ signMessage(message: string): Promise<string>;
51
+ signMessageMock(message: string): Promise<string>;
52
+ runTransaction(_evmTransactionData?: EVMTransaction, _solTransactionData?: SolTransaction, _options?: SetOptions): Promise<TransactionResult>;
53
+ signTransaction(transaction: Transaction | VersionedTransaction): Promise<Transaction | VersionedTransaction>;
54
+ signAndSubmitTransaction(_transaction: Transaction | VersionedTransaction, _feePayer?: any): Promise<string>;
55
+ getNativeMethods(): Promise<any>;
56
+ private showWalletWidget;
57
+ private removeWalletWidget;
58
+ }
@@ -14,6 +14,8 @@ export interface PhantomWalletConfig {
14
14
  appIcon?: string;
15
15
  /** Enable a "Log in with email" fallback button (via Privy) in the Phantom modal */
16
16
  enablePrivyFallback?: boolean;
17
+ /** Show a "Connect with Poofnet wallet" (simulated) option in the modal — offchain/preview only */
18
+ showPoofnetWallet?: boolean;
17
19
  /** Custom title shown at the top of the login modal. Overrides the default "Log in to your account". */
18
20
  modalTitle?: string;
19
21
  /** Custom subtitle shown below the title in the login modal. */
@@ -50,6 +52,8 @@ export declare class PhantomWalletProvider implements AuthProvider {
50
52
  onSwitchToPrivy: (() => Promise<AuthProvider>) | null;
51
53
  /** Callback to swap to a Mobile Wallet Adapter provider when the user clicks "Connect Mobile Wallet" */
52
54
  onSwitchToMWA: (() => Promise<AuthProvider>) | null;
55
+ /** Callback to swap to the simulated Poofnet provider when the user clicks "Connect with Poofnet wallet" */
56
+ onSwitchToPoofnet: (() => Promise<AuthProvider>) | null;
53
57
  constructor(networkUrl?: string | null, config?: PhantomWalletConfig);
54
58
  private initializeAsync;
55
59
  /**
@@ -78,6 +82,7 @@ export declare class PhantomWalletProvider implements AuthProvider {
78
82
  */
79
83
  login(): Promise<User | null>;
80
84
  restoreSession(): Promise<User | null>;
85
+ private awaitTopLevelConnect;
81
86
  address(): Promise<string | null>;
82
87
  runTransaction(_evmTransactionData?: EVMTransaction, solTransactionData?: SolTransaction, options?: SetOptions): Promise<TransactionResult>;
83
88
  /**