@cavos/kit 0.0.1 → 0.0.2

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
@@ -1,4 +1,4 @@
1
- export { BackupSigner, Cavos, CavosAuth, DEVICE_ACCOUNT_CLASS_HASH, HttpRecoveryClient, HttpWalletRegistry, InMemoryWalletRegistry, STARKNET_NETWORKS, StarknetAdapter, StarknetDeviceSigner, UDC_ADDRESS, WebCryptoSigner, bigIntTo32Bytes, bytesToBigInt, bytesToHex, deriveAddressSeed, deriveBackupKey, generateRecoveryCode, hexToBytes, recoverYParity, signatureToFelts, u256ToFelts } from './chunk-XWBX2ZIO.mjs';
1
+ export { BackupSigner, Cavos, CavosAuth, CavosSolana, DEVICE_ACCOUNT_CLASS_HASH, DEVICE_ACCOUNT_PROGRAM_ID, HttpRecoveryClient, HttpWalletRegistry, InMemoryWalletRegistry, SECP256R1_PROGRAM_ID, SOLANA_NETWORKS, STARKNET_NETWORKS, SolanaAdapter, SolanaRelayer, StarknetAdapter, StarknetDeviceSigner, UDC_ADDRESS, WebCryptoSigner, anchorDiscriminator, bigIntTo32Bytes, buildSecp256r1Instruction, bytesToBigInt, bytesToHex, compressedPubkey, deriveAddressSeed, deriveAddressSeedSolana, deriveBackupKey, encodeLowSSignature, generateRecoveryCode, hexToBytes, recoverYParity, serializeInstructions, signatureToFelts, u256ToFelts } from './chunk-PEUQQZB5.mjs';
2
2
 
3
3
  // src/auth/AuthProvider.ts
4
4
  var StaticIdentity = class {
@@ -1,18 +1,23 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { ReactNode } from 'react';
3
- import { S as StarknetNetwork, C as ChainCall } from '../constants-C530TZFF.mjs';
3
+ import { i as Chain, N as NetworkEnv, h as CavosWallet, e as ChainCall } from '../Cavos-C2KHZxxu.mjs';
4
+ import 'starknet';
5
+ import '@solana/web3.js';
4
6
 
5
7
  interface CavosConfig {
6
8
  /** Cavos App ID from the dashboard. */
7
9
  appId?: string;
8
- network: StarknetNetwork;
10
+ /** Target chain. Defaults to 'starknet'. */
11
+ chain?: Chain;
12
+ /** Environment: 'testnet' (sepolia/devnet) or 'mainnet'. */
13
+ network: NetworkEnv;
9
14
  /** Per-app salt so the same user has distinct wallets per app. */
10
15
  appSalt: string;
11
- /** Cavos paymaster API key (sponsors deploy + execute). */
12
- paymasterApiKey: string;
16
+ /** Cavos paymaster API key (sponsors deploy + execute). Required for Starknet. */
17
+ paymasterApiKey?: string;
13
18
  /** Override the Cavos auth backend (self-hosted / staging). */
14
19
  authBackendUrl?: string;
15
- /** Override the Starknet RPC. */
20
+ /** Override the chain RPC. */
16
21
  rpcUrl?: string;
17
22
  }
18
23
  interface CavosModalConfig {
@@ -50,6 +55,14 @@ interface CavosContextValue {
50
55
  closeModal: () => void;
51
56
  isAuthenticated: boolean;
52
57
  user: UserInfo | null;
58
+ /** The active chain ('starknet' | 'solana'). */
59
+ chain: Chain;
60
+ /**
61
+ * The raw connected wallet, discriminated by `wallet.chain`. Use this for
62
+ * chain-native calls (e.g. Solana `wallet.execute(amount, dest)`); narrow on
63
+ * `wallet.chain` first. Null until connected.
64
+ */
65
+ wallet: CavosWallet | null;
53
66
  address: string | null;
54
67
  walletStatus: WalletStatus;
55
68
  isLoading: boolean;
@@ -1,18 +1,23 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { ReactNode } from 'react';
3
- import { S as StarknetNetwork, C as ChainCall } from '../constants-C530TZFF.js';
3
+ import { i as Chain, N as NetworkEnv, h as CavosWallet, e as ChainCall } from '../Cavos-C2KHZxxu.js';
4
+ import 'starknet';
5
+ import '@solana/web3.js';
4
6
 
5
7
  interface CavosConfig {
6
8
  /** Cavos App ID from the dashboard. */
7
9
  appId?: string;
8
- network: StarknetNetwork;
10
+ /** Target chain. Defaults to 'starknet'. */
11
+ chain?: Chain;
12
+ /** Environment: 'testnet' (sepolia/devnet) or 'mainnet'. */
13
+ network: NetworkEnv;
9
14
  /** Per-app salt so the same user has distinct wallets per app. */
10
15
  appSalt: string;
11
- /** Cavos paymaster API key (sponsors deploy + execute). */
12
- paymasterApiKey: string;
16
+ /** Cavos paymaster API key (sponsors deploy + execute). Required for Starknet. */
17
+ paymasterApiKey?: string;
13
18
  /** Override the Cavos auth backend (self-hosted / staging). */
14
19
  authBackendUrl?: string;
15
- /** Override the Starknet RPC. */
20
+ /** Override the chain RPC. */
16
21
  rpcUrl?: string;
17
22
  }
18
23
  interface CavosModalConfig {
@@ -50,6 +55,14 @@ interface CavosContextValue {
50
55
  closeModal: () => void;
51
56
  isAuthenticated: boolean;
52
57
  user: UserInfo | null;
58
+ /** The active chain ('starknet' | 'solana'). */
59
+ chain: Chain;
60
+ /**
61
+ * The raw connected wallet, discriminated by `wallet.chain`. Use this for
62
+ * chain-native calls (e.g. Solana `wallet.execute(amount, dest)`); narrow on
63
+ * `wallet.chain` first. Null until connected.
64
+ */
65
+ wallet: CavosWallet | null;
53
66
  address: string | null;
54
67
  walletStatus: WalletStatus;
55
68
  isLoading: boolean;