@bounded-sh/client 0.0.17 → 0.0.19

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 (39) hide show
  1. package/README.md +2 -1
  2. package/dist/auth/index.d.ts +2 -4
  3. package/dist/auth/providers/mock-auth-provider.d.ts +0 -1
  4. package/dist/auth/providers/offchain-auth-provider.d.ts +3 -4
  5. package/dist/auth/providers/phantom-wallet-provider.d.ts +3 -2
  6. package/dist/auth/providers/privy-wallet-provider.d.ts +10 -7
  7. package/dist/auth/providers/solana-mobile-wallet-provider.d.ts +3 -2
  8. package/dist/auth/solana-rpc.d.ts +8 -0
  9. package/dist/index.js +310 -2682
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +310 -2682
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/{index.native-DoiNBZlU.js → index.native-DI_Xgv-n.js} +205 -2558
  14. package/dist/index.native-DI_Xgv-n.js.map +1 -0
  15. package/dist/{index.native-DlMO7aHv.mjs → index.native-DWI_i6-6.mjs} +202 -2556
  16. package/dist/index.native-DWI_i6-6.mjs.map +1 -0
  17. package/dist/index.native.js +2 -2
  18. package/dist/index.native.mjs +2 -2
  19. package/dist/{phantom-wallet-provider-DWG1LVJf.mjs → phantom-wallet-provider-DDwgNMg_.mjs} +7 -18
  20. package/dist/phantom-wallet-provider-DDwgNMg_.mjs.map +1 -0
  21. package/dist/{phantom-wallet-provider-DUdnFoyb.js → phantom-wallet-provider-fyOrJZP6.js} +7 -18
  22. package/dist/phantom-wallet-provider-fyOrJZP6.js.map +1 -0
  23. package/dist/{privy-wallet-provider-Kv6H3xcS.js → privy-wallet-provider-BIr9lDS7.js} +69 -90
  24. package/dist/privy-wallet-provider-BIr9lDS7.js.map +1 -0
  25. package/dist/{privy-wallet-provider-CyNLekvY.mjs → privy-wallet-provider-D7VoQCYf.mjs} +68 -89
  26. package/dist/privy-wallet-provider-D7VoQCYf.mjs.map +1 -0
  27. package/dist/{solana-mobile-wallet-provider-BfHBucO0.js → solana-mobile-wallet-provider-Cush-URL.js} +39 -25
  28. package/dist/solana-mobile-wallet-provider-Cush-URL.js.map +1 -0
  29. package/dist/{solana-mobile-wallet-provider-CKOSbLRd.mjs → solana-mobile-wallet-provider-DgcGxDoL.mjs} +39 -25
  30. package/dist/solana-mobile-wallet-provider-DgcGxDoL.mjs.map +1 -0
  31. package/package.json +2 -2
  32. package/dist/index.native-DlMO7aHv.mjs.map +0 -1
  33. package/dist/index.native-DoiNBZlU.js.map +0 -1
  34. package/dist/phantom-wallet-provider-DUdnFoyb.js.map +0 -1
  35. package/dist/phantom-wallet-provider-DWG1LVJf.mjs.map +0 -1
  36. package/dist/privy-wallet-provider-CyNLekvY.mjs.map +0 -1
  37. package/dist/privy-wallet-provider-Kv6H3xcS.js.map +0 -1
  38. package/dist/solana-mobile-wallet-provider-BfHBucO0.js.map +0 -1
  39. package/dist/solana-mobile-wallet-provider-CKOSbLRd.mjs.map +0 -1
package/README.md CHANGED
@@ -147,6 +147,8 @@ The `set` and `get` functions automatically handle whether data is stored **on-c
147
147
 
148
148
  - Transactions are handled automatically, and users may be prompted to approve blockchain transactions.
149
149
 
150
+ - On-chain transactions require an explicit Solana RPC URL in `init({ rpcUrl })`; the SDK does not choose a bundled mainnet/devnet RPC when this is omitted.
151
+
150
152
  **Off-Chain Data:**
151
153
 
152
154
  - If the data path corresponds to off-chain storage, the `set` function will store data off-chain.
@@ -295,4 +297,3 @@ This Tarobase JS SDK project is licensed under the MIT License.
295
297
 
296
298
 
297
299
  Thank you for using the Tarobase JS SDK! If you have any questions or need further assistance, feel free to crete an issue.
298
-
@@ -1,6 +1,6 @@
1
1
  import { AuthProvider, User, ClientConfig } from "@bounded-sh/core";
2
2
  /**
3
- * Clears the session if it was created before auth method tracking (legacy session).
3
+ * Clears the session if it was created by a different auth method.
4
4
  * Returns true if the session was cleared, false if the session is compatible.
5
5
  *
6
6
  * Dispatches to the correct session manager based on the current auth method
@@ -8,9 +8,7 @@ import { AuthProvider, User, ClientConfig } from "@bounded-sh/core";
8
8
  * are properly cleared.
9
9
  */
10
10
  export declare function clearIncompatibleSession(): boolean;
11
- export declare const SOLANA_DEVNET_RPC_URL = "https://idelle-8nxsep-fast-devnet.helius-rpc.com";
12
- export declare const SOLANA_MAINNET_RPC_URL = "https://celestia-cegncv-fast-mainnet.helius-rpc.com";
13
- export declare const SURFNET_RPC_URL = "https://surfpool.fly.dev";
11
+ export { SOLANA_DEVNET_RPC_URL, SOLANA_MAINNET_RPC_URL, SURFNET_RPC_URL, } from "./solana-rpc";
14
12
  export declare function getAuthProvider(config?: Partial<ClientConfig>): Promise<AuthProvider>;
15
13
  /** Per-call overrides forwarded to the active auth provider's modal. */
16
14
  export interface LoginOptions {
@@ -23,7 +23,6 @@ export declare class MockAuthProvider implements AuthProvider {
23
23
  */
24
24
  signMessage(message: string): Promise<string>;
25
25
  signMessageMock(message: string): Promise<string>;
26
- private generateOffchainSignature;
27
26
  /**
28
27
  * Mock transaction signing - returns the transaction as-is (no actual signing)
29
28
  */
@@ -9,9 +9,9 @@ export interface OffchainAuthProviderConfig {
9
9
  /**
10
10
  * OffchainAuthProvider wraps a real auth provider (e.g., Phantom) for the poofnet environment.
11
11
  *
12
- * For signMessageMock, this shows a custom confirmation modal and generates a mock signature.
13
- * This is used for offchain transaction signing. For real wallet signing, use signMessage
14
- * which delegates to the wrapped provider.
12
+ * For signMessageMock, this shows a custom confirmation modal and then delegates
13
+ * to the wrapped provider for a real detached signature over the exact offchain
14
+ * transaction message.
15
15
  */
16
16
  export declare class OffchainAuthProvider implements AuthProvider {
17
17
  private wrappedProvider;
@@ -46,5 +46,4 @@ export declare class OffchainAuthProvider implements AuthProvider {
46
46
  private buildTransactionModalContent;
47
47
  private buildInstructionElement;
48
48
  private getModalStyles;
49
- private generateMockSignature;
50
49
  }
@@ -33,6 +33,7 @@ export declare class PhantomWalletProvider implements AuthProvider {
33
33
  private static instance;
34
34
  private containerElement;
35
35
  private networkUrl;
36
+ private configuredNetwork;
36
37
  private root;
37
38
  private phantomMethods;
38
39
  private config;
@@ -46,13 +47,13 @@ export declare class PhantomWalletProvider implements AuthProvider {
46
47
  setLoginOverrides(opts: LoginOptions | null): void;
47
48
  /** Callback to swap to a Mobile Wallet Adapter provider when the user clicks "Connect Mobile Wallet" */
48
49
  onSwitchToMWA: (() => Promise<AuthProvider>) | null;
49
- constructor(networkUrl?: string | null, config?: PhantomWalletConfig);
50
+ constructor(networkUrl?: string | null, config?: PhantomWalletConfig, configuredNetwork?: string | null);
50
51
  private initializeAsync;
51
52
  /**
52
53
  * Check if social login providers are configured (non-injected providers).
53
54
  */
54
55
  private hasSocialProviders;
55
- static getInstance(networkUrl: string | null, config: PhantomWalletConfig): PhantomWalletProvider;
56
+ static getInstance(networkUrl: string | null, config: PhantomWalletConfig, configuredNetwork?: string | null): PhantomWalletProvider;
56
57
  private resolveProviders;
57
58
  /**
58
59
  * Patch the Phantom extension's provider to gracefully handle `phantom_getFeatures`
@@ -1,25 +1,26 @@
1
1
  import type { EVMTransaction, SolTransaction, TransactionResult, AuthProvider, User, SetOptions } from '@bounded-sh/core';
2
2
  import { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
3
+ type PrivyWalletConfig = {
4
+ appId: string;
5
+ config: any;
6
+ };
3
7
  export declare class PrivyWalletProvider implements AuthProvider {
4
8
  private static instance;
5
9
  private containerElement;
6
10
  private networkUrl;
11
+ private configuredNetwork;
7
12
  private chainId;
8
13
  private root;
9
14
  private privyMethods;
10
15
  private privyConfig;
11
16
  private pendingLogin;
12
- private rpcDevnetUrl;
13
- private rpcMainnetUrl;
17
+ private configuredRpcUrl;
14
18
  private pendingTransaction;
15
19
  private pendingSignTransaction;
16
20
  private pendingSignMessage;
17
21
  private pendingSignAndSubmitTransaction;
18
- constructor(appName: string | null, appLogoUrl: string | null, privyConfig?: {
19
- appId: string;
20
- config: any;
21
- }, networkUrl?: string | null);
22
- static getInstance(appName: string | null, appLogoUrl: string | null, privyConfig: any): PrivyWalletProvider;
22
+ constructor(appName: string | null, appLogoUrl: string | null, privyConfig: PrivyWalletConfig | undefined, networkUrl?: string | null, configuredNetwork?: string | null);
23
+ static getInstance(appName: string | null, appLogoUrl: string | null, privyConfig: PrivyWalletConfig, networkUrl?: string | null, configuredNetwork?: string | null): PrivyWalletProvider;
23
24
  private initialize;
24
25
  login(): Promise<User | null>;
25
26
  getNativeMethods(): Promise<any>;
@@ -51,6 +52,7 @@ export declare class PrivyWalletProvider implements AuthProvider {
51
52
  */
52
53
  signAndSubmitTransaction(transaction: Transaction | VersionedTransaction, feePayer?: PublicKey): Promise<string>;
53
54
  private getRpcUrl;
55
+ private getChainId;
54
56
  /**
55
57
  * Internal sign transaction - serializes and signs via Privy
56
58
  * Returns the raw result from Privy (Uint8Array)
@@ -80,3 +82,4 @@ export declare class PrivyWalletProvider implements AuthProvider {
80
82
  private waitForMatchingWallet;
81
83
  private ensureReady;
82
84
  }
85
+ export {};
@@ -73,14 +73,15 @@ export declare function registerMobileWalletAdapter(config?: {
73
73
  export declare class SolanaMobileWalletProvider implements AuthProvider {
74
74
  private static instance;
75
75
  private networkUrl;
76
+ private configuredNetwork;
76
77
  private config;
77
78
  private appIdentity;
78
79
  /** Raw cluster name (e.g. 'mainnet-beta'); mapped via mapChainToWalletStandard. */
79
80
  private cluster;
80
81
  /** LocalSolanaMobileWalletAdapterWallet, lazy-constructed in ensureWallet(). */
81
82
  private wallet;
82
- constructor(networkUrl?: string | null, config?: SolanaMobileWalletConfig);
83
- static getInstance(networkUrl: string | null, config: SolanaMobileWalletConfig): SolanaMobileWalletProvider;
83
+ constructor(networkUrl?: string | null, config?: SolanaMobileWalletConfig, configuredNetwork?: string | null);
84
+ static getInstance(networkUrl: string | null, config: SolanaMobileWalletConfig, configuredNetwork?: string | null): SolanaMobileWalletProvider;
84
85
  /** Lazy-construct LocalSolanaMobileWalletAdapterWallet on first need. */
85
86
  private ensureWallet;
86
87
  /**
@@ -0,0 +1,8 @@
1
+ export declare const SOLANA_DEVNET_RPC_URL = "https://idelle-8nxsep-fast-devnet.helius-rpc.com";
2
+ export declare const SOLANA_MAINNET_RPC_URL = "https://celestia-cegncv-fast-mainnet.helius-rpc.com";
3
+ export declare const SURFNET_RPC_URL = "https://surfpool.fly.dev";
4
+ export type SolanaRpcNetwork = "solana_devnet" | "solana_mainnet" | "surfnet";
5
+ export declare function normalizeSolanaRpcUrl(rpcUrl: string | null | undefined): string | null;
6
+ export declare function isSupportedSolanaRpcNetwork(network: string | null | undefined): network is SolanaRpcNetwork;
7
+ export declare function resolveSolanaWalletStandardChain(network: string | null | undefined, context: string): string;
8
+ export declare function resolveSolanaRpcUrl(explicitRpcUrl: string | null | undefined, network: string | null | undefined, context: string): string;