import Mpc from '../../../mpc' import type { NoahGetPayoutChannelsRequest, NoahGetPayoutChannelsResponse, NoahGetPayoutChannelFormResponse, NoahGetPayoutCountriesResponse, NoahGetPaymentMethodsResponse, NoahGetPayoutQuoteRequest, NoahGetPayoutQuoteResponse, NoahInitiateKycRequest, NoahInitiateKycResponse, NoahInitiatePayinRequest, NoahInitiatePayinResponse, NoahInitiatePayoutRequest, NoahInitiatePayoutResponse, NoahSimulatePayinRequest, NoahSimulatePayinResponse, } from '../../../shared/types' /** * Noah fiat on/off-ramp API on `portal.ramps.noah`. * Each method forwards to the embedded Portal iframe, which calls connect-api. */ export default class Noah { private mpc: Mpc constructor({ mpc }: { mpc: Mpc }) { this.mpc = mpc } /** Start hosted KYC; response includes `hostedUrl` to open in a browser tab. */ public async initiateKyc( data: NoahInitiateKycRequest, ): Promise { return this.mpc.initiateKyc(data) } /** Create a pay-in (fiat → crypto) with bank transfer instructions. */ public async initiatePayin( data: NoahInitiatePayinRequest, ): Promise { return this.mpc.initiatePayin(data) } /** Dry-run pay-in pricing / eligibility for a payment method and fiat amount. */ public async simulatePayin( data: NoahSimulatePayinRequest, ): Promise { return this.mpc.simulatePayin(data) } /** Countries supported for fiat payouts. */ public async getPayoutCountries(): Promise { return this.mpc.getPayoutCountries() } /** Available payout rails for a country / currency pair. */ public async getPayoutChannels( data: NoahGetPayoutChannelsRequest, ): Promise { return this.mpc.getPayoutChannels(data) } /** Dynamic form schema for a payout channel (recipient fields). */ public async getPayoutChannelForm( channelId: string, ): Promise { return this.mpc.getPayoutChannelForm(channelId) } /** Quote fees and crypto amount for a payout channel and form payload. */ public async getPayoutQuote( data: NoahGetPayoutQuoteRequest, ): Promise { return this.mpc.getPayoutQuote(data) } /** Start payout execution; may return on-chain deposit `conditions` for crypto legs. */ public async initiatePayout( data: NoahInitiatePayoutRequest, ): Promise { return this.mpc.initiatePayout(data) } /** Pay-in payment methods available to the customer. */ public async getPaymentMethods(): Promise { return this.mpc.getPaymentMethods() } }