@nexuspay/sdk
Version:
🚀 Ultra-simple cross-chain wallet SDK - Initialize with just projectName + apiKey. Bulletproof gasless transactions across EVM/SVM chains with ANY social identifier support
50 lines (49 loc) • 1.89 kB
TypeScript
/**
* NexusProvider - Ultra-Simple Cross-Chain Wallet Provider
* Provides access to simplified SDK features with React state management
*/
import React, { ReactNode } from 'react';
import { NexusSDK, SimpleNexusConfig } from '../../core/NexusSDK.js';
import { NexusError, Wallet, TransactionResult, WalletBalances, BridgeResult, PaymasterBalance, AnalyticsOverview, SupportedChain } from '../../types/index.js';
export interface NexusProviderProps {
config: SimpleNexusConfig;
children: ReactNode;
}
export interface UseNexusReturn {
sdk: NexusSDK | null;
isLoading: boolean;
error: NexusError | null;
createWallet: (socialId: string, socialType: string, chains?: SupportedChain[]) => Promise<Wallet>;
getWallet: (socialId: string, socialType: string) => Promise<Wallet>;
getWalletBalances: (socialId: string, socialType: string) => Promise<WalletBalances>;
sendTransaction: (data: {
socialId: string;
socialType: string;
chain: SupportedChain;
to: string;
value?: string;
data?: string;
}) => Promise<TransactionResult>;
transferTokens: (data: {
socialId: string;
socialType: string;
chain: SupportedChain;
to: string;
amount: string;
token?: string;
}) => Promise<TransactionResult>;
bridgeTokens: (data: {
socialId: string;
socialType: string;
fromChain: SupportedChain;
toChain: SupportedChain;
amount: string;
token?: string;
}) => Promise<BridgeResult>;
getAnalytics: (days?: number) => Promise<AnalyticsOverview>;
getPaymasterBalances: () => Promise<PaymasterBalance[]>;
clearError: () => void;
}
export declare const NexusContext: React.Context<UseNexusReturn | undefined>;
export declare const NexusProvider: React.FC<NexusProviderProps>;
export default NexusProvider;