@chorus-one/ethereum
Version:
All-in-one toolkit for building staking dApps on Ethereum network
41 lines (40 loc) • 1.54 kB
TypeScript
import { Networks } from './types/networks';
import { CreateBatchRequest, CreateBatchResponse, BatchDetailsResponse, ListBatchesResponse } from './types/nativeStaking';
import { PublicClient } from 'viem';
import { NetworkConfig } from './utils/getNetworkConfig';
/**
* Connector for interacting with the Native Staking API
* API documentation: https://native-staking.chorus.one/docs
* Used for creating and managing validator batches
* Requires an API token from Chorus One
* Supports Ethereum mainnet and Hoodi testnet
*/
export declare class NativeStakingConnector {
/** Base URL for Native Staking API */
baseURL: string;
/** API token for authentication */
apiToken: string;
/** Network name for API endpoints */
network: 'mainnet' | 'hoodi';
/** Web3 connector for calling read-only contract methods */
eth: PublicClient;
/** Configuration parameters */
config: NetworkConfig;
constructor(network: Networks, apiToken: string, rpcUrl?: string);
/**
* Makes an authenticated API request to the Native Staking API
*/
private apiRequest;
/**
* Creates a new batch of validators
*/
createBatch(params: CreateBatchRequest): Promise<CreateBatchResponse>;
/**
* Gets detailed information about a validator batch including validator deposit data
*/
getBatchDetails(batchId: string): Promise<BatchDetailsResponse>;
/**
* Lists all batches for the authenticated tenant
*/
listBatches(): Promise<ListBatchesResponse>;
}