@sudowealth/schwab-api
Version:
TypeScript client for Charles Schwab API with OAuth support, market data, trading functionality, and complete type safety
24 lines (23 loc) • 842 B
TypeScript
import { type RequestContext } from '../core/http';
import { type SchwabTokenResponse } from './types';
export interface ExchangeCodeForTokenOptions {
clientId: string;
clientSecret: string;
code: string;
redirectUri: string;
tokenUrl?: string;
}
export interface RefreshTokenOptions {
clientId: string;
clientSecret: string;
refreshToken: string;
tokenUrl?: string;
}
/**
* Exchange an authorization code for an access token using the provided context
*/
export declare function exchangeCodeForTokenWithContext(context: RequestContext, opts: ExchangeCodeForTokenOptions): Promise<SchwabTokenResponse>;
/**
* Refresh an access token using a refresh token with context
*/
export declare function refreshTokenWithContext(context: RequestContext, opts: RefreshTokenOptions): Promise<SchwabTokenResponse>;