@coinbase/cdp-sdk
Version:
SDK for interacting with the Coinbase Developer Platform Wallet API
54 lines (48 loc) • 2.06 kB
text/typescript
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* Coinbase Developer Platform APIs
* The Coinbase Developer Platform APIs - leading the world's transition onchain.
* OpenAPI spec version: 2.0.0
*/
import type {
ListPaymentMethods200,
ListPaymentMethodsParams,
PaymentMethodId,
PaymentMethodsPaymentMethod,
} from "../coinbaseDeveloperPlatformAPIs.schemas.js";
import { cdpApiClient } from "../../cdpApiClient.js";
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
/**
* List payment methods linked to your entity. Payment methods represent external financial instruments that can be used as a target for transfers. The list will not include disabled or deleted payment methods.
**Currently Supported Types:**
- `fedwire`: Domestic USD wire transfers
- `swift`: International wire transfers
- `sepa`: SEPA EUR transfers
**Note:** Payment methods are created and verified through your linked CDP entity. Currently, fetching payment methods is only supported for Prime investment vehicles linked to CDP.
* @summary List payment methods
*/
export const listPaymentMethods = (
params?: ListPaymentMethodsParams,
options?: SecondParameter<typeof cdpApiClient<ListPaymentMethods200>>,
) => {
return cdpApiClient<ListPaymentMethods200>(
{ url: `/v2/payment-methods`, method: "GET", params },
options,
);
};
/**
* Get details of a specific payment method by its ID. Returns 404 if the payment method is not found or not owned by the requesting entity.
* @summary Get payment method
*/
export const getPaymentMethod = (
paymentMethodId: PaymentMethodId,
options?: SecondParameter<typeof cdpApiClient<PaymentMethodsPaymentMethod>>,
) => {
return cdpApiClient<PaymentMethodsPaymentMethod>(
{ url: `/v2/payment-methods/${paymentMethodId}`, method: "GET" },
options,
);
};
export type ListPaymentMethodsResult = NonNullable<Awaited<ReturnType<typeof listPaymentMethods>>>;
export type GetPaymentMethodResult = NonNullable<Awaited<ReturnType<typeof getPaymentMethod>>>;