UNPKG

@moneygraph/sdk

Version:

AI-native SDK for global payouts powered by StratosPay

87 lines (86 loc) 2.93 kB
/** * MoneyGraph SDK - Onboard Module * * Complete customer onboarding including: * - Customer CRUD operations * - Director management (for business accounts) * - KYC submission and document upload * - Wallet and transaction access * - Mock personas for sandbox testing */ import { ApiClient } from '../api/client'; import type { Customer, CreateCustomerParams, UpdateCustomerParams, Director, CreateDirectorParams, UpdateDirectorParams, Wallet, Transaction, PaginatedResponse, MockPersonaType, KycStatus } from '../types'; export declare class OnboardModule { private readonly client; constructor(client: ApiClient); /** * Create a new customer (personal or business) */ createCustomer(params: CreateCustomerParams): Promise<Customer>; /** * Get all customers (paginated) */ listCustomers(page?: number): Promise<PaginatedResponse<Customer>>; /** * Get a single customer by ID */ getCustomer(customerId: string): Promise<Customer>; /** * Update a customer */ updateCustomer(customerId: string, params: UpdateCustomerParams): Promise<Customer>; /** * Create a mock persona for testing (sandbox only) * Instantly creates a customer with pre-filled data */ createMockPersona(type: MockPersonaType): Promise<Customer>; /** * Submit KYC for review */ submitKyc(customerId: string): Promise<void>; /** * Upload KYC document * @param documentType - 'document' or 'selfie' */ uploadDocument(customerId: string, documentType: 'document' | 'selfie', file: Blob | Buffer, filename: string): Promise<void>; /** * Check if customer can make payouts (KYC approved) */ canPayout(customerId: string): Promise<{ allowed: boolean; status: KycStatus; reason?: string; }>; /** * List all directors for a business customer */ listDirectors(customerId: string): Promise<PaginatedResponse<Director>>; /** * Get a single director */ getDirector(customerId: string, directorId: string): Promise<Director>; /** * Create a new director */ createDirector(customerId: string, params: CreateDirectorParams): Promise<Director>; /** * Update a director */ updateDirector(customerId: string, directorId: string, params: UpdateDirectorParams): Promise<Director>; /** * Delete a director */ deleteDirector(customerId: string, directorId: string): Promise<void>; /** * Get all wallets for a customer */ getWallets(customerId: string): Promise<Wallet[]>; /** * Get all transactions for a customer (paginated) */ listTransactions(customerId: string, page?: number): Promise<PaginatedResponse<Transaction>>; /** * Get a single transaction */ getTransaction(customerId: string, transactionId: string): Promise<Transaction>; }