/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { accountTransfersAcceptTransfer } from "../funcs/accountTransfersAcceptTransfer.js"; import { accountTransfersCreateTransfer } from "../funcs/accountTransfersCreateTransfer.js"; import { accountTransfersGetTransfer } from "../funcs/accountTransfersGetTransfer.js"; import { accountTransfersListTransfers } from "../funcs/accountTransfersListTransfers.js"; import { accountTransfersRejectTransfer } from "../funcs/accountTransfersRejectTransfer.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; import { PageIterator, unwrapResultIterator } from "../types/operations.js"; export class AccountTransfers extends ClientSDK { /** * Create Transfer * * @remarks * Creates a transfer */ async createTransfer( transferCreate: components.TransferCreate, correspondentId: string, accountId: string, requestId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(accountTransfersCreateTransfer( this, transferCreate, correspondentId, accountId, requestId, options, )); } /** * List Transfers * * @remarks * Lists existing transfers using a CEL filter. */ async listTransfers( request: operations.AccountTransfersListTransfersRequest, options?: RequestOptions, ): Promise< PageIterator< operations.AccountTransfersListTransfersResponse, { cursor: string } > > { return unwrapResultIterator(accountTransfersListTransfers( this, request, options, )); } /** * Accept Transfer * * @remarks * Accept one side (incoming/outgoing) of an internal Ascend transfer. When both the incoming side and outgoing side of the transfer have been accepted then bookkeeping is done immediately. If neither, or only one side of a transfer is accepted, then both sides of the internal perform bookkeeping one full settlement day after they went into the bookkeeping queue. */ async acceptTransfer( acceptTransferRequestCreate: components.AcceptTransferRequestCreate, correspondentId: string, accountId: string, transferId: string, options?: RequestOptions, ): Promise { return unwrapAsync(accountTransfersAcceptTransfer( this, acceptTransferRequestCreate, correspondentId, accountId, transferId, options, )); } /** * Reject Transfer * * @remarks * Reject one side (incoming/outgoing) of an internal Ascend transfer. Rejecting one side automatically moves the contra side of the transfer to be rejected as well. */ async rejectTransfer( rejectTransferRequestCreate: components.RejectTransferRequestCreate, correspondentId: string, accountId: string, transferId: string, options?: RequestOptions, ): Promise { return unwrapAsync(accountTransfersRejectTransfer( this, rejectTransferRequestCreate, correspondentId, accountId, transferId, options, )); } /** * Get Transfer * * @remarks * Gets an existing transfer */ async getTransfer( correspondentId: string, accountId: string, transferId: string, options?: RequestOptions, ): Promise { return unwrapAsync(accountTransfersGetTransfer( this, correspondentId, accountId, transferId, options, )); } }