From 44c27cf4ae09341e31012733831391afc5004c69 Mon Sep 17 00:00:00 2001 From: qijieye Date: Mon, 19 Jan 2026 16:56:48 +0100 Subject: [PATCH 1/4] add fx quote related interface --- index.ts | 4 ++++ model/FxQuoteRequest.ts | 21 +++++++++++++++++++++ model/FxQuoteResponse.ts | 29 +++++++++++++++++++++++++++++ model/TransferRequest.ts | 5 ++++- model/TransferResponseV2.ts | 6 ++++++ model/index.ts | 4 ++++ 6 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 model/FxQuoteRequest.ts create mode 100644 model/FxQuoteResponse.ts diff --git a/index.ts b/index.ts index e8077935..1b6320a1 100644 --- a/index.ts +++ b/index.ts @@ -114,6 +114,8 @@ import { FundingLimitRequest, FundingLimitResponse, FutureTransactionPrognosisAmountPair, + FxQuoteRequest, + FxQuoteResponse, GenericPaymentOperation, HotelBookingInfoRequest, HotelBookingInfoResponse, @@ -375,6 +377,8 @@ export { FundingLimitRequest, FundingLimitResponse, FutureTransactionPrognosisAmountPair, + FxQuoteRequest, + FxQuoteResponse, GenericPaymentOperation, HotelBookingInfoRequest, HotelBookingInfoResponse, diff --git a/model/FxQuoteRequest.ts b/model/FxQuoteRequest.ts new file mode 100644 index 00000000..4ff6d42b --- /dev/null +++ b/model/FxQuoteRequest.ts @@ -0,0 +1,21 @@ +import * as isoly from "isoly" +import { isly } from "isly" + +export interface FxQuoteRequest { + from: isoly.Currency + to: isoly.Currency + amountSent?: number + amountReceived?: number + sourceAccount: string +} + +export namespace FxQuoteRequest { + export const type = isly.object({ + from: isly.fromIs("isoly.Currency", isoly.Currency.is), + to: isly.fromIs("isoly.Currency", isoly.Currency.is), + amountSent: isly.number().optional(), + amountReceived: isly.number().optional(), + sourceAccount: isly.string(), + }) + export const is = type.is +} diff --git a/model/FxQuoteResponse.ts b/model/FxQuoteResponse.ts new file mode 100644 index 00000000..77250167 --- /dev/null +++ b/model/FxQuoteResponse.ts @@ -0,0 +1,29 @@ +import * as isoly from "isoly" +import { isly } from "isly" + +export interface FxQuoteResponse { + quoteId: string + validUntil: isoly.DateTime + sourceAccount: string + from: isoly.Currency + to: isoly.Currency + amountSent: number + amountReceived: number + fee: number + fxRate: number +} + +export namespace FxQuoteResponse { + export const type = isly.object({ + quoteId: isly.string(), + validUntil: isly.fromIs("isoly.DateTime", isoly.DateTime.is), + sourceAccount: isly.string(), + from: isly.fromIs("isoly.Currency", isoly.Currency.is), + to: isly.fromIs("isoly.Currency", isoly.Currency.is), + amountSent: isly.number(), + amountReceived: isly.number(), + fee: isly.number(), + fxRate: isly.number(), + }) + export const is = type.is +} diff --git a/model/TransferRequest.ts b/model/TransferRequest.ts index 13fbbce7..d1f55d59 100644 --- a/model/TransferRequest.ts +++ b/model/TransferRequest.ts @@ -1,3 +1,4 @@ +import * as isoly from "isoly" import { MetadataRequest } from "./MetadataRequest" import { PaymentDeliveryRequest } from "./PaymentDeliveryRequest" import { ProviderCode } from "./ProviderCode" @@ -11,11 +12,13 @@ export interface TransferRequest { destinationProviderCode?: ProviderCode destinationProviderAccountId?: string amount: number - currency?: string + currency?: isoly.Currency + currencyReceived?: isoly.Currency reference?: string paymentDate?: string metadata?: MetadataRequest delivery?: PaymentDeliveryRequest batchId?: string verificationOfPayeeId?: string + fxQuoteId?: string } diff --git a/model/TransferResponseV2.ts b/model/TransferResponseV2.ts index 1a840a3d..95d51de6 100644 --- a/model/TransferResponseV2.ts +++ b/model/TransferResponseV2.ts @@ -11,8 +11,11 @@ import { TransferStatus } from "./TransferStatus" export interface TransferResponseV2 { providerCode: ProviderCode providerTransferId: string + externalId: string amount: number + amountReceived: number currency: Currency + currencyReceived?: Currency status: TransferStatus errorMessage?: string createdDate: Date @@ -32,8 +35,11 @@ export namespace TransferResponseV2 { export const type = isly.object({ providerCode: ProviderCode.type, providerTransferId: isly.string(), + externalId: isly.string(), amount: isly.number(), + amountReceived: isly.number(), currency: isly.fromIs("Currency", Currency.is), + currencyReceived: isly.fromIs("Currency", Currency.is).optional(), status: TransferStatus.type, errorMessage: isly.string().optional(), createdDate: isly.fromIs("Date", Date.is), diff --git a/model/index.ts b/model/index.ts index 1bcfcb16..3fe52510 100644 --- a/model/index.ts +++ b/model/index.ts @@ -113,6 +113,8 @@ import { FundingAccountTransferDestinationResponse } from "./FundingAccountTrans import { FundingLimitRequest } from "./FundingLimitRequest" import { FundingLimitResponse } from "./FundingLimitResponse" import { FutureTransactionPrognosisAmountPair } from "./FutureTransactionPrognosisAmountPair" +import { FxQuoteRequest } from "./FxQuoteRequest" +import { FxQuoteResponse } from "./FxQuoteResponse" import { GenericPaymentOperation } from "./GenericPaymentOperation" import { HotelBookingInfoRequest } from "./HotelBookingInfoRequest" import { HotelBookingInfoResponse } from "./HotelBookingInfoResponse" @@ -375,6 +377,8 @@ export { FundingLimitRequest, FundingLimitResponse, FutureTransactionPrognosisAmountPair, + FxQuoteRequest, + FxQuoteResponse, GenericPaymentOperation, HotelBookingInfoRequest, HotelBookingInfoResponse, From 3df8818451836eebae733de6ad1fbb1f876064e9 Mon Sep 17 00:00:00 2001 From: qijieye Date: Thu, 22 Jan 2026 16:31:16 +0100 Subject: [PATCH 2/4] add two endpoints --- Client/Transfers/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Client/Transfers/index.ts b/Client/Transfers/index.ts index b8db8c55..c1c4cff2 100644 --- a/Client/Transfers/index.ts +++ b/Client/Transfers/index.ts @@ -65,4 +65,10 @@ export class Transfers extends List { else return await this.connection.get(`v2/${this.folder}/${transferId}/download`) } + async getFxQuote(request: model.FxQuoteRequest) { + return await this.connection.post(`v2/${this.folder}/fx/quote`, request) + } + async getFxQuoteById(id: string) { + return await this.connection.get(`v2/${this.folder}/fx/quote/${id}`) + } } From d327acc7146b10dcad391477638146009a4c6cf9 Mon Sep 17 00:00:00 2001 From: qijieye Date: Mon, 26 Jan 2026 15:23:36 +0100 Subject: [PATCH 3/4] fix a test --- model/TransferResponseV2.spec.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/model/TransferResponseV2.spec.ts b/model/TransferResponseV2.spec.ts index afcaa033..c34fad4a 100644 --- a/model/TransferResponseV2.spec.ts +++ b/model/TransferResponseV2.spec.ts @@ -4,7 +4,9 @@ describe("TransferResponseV2 is", () => { const json = { providerCode: "modulr", providerTransferId: "P12005RMB0", + externalId: "EXT12345", amount: 1, + amountReceived: 1, currency: "GBP", status: "SETTLED", createdDate: "2022-10-11", From 99172abc484f1db324dfc357d92611bd98ce8c89 Mon Sep 17 00:00:00 2001 From: qijieye Date: Mon, 26 Jan 2026 15:26:44 +0100 Subject: [PATCH 4/4] update --- model/TransferResponseV2.spec.ts | 1 - model/TransferResponseV2.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/model/TransferResponseV2.spec.ts b/model/TransferResponseV2.spec.ts index c34fad4a..765ccb0d 100644 --- a/model/TransferResponseV2.spec.ts +++ b/model/TransferResponseV2.spec.ts @@ -6,7 +6,6 @@ describe("TransferResponseV2 is", () => { providerTransferId: "P12005RMB0", externalId: "EXT12345", amount: 1, - amountReceived: 1, currency: "GBP", status: "SETTLED", createdDate: "2022-10-11", diff --git a/model/TransferResponseV2.ts b/model/TransferResponseV2.ts index 95d51de6..172ba0e2 100644 --- a/model/TransferResponseV2.ts +++ b/model/TransferResponseV2.ts @@ -13,7 +13,7 @@ export interface TransferResponseV2 { providerTransferId: string externalId: string amount: number - amountReceived: number + amountReceived?: number currency: Currency currencyReceived?: Currency status: TransferStatus @@ -37,7 +37,7 @@ export namespace TransferResponseV2 { providerTransferId: isly.string(), externalId: isly.string(), amount: isly.number(), - amountReceived: isly.number(), + amountReceived: isly.number().optional(), currency: isly.fromIs("Currency", Currency.is), currencyReceived: isly.fromIs("Currency", Currency.is).optional(), status: TransferStatus.type,