@riocrypto/common 1.0.2694 → 1.0.2698
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/events/bank-account-verification-dispatched-event.d.ts +1 -1
- package/build/events/fintoc-deposit-CLABE-created-event.d.ts +7 -0
- package/build/events/fintoc-deposit-CLABE-created-event.js +2 -0
- package/build/events/fintoc-deposit-completed-event.d.ts +8 -0
- package/build/events/fintoc-deposit-completed-event.js +2 -0
- package/build/events/fintoc-payment-received-event.d.ts +12 -0
- package/build/events/fintoc-payment-received-event.js +2 -0
- package/build/events/fintoc-withdrawal-completed-event.d.ts +14 -0
- package/build/events/fintoc-withdrawal-completed-event.js +2 -0
- package/build/events/fintoc-withdrawal-failed-event.d.ts +11 -0
- package/build/events/fintoc-withdrawal-failed-event.js +2 -0
- package/build/events/fintoc-withdrawal-initiated-event.d.ts +7 -0
- package/build/events/fintoc-withdrawal-initiated-event.js +2 -0
- package/build/events/inbound-fintoc-bank-deposit-received-event.d.ts +15 -0
- package/build/events/inbound-fintoc-bank-deposit-received-event.js +2 -0
- package/build/events/rio-settings-updated-event.d.ts +0 -6
- package/build/events/rio-settings-updated-event.js +0 -1
- package/build/events/subjects.d.ts +7 -0
- package/build/events/subjects.js +7 -0
- package/build/helpers/get-default-processor.d.ts +5 -0
- package/build/helpers/get-default-processor.js +70 -0
- package/build/helpers/get-processors-for-corridor.d.ts +10 -0
- package/build/helpers/get-processors-for-corridor.js +108 -0
- package/build/helpers/get-routing-candidates.d.ts +10 -0
- package/build/helpers/get-routing-candidates.js +29 -0
- package/build/helpers/verifiable-payin-processors.d.ts +3 -0
- package/build/helpers/verifiable-payin-processors.js +27 -0
- package/build/index.d.ts +17 -0
- package/build/index.js +17 -0
- package/build/types/bank-account-verification.d.ts +1 -1
- package/build/types/fintoc-deposit-CLABE.d.ts +12 -0
- package/build/types/fintoc-deposit-CLABE.js +2 -0
- package/build/types/fintoc-mxn-withdrawal-status.d.ts +7 -0
- package/build/types/fintoc-mxn-withdrawal-status.js +11 -0
- package/build/types/fintoc-mxn-withdrawal.d.ts +22 -0
- package/build/types/fintoc-mxn-withdrawal.js +2 -0
- package/build/types/map-imported-transfer-status.js +4 -0
- package/build/types/payment-address-verification.d.ts +24 -0
- package/build/types/payment-address-verification.js +2 -0
- package/build/types/processor-readiness.d.ts +38 -0
- package/build/types/processor-readiness.js +26 -0
- package/build/types/processor-routing.d.ts +20 -0
- package/build/types/processor-routing.js +14 -0
- package/build/types/processor.d.ts +1 -0
- package/build/types/processor.js +1 -0
- package/build/types/rio-bank-account.d.ts +2 -0
- package/build/types/rio-settings-update.d.ts +0 -6
- package/build/types/rio-settings-update.js +0 -1
- package/build/types/rio-settings.d.ts +2 -6
- package/build/types/rio-settings.js +0 -1
- package/build/types/treasury-provider.d.ts +1 -0
- package/build/types/treasury-provider.js +1 -0
- package/build/types/user-attribute.d.ts +0 -6
- package/build/types/user-attribute.js +0 -6
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ export interface BankAccountVerificationDispatchedEvent {
|
|
|
4
4
|
subject: Subjects.BankAccountVerificationDispatched;
|
|
5
5
|
data: {
|
|
6
6
|
id: string;
|
|
7
|
-
provider?: Processor.SPEI_STP | Processor.SPEI_NVIO | Processor.Alfin;
|
|
7
|
+
provider?: Processor.SPEI_STP | Processor.SPEI_NVIO | Processor.SPEI_FINTOC | Processor.Alfin;
|
|
8
8
|
providerWithdrawalId?: string;
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Subjects } from "./subjects";
|
|
2
|
+
export interface FintocPaymentReceivedEvent {
|
|
3
|
+
subject: Subjects.FintocPaymentReceived;
|
|
4
|
+
data: {
|
|
5
|
+
orderId?: string;
|
|
6
|
+
bulkBankPaymentId?: string;
|
|
7
|
+
amount: number;
|
|
8
|
+
originAccountHolderName?: string;
|
|
9
|
+
originCLABE?: string;
|
|
10
|
+
originBank?: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Subjects } from "./subjects";
|
|
2
|
+
export interface FintocWithdrawalCompletedEvent {
|
|
3
|
+
subject: Subjects.FintocWithdrawalCompleted;
|
|
4
|
+
data: {
|
|
5
|
+
orderId?: string;
|
|
6
|
+
bulkBankPayoutId?: string;
|
|
7
|
+
internalTransferId?: string;
|
|
8
|
+
amount: number;
|
|
9
|
+
fintocTransferId?: string;
|
|
10
|
+
trackingKey?: string;
|
|
11
|
+
receiptUrl?: string;
|
|
12
|
+
reference?: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BankPayoutFailureReason } from "../types/bank-payout-failure-reason";
|
|
2
|
+
import { Subjects } from "./subjects";
|
|
3
|
+
export interface FintocWithdrawalFailedEvent {
|
|
4
|
+
subject: Subjects.FintocWithdrawalFailed;
|
|
5
|
+
data: {
|
|
6
|
+
orderId?: string;
|
|
7
|
+
bulkBankPayoutId?: string;
|
|
8
|
+
reason: BankPayoutFailureReason;
|
|
9
|
+
errorMessage?: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Fiat } from "../types/fiat";
|
|
2
|
+
import { Subjects } from "./subjects";
|
|
3
|
+
export interface InboundFintocBankDepositReceivedEvent {
|
|
4
|
+
subject: Subjects.InboundFintocBankDepositReceived;
|
|
5
|
+
data: {
|
|
6
|
+
fiat: Fiat;
|
|
7
|
+
amount: number;
|
|
8
|
+
originAccountHolderName: string;
|
|
9
|
+
originAccountNumber?: string;
|
|
10
|
+
originCLABE?: string;
|
|
11
|
+
originBank?: string;
|
|
12
|
+
reference?: string;
|
|
13
|
+
fintocTransferId: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -3,7 +3,6 @@ import { DeferredPaymentType } from "../types/deferred-payment-type";
|
|
|
3
3
|
import { Fiat } from "../types/fiat";
|
|
4
4
|
import { FXProvider } from "../types/fx-provider";
|
|
5
5
|
import { FXTradingPolicies } from "../types/fx-trading-policy";
|
|
6
|
-
import { Processor } from "../types/processor";
|
|
7
6
|
import { Side } from "../types/side";
|
|
8
7
|
import { TVFXDataProvider } from "../types/TV-FX-data-provider";
|
|
9
8
|
import { Subjects } from "./subjects";
|
|
@@ -67,11 +66,6 @@ export interface RioSettingsUpdatedEvent {
|
|
|
67
66
|
[key in Side]?: number;
|
|
68
67
|
};
|
|
69
68
|
};
|
|
70
|
-
activeFiatPaymentProcessors?: {
|
|
71
|
-
[Side.Buy]: Processor[];
|
|
72
|
-
[Side.Sell]: Processor[];
|
|
73
|
-
bankAccountVerifications: Processor[];
|
|
74
|
-
};
|
|
75
69
|
TVFXDataProvider?: {
|
|
76
70
|
[key in Fiat]?: TVFXDataProvider;
|
|
77
71
|
};
|
|
@@ -174,6 +174,13 @@ export declare enum Subjects {
|
|
|
174
174
|
STPWithdrawalFailed = "stpWithdrawal:failed",
|
|
175
175
|
STPWithdrawalCompleted = "stpWithdrawal:completed",
|
|
176
176
|
STPDepositCompleted = "stpDeposit:completed",
|
|
177
|
+
FintocWithdrawalInitiated = "fintocWithdrawal:initiated",
|
|
178
|
+
FintocWithdrawalFailed = "fintocWithdrawal:failed",
|
|
179
|
+
FintocWithdrawalCompleted = "fintocWithdrawal:completed",
|
|
180
|
+
FintocDepositCompleted = "fintocDeposit:completed",
|
|
181
|
+
FintocPaymentReceived = "fintocPayment:received",
|
|
182
|
+
FintocDepositCLABECreated = "fintocDepositCLABE:created",
|
|
183
|
+
InboundFintocBankDepositReceived = "inboundFintocBankDeposit:received",
|
|
177
184
|
LiquidityOrderCreated = "liquidityOrder:created",
|
|
178
185
|
OnboardingUpdated = "onboarding:updated",
|
|
179
186
|
OnboardingCreated = "onboarding:created",
|
package/build/events/subjects.js
CHANGED
|
@@ -178,6 +178,13 @@ var Subjects;
|
|
|
178
178
|
Subjects["STPWithdrawalFailed"] = "stpWithdrawal:failed";
|
|
179
179
|
Subjects["STPWithdrawalCompleted"] = "stpWithdrawal:completed";
|
|
180
180
|
Subjects["STPDepositCompleted"] = "stpDeposit:completed";
|
|
181
|
+
Subjects["FintocWithdrawalInitiated"] = "fintocWithdrawal:initiated";
|
|
182
|
+
Subjects["FintocWithdrawalFailed"] = "fintocWithdrawal:failed";
|
|
183
|
+
Subjects["FintocWithdrawalCompleted"] = "fintocWithdrawal:completed";
|
|
184
|
+
Subjects["FintocDepositCompleted"] = "fintocDeposit:completed";
|
|
185
|
+
Subjects["FintocPaymentReceived"] = "fintocPayment:received";
|
|
186
|
+
Subjects["FintocDepositCLABECreated"] = "fintocDepositCLABE:created";
|
|
187
|
+
Subjects["InboundFintocBankDepositReceived"] = "inboundFintocBankDeposit:received";
|
|
181
188
|
Subjects["LiquidityOrderCreated"] = "liquidityOrder:created";
|
|
182
189
|
Subjects["OnboardingUpdated"] = "onboarding:updated";
|
|
183
190
|
Subjects["OnboardingCreated"] = "onboarding:created";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Country } from "../types/country";
|
|
2
|
+
import { Fiat } from "../types/fiat";
|
|
3
|
+
import { Processor } from "../types/processor";
|
|
4
|
+
import { ProcessorRoutingPurpose } from "../types/processor-routing";
|
|
5
|
+
export declare const getDefaultProcessor: (country: Country, fiat: Fiat, purpose: ProcessorRoutingPurpose, excludedProcessors?: Processor[]) => Processor | undefined;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDefaultProcessor = void 0;
|
|
4
|
+
const country_1 = require("../types/country");
|
|
5
|
+
const fiat_1 = require("../types/fiat");
|
|
6
|
+
const processor_1 = require("../types/processor");
|
|
7
|
+
const processor_routing_1 = require("../types/processor-routing");
|
|
8
|
+
// The rail a corridor runs on when no split is configured for a purpose, in
|
|
9
|
+
// order of preference.
|
|
10
|
+
//
|
|
11
|
+
// These were literals inside getProcessor, which meant nothing else could name
|
|
12
|
+
// them: the routing editor could only say "its default processor" and leave an
|
|
13
|
+
// operator to go read the routing code, and the liquidity callers had to restate
|
|
14
|
+
// the same rail from memory and hope they still matched. Single-rail corridors are
|
|
15
|
+
// included too - COP, US dollars - where the default is simply the only option.
|
|
16
|
+
//
|
|
17
|
+
// More than one entry only where the first choice cannot be reached everywhere.
|
|
18
|
+
// The head of the list is the rail we mean to use; the rest exist so an
|
|
19
|
+
// environment that cannot talk to it still has somewhere to send an order.
|
|
20
|
+
const DEFAULT_PROCESSORS = {
|
|
21
|
+
[country_1.Country.Mexico]: {
|
|
22
|
+
[fiat_1.Fiat.MXN]: {
|
|
23
|
+
// STP cannot be reached from every environment, so buys and sells each
|
|
24
|
+
// name a second rail for the ones that cannot. Fondeadora (Processor.SPEI)
|
|
25
|
+
// can only stand in on buys: its payouts are keyed in by hand, so a sell
|
|
26
|
+
// defaulted there would sit in awaitingPayout with no service to dispatch
|
|
27
|
+
// it. Verifications need no stand-in - the only caller picks the rail
|
|
28
|
+
// itself when routing gives it nothing usable.
|
|
29
|
+
[processor_routing_1.ProcessorRoutingPurpose.Buy]: [processor_1.Processor.SPEI_STP, processor_1.Processor.SPEI],
|
|
30
|
+
[processor_routing_1.ProcessorRoutingPurpose.Sell]: [processor_1.Processor.SPEI_STP, processor_1.Processor.SPEI_NVIO],
|
|
31
|
+
[processor_routing_1.ProcessorRoutingPurpose.BankAccountVerification]: [processor_1.Processor.SPEI_STP],
|
|
32
|
+
},
|
|
33
|
+
[fiat_1.Fiat.USD]: {
|
|
34
|
+
[processor_routing_1.ProcessorRoutingPurpose.Buy]: [processor_1.Processor.SPID],
|
|
35
|
+
[processor_routing_1.ProcessorRoutingPurpose.Sell]: [processor_1.Processor.SPID],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
[country_1.Country.Peru]: {
|
|
39
|
+
[fiat_1.Fiat.PEN]: {
|
|
40
|
+
[processor_routing_1.ProcessorRoutingPurpose.Buy]: [processor_1.Processor.Interbank],
|
|
41
|
+
[processor_routing_1.ProcessorRoutingPurpose.Sell]: [processor_1.Processor.Interbank],
|
|
42
|
+
[processor_routing_1.ProcessorRoutingPurpose.BankAccountVerification]: [processor_1.Processor.Alfin],
|
|
43
|
+
},
|
|
44
|
+
[fiat_1.Fiat.USD]: {
|
|
45
|
+
[processor_routing_1.ProcessorRoutingPurpose.Buy]: [processor_1.Processor.Interbank],
|
|
46
|
+
[processor_routing_1.ProcessorRoutingPurpose.Sell]: [processor_1.Processor.Interbank],
|
|
47
|
+
[processor_routing_1.ProcessorRoutingPurpose.BankAccountVerification]: [processor_1.Processor.Alfin],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
[country_1.Country.Colombia]: {
|
|
51
|
+
[fiat_1.Fiat.COP]: {
|
|
52
|
+
[processor_routing_1.ProcessorRoutingPurpose.Buy]: [processor_1.Processor.Coltefinanciera],
|
|
53
|
+
[processor_routing_1.ProcessorRoutingPurpose.Sell]: [processor_1.Processor.Coltefinanciera],
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
[country_1.Country.UnitedStates]: {
|
|
57
|
+
[fiat_1.Fiat.USD]: {
|
|
58
|
+
[processor_routing_1.ProcessorRoutingPurpose.Buy]: [processor_1.Processor.Bridge],
|
|
59
|
+
[processor_routing_1.ProcessorRoutingPurpose.Sell]: [processor_1.Processor.Bridge],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
// Pass the environment's excluded rails to get the default that can actually be
|
|
64
|
+
// used there. Called without them it answers with the rail we mean to use, which
|
|
65
|
+
// is what the routing editor should name whatever environment it runs in.
|
|
66
|
+
const getDefaultProcessor = (country, fiat, purpose, excludedProcessors) => {
|
|
67
|
+
var _a, _b, _c;
|
|
68
|
+
return (_c = (_b = (_a = DEFAULT_PROCESSORS[country]) === null || _a === void 0 ? void 0 : _a[fiat]) === null || _b === void 0 ? void 0 : _b[purpose]) === null || _c === void 0 ? void 0 : _c.find((processor) => !(excludedProcessors === null || excludedProcessors === void 0 ? void 0 : excludedProcessors.includes(processor)));
|
|
69
|
+
};
|
|
70
|
+
exports.getDefaultProcessor = getDefaultProcessor;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Country } from "../types/country";
|
|
2
|
+
import { Fiat } from "../types/fiat";
|
|
3
|
+
import { Processor } from "../types/processor";
|
|
4
|
+
import { ProcessorRoutingPurpose } from "../types/processor-routing";
|
|
5
|
+
export declare const getProcessorsForCorridor: (country: Country, fiat: Fiat, purpose: ProcessorRoutingPurpose) => Processor[];
|
|
6
|
+
export declare const getCorridorsForPurpose: (purpose: ProcessorRoutingPurpose) => {
|
|
7
|
+
country: Country;
|
|
8
|
+
fiat: Fiat;
|
|
9
|
+
processors: Processor[];
|
|
10
|
+
}[];
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCorridorsForPurpose = exports.getProcessorsForCorridor = void 0;
|
|
4
|
+
const country_1 = require("../types/country");
|
|
5
|
+
const fiat_1 = require("../types/fiat");
|
|
6
|
+
const processor_1 = require("../types/processor");
|
|
7
|
+
const processor_routing_1 = require("../types/processor-routing");
|
|
8
|
+
// Every rail that can serve a country/fiat, by what it is serving. The single
|
|
9
|
+
// source of truth for three questions that used to be answered by three
|
|
10
|
+
// separate tables: which splits the rio-settings validator accepts, which
|
|
11
|
+
// corridors the routing editor offers, and which accounts a customer has to
|
|
12
|
+
// whitelist to fund a buy.
|
|
13
|
+
//
|
|
14
|
+
// A corridor with one rail for a purpose is structural rather than a commercial
|
|
15
|
+
// choice - COP is always Coltefinanciera, USD is Bridge in the US and SPID in
|
|
16
|
+
// Mexico - so a split against it is rejected instead of silently ignored. A
|
|
17
|
+
// corridor can also serve one purpose and not another: Mexican pesos reach three
|
|
18
|
+
// rails on a sell, four on a buy, and two for a verification.
|
|
19
|
+
const CORRIDOR_PROCESSORS = [
|
|
20
|
+
{
|
|
21
|
+
country: country_1.Country.Mexico,
|
|
22
|
+
fiat: fiat_1.Fiat.MXN,
|
|
23
|
+
processors: {
|
|
24
|
+
// Fondeadora (Processor.SPEI) withdrawals are keyed in by hand, so it can
|
|
25
|
+
// only take buys; giving it a sell share would route customers into a rail
|
|
26
|
+
// nothing dispatches.
|
|
27
|
+
[processor_routing_1.ProcessorRoutingPurpose.Buy]: [
|
|
28
|
+
processor_1.Processor.SPEI_STP,
|
|
29
|
+
processor_1.Processor.SPEI_FINTOC,
|
|
30
|
+
processor_1.Processor.SPEI_NVIO,
|
|
31
|
+
processor_1.Processor.SPEI,
|
|
32
|
+
],
|
|
33
|
+
[processor_routing_1.ProcessorRoutingPurpose.Sell]: [
|
|
34
|
+
processor_1.Processor.SPEI_STP,
|
|
35
|
+
processor_1.Processor.SPEI_FINTOC,
|
|
36
|
+
processor_1.Processor.SPEI_NVIO,
|
|
37
|
+
],
|
|
38
|
+
// NVIO is deliberately absent: nothing dispatches an NVIO micro-deposit,
|
|
39
|
+
// so giving it a share would silently fall through to the default rail.
|
|
40
|
+
[processor_routing_1.ProcessorRoutingPurpose.BankAccountVerification]: [
|
|
41
|
+
processor_1.Processor.SPEI_STP,
|
|
42
|
+
processor_1.Processor.SPEI_FINTOC,
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
country: country_1.Country.Mexico,
|
|
48
|
+
fiat: fiat_1.Fiat.USD,
|
|
49
|
+
processors: {
|
|
50
|
+
[processor_routing_1.ProcessorRoutingPurpose.Buy]: [processor_1.Processor.SPID],
|
|
51
|
+
[processor_routing_1.ProcessorRoutingPurpose.Sell]: [processor_1.Processor.SPID],
|
|
52
|
+
// No verification purpose: a micro-deposit only has an amount for MXN, so
|
|
53
|
+
// a Mexican USD account is never verified that way.
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
country: country_1.Country.Peru,
|
|
58
|
+
fiat: fiat_1.Fiat.PEN,
|
|
59
|
+
processors: {
|
|
60
|
+
[processor_routing_1.ProcessorRoutingPurpose.Buy]: [processor_1.Processor.Alfin, processor_1.Processor.Interbank],
|
|
61
|
+
[processor_routing_1.ProcessorRoutingPurpose.Sell]: [processor_1.Processor.Alfin, processor_1.Processor.Interbank],
|
|
62
|
+
// Alfin is the only programmatic Peru provider, so verifications there
|
|
63
|
+
// are structural.
|
|
64
|
+
[processor_routing_1.ProcessorRoutingPurpose.BankAccountVerification]: [processor_1.Processor.Alfin],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
country: country_1.Country.Peru,
|
|
69
|
+
fiat: fiat_1.Fiat.USD,
|
|
70
|
+
processors: {
|
|
71
|
+
[processor_routing_1.ProcessorRoutingPurpose.Buy]: [processor_1.Processor.Alfin, processor_1.Processor.Interbank],
|
|
72
|
+
[processor_routing_1.ProcessorRoutingPurpose.Sell]: [processor_1.Processor.Alfin, processor_1.Processor.Interbank],
|
|
73
|
+
[processor_routing_1.ProcessorRoutingPurpose.BankAccountVerification]: [processor_1.Processor.Alfin],
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
country: country_1.Country.Colombia,
|
|
78
|
+
fiat: fiat_1.Fiat.COP,
|
|
79
|
+
processors: {
|
|
80
|
+
[processor_routing_1.ProcessorRoutingPurpose.Buy]: [processor_1.Processor.Coltefinanciera],
|
|
81
|
+
[processor_routing_1.ProcessorRoutingPurpose.Sell]: [processor_1.Processor.Coltefinanciera],
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
country: country_1.Country.UnitedStates,
|
|
86
|
+
fiat: fiat_1.Fiat.USD,
|
|
87
|
+
processors: {
|
|
88
|
+
[processor_routing_1.ProcessorRoutingPurpose.Buy]: [processor_1.Processor.Bridge],
|
|
89
|
+
[processor_routing_1.ProcessorRoutingPurpose.Sell]: [processor_1.Processor.Bridge],
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
];
|
|
93
|
+
const getProcessorsForCorridor = (country, fiat, purpose) => {
|
|
94
|
+
var _a;
|
|
95
|
+
return ((_a = CORRIDOR_PROCESSORS.find((corridor) => corridor.country === country && corridor.fiat === fiat)) === null || _a === void 0 ? void 0 : _a.processors[purpose]) || [];
|
|
96
|
+
};
|
|
97
|
+
exports.getProcessorsForCorridor = getProcessorsForCorridor;
|
|
98
|
+
// Every corridor that serves the purpose at all, single-rail ones included. The
|
|
99
|
+
// routing editor shows those read-only: there is nothing to decide, but an
|
|
100
|
+
// operator should still be able to see where a corridor's money goes without
|
|
101
|
+
// reading the routing code to find out. Whether a corridor can be split is left
|
|
102
|
+
// to the caller, which is the length of the list it gets back.
|
|
103
|
+
const getCorridorsForPurpose = (purpose) => CORRIDOR_PROCESSORS.map((corridor) => ({
|
|
104
|
+
country: corridor.country,
|
|
105
|
+
fiat: corridor.fiat,
|
|
106
|
+
processors: corridor.processors[purpose] || [],
|
|
107
|
+
})).filter((corridor) => corridor.processors.length > 0);
|
|
108
|
+
exports.getCorridorsForPurpose = getCorridorsForPurpose;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Country } from "../types/country";
|
|
2
|
+
import { Fiat } from "../types/fiat";
|
|
3
|
+
import { Processor } from "../types/processor";
|
|
4
|
+
import { ProcessorRoutingConfig, ProcessorRoutingPurpose } from "../types/processor-routing";
|
|
5
|
+
export declare const getRoutingCandidates: ({ country, fiat, purpose, routingConfig, }: {
|
|
6
|
+
country: Country;
|
|
7
|
+
fiat: Fiat;
|
|
8
|
+
purpose: ProcessorRoutingPurpose;
|
|
9
|
+
routingConfig?: ProcessorRoutingConfig | undefined;
|
|
10
|
+
}) => Processor[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRoutingCandidates = void 0;
|
|
4
|
+
const get_default_processor_1 = require("./get-default-processor");
|
|
5
|
+
const get_processors_for_corridor_1 = require("./get-processors-for-corridor");
|
|
6
|
+
// The rails an order in this corridor could end up on: whatever the split gives
|
|
7
|
+
// a share to, or the corridor's default when nothing is configured.
|
|
8
|
+
//
|
|
9
|
+
// For callers that have to answer a question before the rail is drawn - how much
|
|
10
|
+
// liquidity is available, what a quote preview should show - since the draw
|
|
11
|
+
// happens per order, the honest answer covers every rail the order could get.
|
|
12
|
+
// Never used to pick a rail: that is `resolveProcessor`'s job, and it drops the
|
|
13
|
+
// rails the customer has switched off, which this deliberately ignores.
|
|
14
|
+
//
|
|
15
|
+
// One case it therefore misses: a customer who has switched off every rail the
|
|
16
|
+
// split gives a share to is routed to one of the rails they left on, since a zero
|
|
17
|
+
// share is not an off switch. Naming that rail here would take their enablement
|
|
18
|
+
// records, which these callers do not read, so a preview for such a customer can
|
|
19
|
+
// still name a rail they will not get.
|
|
20
|
+
const getRoutingCandidates = ({ country, fiat, purpose, routingConfig, }) => {
|
|
21
|
+
var _a, _b;
|
|
22
|
+
const rule = (_b = (_a = routingConfig === null || routingConfig === void 0 ? void 0 : routingConfig[country]) === null || _a === void 0 ? void 0 : _a[fiat]) === null || _b === void 0 ? void 0 : _b[purpose];
|
|
23
|
+
if (!rule) {
|
|
24
|
+
const fallback = (0, get_default_processor_1.getDefaultProcessor)(country, fiat, purpose);
|
|
25
|
+
return fallback ? [fallback] : [];
|
|
26
|
+
}
|
|
27
|
+
return (0, get_processors_for_corridor_1.getProcessorsForCorridor)(country, fiat, purpose).filter((processor) => (rule.percentages[processor] || 0) > 0);
|
|
28
|
+
};
|
|
29
|
+
exports.getRoutingCandidates = getRoutingCandidates;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isPayinVerifiable = exports.VERIFIABLE_PAYIN_PROCESSORS = void 0;
|
|
4
|
+
const processor_1 = require("../types/processor");
|
|
5
|
+
// Rails whose payins land in a shared Rio account and whose inbound activity we
|
|
6
|
+
// receive programmatically. Both halves matter: the shared account is what the
|
|
7
|
+
// customer has to whitelist with their own bank before they can fund an order,
|
|
8
|
+
// and the inbound feed is what lets a test deposit - or a real one - prove they
|
|
9
|
+
// have done it.
|
|
10
|
+
//
|
|
11
|
+
// Only these rails can offer a test deposit. Interbank and SPID (Bancrea) are
|
|
12
|
+
// deliberately absent: neither gives us an inbound feed, so a test sent to them
|
|
13
|
+
// could never be matched and the customer would be left waiting on a result that
|
|
14
|
+
// will not come.
|
|
15
|
+
//
|
|
16
|
+
// Says nothing about routing. Whether a rail takes a customer's buys is decided
|
|
17
|
+
// by whether they have it enabled, which applies to every rail - see
|
|
18
|
+
// resolveProcessor.
|
|
19
|
+
exports.VERIFIABLE_PAYIN_PROCESSORS = [
|
|
20
|
+
processor_1.Processor.SPEI_STP,
|
|
21
|
+
processor_1.Processor.SPEI_FINTOC,
|
|
22
|
+
processor_1.Processor.SPEI_NVIO,
|
|
23
|
+
processor_1.Processor.SPEI,
|
|
24
|
+
processor_1.Processor.Alfin,
|
|
25
|
+
];
|
|
26
|
+
const isPayinVerifiable = (processor) => exports.VERIFIABLE_PAYIN_PROCESSORS.includes(processor);
|
|
27
|
+
exports.isPayinVerifiable = isPayinVerifiable;
|
package/build/index.d.ts
CHANGED
|
@@ -179,6 +179,13 @@ export * from "./events/alfin-payment-received-event";
|
|
|
179
179
|
export * from "./events/alfin-withdrawal-completed-event";
|
|
180
180
|
export * from "./events/alfin-withdrawal-failed-event";
|
|
181
181
|
export * from "./events/STP-deposit-CLABE-created-event";
|
|
182
|
+
export * from "./events/fintoc-withdrawal-initiated-event";
|
|
183
|
+
export * from "./events/fintoc-withdrawal-failed-event";
|
|
184
|
+
export * from "./events/fintoc-withdrawal-completed-event";
|
|
185
|
+
export * from "./events/fintoc-deposit-completed-event";
|
|
186
|
+
export * from "./events/fintoc-payment-received-event";
|
|
187
|
+
export * from "./events/fintoc-deposit-CLABE-created-event";
|
|
188
|
+
export * from "./events/inbound-fintoc-bank-deposit-received-event";
|
|
182
189
|
export * from "./events/axe-created-event";
|
|
183
190
|
export * from "./events/axe-partially-taken-event";
|
|
184
191
|
export * from "./events/axe-taken-event";
|
|
@@ -284,6 +291,9 @@ export * from "./types/order-status";
|
|
|
284
291
|
export * from "./types/payment-method";
|
|
285
292
|
export * from "./types/payout-method";
|
|
286
293
|
export * from "./types/processor";
|
|
294
|
+
export * from "./types/processor-routing";
|
|
295
|
+
export * from "./types/processor-readiness";
|
|
296
|
+
export * from "./types/payment-address-verification";
|
|
287
297
|
export * from "./types/side";
|
|
288
298
|
export * from "./types/auth";
|
|
289
299
|
export * from "./types/auth-update";
|
|
@@ -436,6 +446,9 @@ export * from "./types/admin-auth-dashboard-settings";
|
|
|
436
446
|
export * from "./types/STP-mxn-withdrawal";
|
|
437
447
|
export * from "./types/STP-deposit-CLABE";
|
|
438
448
|
export * from "./types/STP-settings";
|
|
449
|
+
export * from "./types/fintoc-mxn-withdrawal";
|
|
450
|
+
export * from "./types/fintoc-mxn-withdrawal-status";
|
|
451
|
+
export * from "./types/fintoc-deposit-CLABE";
|
|
439
452
|
export * from "./types/axe";
|
|
440
453
|
export * from "./types/axe-status";
|
|
441
454
|
export * from "./types/TV-FX-data-provider";
|
|
@@ -564,6 +577,10 @@ export * from "./helpers/get-country-timezone";
|
|
|
564
577
|
export * from "./helpers/get-active-platform-fee-ranges";
|
|
565
578
|
export * from "./helpers/find-platform-fee-range-conflict";
|
|
566
579
|
export * from "./helpers/get-country-for-fiat";
|
|
580
|
+
export * from "./helpers/get-processors-for-corridor";
|
|
581
|
+
export * from "./helpers/get-default-processor";
|
|
582
|
+
export * from "./helpers/get-routing-candidates";
|
|
583
|
+
export * from "./helpers/verifiable-payin-processors";
|
|
567
584
|
export * from "./helpers/get-days-between-agreed-two-way-settlement-date-and-payment-date";
|
|
568
585
|
export * from "./helpers/get-days-until-two-way-settlement-date";
|
|
569
586
|
export * from "./helpers/get-two-way-settlement-date-offset-from-date";
|
package/build/index.js
CHANGED
|
@@ -195,6 +195,13 @@ __exportStar(require("./events/alfin-payment-received-event"), exports);
|
|
|
195
195
|
__exportStar(require("./events/alfin-withdrawal-completed-event"), exports);
|
|
196
196
|
__exportStar(require("./events/alfin-withdrawal-failed-event"), exports);
|
|
197
197
|
__exportStar(require("./events/STP-deposit-CLABE-created-event"), exports);
|
|
198
|
+
__exportStar(require("./events/fintoc-withdrawal-initiated-event"), exports);
|
|
199
|
+
__exportStar(require("./events/fintoc-withdrawal-failed-event"), exports);
|
|
200
|
+
__exportStar(require("./events/fintoc-withdrawal-completed-event"), exports);
|
|
201
|
+
__exportStar(require("./events/fintoc-deposit-completed-event"), exports);
|
|
202
|
+
__exportStar(require("./events/fintoc-payment-received-event"), exports);
|
|
203
|
+
__exportStar(require("./events/fintoc-deposit-CLABE-created-event"), exports);
|
|
204
|
+
__exportStar(require("./events/inbound-fintoc-bank-deposit-received-event"), exports);
|
|
198
205
|
__exportStar(require("./events/axe-created-event"), exports);
|
|
199
206
|
__exportStar(require("./events/axe-partially-taken-event"), exports);
|
|
200
207
|
__exportStar(require("./events/axe-taken-event"), exports);
|
|
@@ -300,6 +307,9 @@ __exportStar(require("./types/order-status"), exports);
|
|
|
300
307
|
__exportStar(require("./types/payment-method"), exports);
|
|
301
308
|
__exportStar(require("./types/payout-method"), exports);
|
|
302
309
|
__exportStar(require("./types/processor"), exports);
|
|
310
|
+
__exportStar(require("./types/processor-routing"), exports);
|
|
311
|
+
__exportStar(require("./types/processor-readiness"), exports);
|
|
312
|
+
__exportStar(require("./types/payment-address-verification"), exports);
|
|
303
313
|
__exportStar(require("./types/side"), exports);
|
|
304
314
|
__exportStar(require("./types/auth"), exports);
|
|
305
315
|
__exportStar(require("./types/auth-update"), exports);
|
|
@@ -452,6 +462,9 @@ __exportStar(require("./types/admin-auth-dashboard-settings"), exports);
|
|
|
452
462
|
__exportStar(require("./types/STP-mxn-withdrawal"), exports);
|
|
453
463
|
__exportStar(require("./types/STP-deposit-CLABE"), exports);
|
|
454
464
|
__exportStar(require("./types/STP-settings"), exports);
|
|
465
|
+
__exportStar(require("./types/fintoc-mxn-withdrawal"), exports);
|
|
466
|
+
__exportStar(require("./types/fintoc-mxn-withdrawal-status"), exports);
|
|
467
|
+
__exportStar(require("./types/fintoc-deposit-CLABE"), exports);
|
|
455
468
|
__exportStar(require("./types/axe"), exports);
|
|
456
469
|
__exportStar(require("./types/axe-status"), exports);
|
|
457
470
|
__exportStar(require("./types/TV-FX-data-provider"), exports);
|
|
@@ -580,6 +593,10 @@ __exportStar(require("./helpers/get-country-timezone"), exports);
|
|
|
580
593
|
__exportStar(require("./helpers/get-active-platform-fee-ranges"), exports);
|
|
581
594
|
__exportStar(require("./helpers/find-platform-fee-range-conflict"), exports);
|
|
582
595
|
__exportStar(require("./helpers/get-country-for-fiat"), exports);
|
|
596
|
+
__exportStar(require("./helpers/get-processors-for-corridor"), exports);
|
|
597
|
+
__exportStar(require("./helpers/get-default-processor"), exports);
|
|
598
|
+
__exportStar(require("./helpers/get-routing-candidates"), exports);
|
|
599
|
+
__exportStar(require("./helpers/verifiable-payin-processors"), exports);
|
|
583
600
|
__exportStar(require("./helpers/get-days-between-agreed-two-way-settlement-date-and-payment-date"), exports);
|
|
584
601
|
__exportStar(require("./helpers/get-days-until-two-way-settlement-date"), exports);
|
|
585
602
|
__exportStar(require("./helpers/get-two-way-settlement-date-offset-from-date"), exports);
|
|
@@ -7,7 +7,7 @@ export interface BankAccountVerification {
|
|
|
7
7
|
bankAccountId: string;
|
|
8
8
|
status: BankAccountVerificationStatus;
|
|
9
9
|
amount: number;
|
|
10
|
-
provider?: Processor.SPEI_STP | Processor.SPEI_NVIO;
|
|
10
|
+
provider?: Processor.SPEI_STP | Processor.SPEI_NVIO | Processor.SPEI_FINTOC;
|
|
11
11
|
providerWithdrawalId?: string;
|
|
12
12
|
SPEITrackingNumber?: string;
|
|
13
13
|
CEPLink?: string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface FintocDepositCLABE {
|
|
2
|
+
id: string;
|
|
3
|
+
createdAt: Date;
|
|
4
|
+
userId: string;
|
|
5
|
+
CLABE: string;
|
|
6
|
+
fintocAccountNumberId?: string;
|
|
7
|
+
processedFintocEventIds?: string[];
|
|
8
|
+
orderId?: string;
|
|
9
|
+
metadata?: Record<string, string>;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
disabledAt?: Date;
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FintocMXNWithdrawalStatus = void 0;
|
|
4
|
+
var FintocMXNWithdrawalStatus;
|
|
5
|
+
(function (FintocMXNWithdrawalStatus) {
|
|
6
|
+
FintocMXNWithdrawalStatus["PendingApproval"] = "pendingApproval";
|
|
7
|
+
FintocMXNWithdrawalStatus["Processing"] = "processing";
|
|
8
|
+
FintocMXNWithdrawalStatus["Complete"] = "complete";
|
|
9
|
+
FintocMXNWithdrawalStatus["Failed"] = "failed";
|
|
10
|
+
FintocMXNWithdrawalStatus["Cancelled"] = "cancelled";
|
|
11
|
+
})(FintocMXNWithdrawalStatus = exports.FintocMXNWithdrawalStatus || (exports.FintocMXNWithdrawalStatus = {}));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FintocMXNWithdrawalStatus } from "./fintoc-mxn-withdrawal-status";
|
|
2
|
+
export interface FintocMXNWithdrawal {
|
|
3
|
+
createdAt: Date;
|
|
4
|
+
type: "transaction" | "bankAccountVerification" | "liquidityOrder" | "internalTransfer";
|
|
5
|
+
orderId?: string;
|
|
6
|
+
internalTransferId?: string;
|
|
7
|
+
bankAccountVerificationId?: string;
|
|
8
|
+
orderVersion?: number;
|
|
9
|
+
bulkBankPayoutId?: string;
|
|
10
|
+
FintocWithdrawals: {
|
|
11
|
+
uuid: string;
|
|
12
|
+
fintocTransferId?: string;
|
|
13
|
+
trackingKey?: string;
|
|
14
|
+
idempotencyKey?: string;
|
|
15
|
+
partNumber: number;
|
|
16
|
+
amount: number;
|
|
17
|
+
reference: string;
|
|
18
|
+
status: FintocMXNWithdrawalStatus;
|
|
19
|
+
}[];
|
|
20
|
+
numberOfParts?: number;
|
|
21
|
+
partsCompleted?: number;
|
|
22
|
+
}
|
|
@@ -43,6 +43,10 @@ const CATEGORY_TOKENS = [
|
|
|
43
43
|
"completed",
|
|
44
44
|
"success",
|
|
45
45
|
"successful",
|
|
46
|
+
// Fintoc reports terminal success as "succeeded", which shares no
|
|
47
|
+
// substring with "success" and would otherwise fall through to Other.
|
|
48
|
+
"succeeded",
|
|
49
|
+
"succeed",
|
|
46
50
|
"settled",
|
|
47
51
|
"confirmed",
|
|
48
52
|
"credited",
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Crypto } from "./crypto";
|
|
2
|
+
import { ProcessorReadinessStatus, ProcessorReadinessVerificationMethod } from "./processor-readiness";
|
|
3
|
+
export interface PaymentAddressVerification {
|
|
4
|
+
id: string;
|
|
5
|
+
createdAt: Date;
|
|
6
|
+
userId: string;
|
|
7
|
+
crypto: Crypto;
|
|
8
|
+
fireblocksVaultId: string;
|
|
9
|
+
address: string;
|
|
10
|
+
memo?: string;
|
|
11
|
+
status: ProcessorReadinessStatus;
|
|
12
|
+
testAmount?: number;
|
|
13
|
+
observedTransfer?: {
|
|
14
|
+
amount: number;
|
|
15
|
+
blockchainTxId?: string;
|
|
16
|
+
fireblocksTransferId?: string;
|
|
17
|
+
originBlockchainAddress?: string;
|
|
18
|
+
receivedAt: Date;
|
|
19
|
+
};
|
|
20
|
+
verifiedAt?: Date;
|
|
21
|
+
verifiedVia?: ProcessorReadinessVerificationMethod;
|
|
22
|
+
verifiedByAdminId?: string;
|
|
23
|
+
verificationNote?: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Country } from "./country";
|
|
2
|
+
import { Fiat } from "./fiat";
|
|
3
|
+
import { Processor } from "./processor";
|
|
4
|
+
import { Side } from "./side";
|
|
5
|
+
export declare enum ProcessorReadinessStatus {
|
|
6
|
+
Provisioned = "provisioned",
|
|
7
|
+
AwaitingTestDeposit = "awaitingTestDeposit",
|
|
8
|
+
Verified = "verified",
|
|
9
|
+
Failed = "failed"
|
|
10
|
+
}
|
|
11
|
+
export declare enum ProcessorReadinessVerificationMethod {
|
|
12
|
+
TestDeposit = "testDeposit",
|
|
13
|
+
ObservedDeposit = "observedDeposit",
|
|
14
|
+
AdminOverride = "adminOverride"
|
|
15
|
+
}
|
|
16
|
+
export interface ProcessorReadiness {
|
|
17
|
+
id: string;
|
|
18
|
+
createdAt: Date;
|
|
19
|
+
userId: string;
|
|
20
|
+
country: Country;
|
|
21
|
+
fiat: Fiat;
|
|
22
|
+
processor: Processor;
|
|
23
|
+
enablement?: {
|
|
24
|
+
[side in Side]?: {
|
|
25
|
+
isEnabled: boolean;
|
|
26
|
+
updatedAt: Date;
|
|
27
|
+
updatedByAdminId?: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
status: ProcessorReadinessStatus;
|
|
31
|
+
CLABE?: string;
|
|
32
|
+
testReference?: string;
|
|
33
|
+
testAmount?: number;
|
|
34
|
+
verifiedAt?: Date;
|
|
35
|
+
verifiedVia?: ProcessorReadinessVerificationMethod;
|
|
36
|
+
verifiedByAdminId?: string;
|
|
37
|
+
verificationNote?: string;
|
|
38
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProcessorReadinessVerificationMethod = exports.ProcessorReadinessStatus = void 0;
|
|
4
|
+
var ProcessorReadinessStatus;
|
|
5
|
+
(function (ProcessorReadinessStatus) {
|
|
6
|
+
// A payin destination exists for the user on this rail, but we have not seen
|
|
7
|
+
// money arrive through it yet, so we cannot assume their whitelist allows it.
|
|
8
|
+
ProcessorReadinessStatus["Provisioned"] = "provisioned";
|
|
9
|
+
// The user has been given a test amount and reference and we are waiting for
|
|
10
|
+
// the deposit to land.
|
|
11
|
+
ProcessorReadinessStatus["AwaitingTestDeposit"] = "awaitingTestDeposit";
|
|
12
|
+
ProcessorReadinessStatus["Verified"] = "verified";
|
|
13
|
+
ProcessorReadinessStatus["Failed"] = "failed";
|
|
14
|
+
})(ProcessorReadinessStatus = exports.ProcessorReadinessStatus || (exports.ProcessorReadinessStatus = {}));
|
|
15
|
+
var ProcessorReadinessVerificationMethod;
|
|
16
|
+
(function (ProcessorReadinessVerificationMethod) {
|
|
17
|
+
// A deliberate test deposit that the user was asked to send.
|
|
18
|
+
ProcessorReadinessVerificationMethod["TestDeposit"] = "testDeposit";
|
|
19
|
+
// A real order payin that arrived on this rail. Proves the same thing a test
|
|
20
|
+
// deposit does, so it verifies the rail without asking the customer for
|
|
21
|
+
// anything.
|
|
22
|
+
ProcessorReadinessVerificationMethod["ObservedDeposit"] = "observedDeposit";
|
|
23
|
+
// An admin asserted the user can pay this rail. Recorded with who and why,
|
|
24
|
+
// because a wrong assertion strands their orders on an undeliverable CLABE.
|
|
25
|
+
ProcessorReadinessVerificationMethod["AdminOverride"] = "adminOverride";
|
|
26
|
+
})(ProcessorReadinessVerificationMethod = exports.ProcessorReadinessVerificationMethod || (exports.ProcessorReadinessVerificationMethod = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Country } from "./country";
|
|
2
|
+
import { Fiat } from "./fiat";
|
|
3
|
+
import { Processor } from "./processor";
|
|
4
|
+
export declare enum ProcessorRoutingPurpose {
|
|
5
|
+
Buy = "buy",
|
|
6
|
+
Sell = "sell",
|
|
7
|
+
BankAccountVerification = "bankAccountVerification"
|
|
8
|
+
}
|
|
9
|
+
export interface ProcessorRoutingRule {
|
|
10
|
+
percentages: {
|
|
11
|
+
[key in Processor]?: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export type ProcessorRoutingConfig = {
|
|
15
|
+
[country in Country]?: {
|
|
16
|
+
[fiat in Fiat]?: {
|
|
17
|
+
[purpose in ProcessorRoutingPurpose]?: ProcessorRoutingRule;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProcessorRoutingPurpose = void 0;
|
|
4
|
+
// What a rule routes. Buy and Sell deliberately carry the same values as the
|
|
5
|
+
// Side enum, so a config written when rules were keyed by side needs no
|
|
6
|
+
// migration. Bank account verifications route through the same machinery rather
|
|
7
|
+
// than their own settings list: the micro-deposit is just another outbound
|
|
8
|
+
// payment whose rail we want to control centrally.
|
|
9
|
+
var ProcessorRoutingPurpose;
|
|
10
|
+
(function (ProcessorRoutingPurpose) {
|
|
11
|
+
ProcessorRoutingPurpose["Buy"] = "buy";
|
|
12
|
+
ProcessorRoutingPurpose["Sell"] = "sell";
|
|
13
|
+
ProcessorRoutingPurpose["BankAccountVerification"] = "bankAccountVerification";
|
|
14
|
+
})(ProcessorRoutingPurpose = exports.ProcessorRoutingPurpose || (exports.ProcessorRoutingPurpose = {}));
|
package/build/types/processor.js
CHANGED
|
@@ -11,6 +11,7 @@ var Processor;
|
|
|
11
11
|
Processor["Bridge"] = "bridge";
|
|
12
12
|
Processor["SPEI_STP"] = "spei-stp";
|
|
13
13
|
Processor["SPEI_NVIO"] = "spei-nvio";
|
|
14
|
+
Processor["SPEI_FINTOC"] = "spei-fintoc";
|
|
14
15
|
Processor["BinanceRFQ"] = "binance-rfq";
|
|
15
16
|
Processor["Coltefinanciera"] = "coltefinanciera";
|
|
16
17
|
Processor["Alfin"] = "alfin";
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Country } from "./country";
|
|
2
2
|
import { Fiat } from "./fiat";
|
|
3
|
+
import { Processor } from "./processor";
|
|
3
4
|
export interface RioBankAccount {
|
|
4
5
|
id: string;
|
|
5
6
|
country: Country;
|
|
6
7
|
fiat: Fiat;
|
|
8
|
+
processor?: Processor;
|
|
7
9
|
bankName?: string;
|
|
8
10
|
companyName?: string;
|
|
9
11
|
companyAddress?: string;
|
|
@@ -2,7 +2,6 @@ import { Country } from "./country";
|
|
|
2
2
|
import { Fiat } from "./fiat";
|
|
3
3
|
import { FXProvider } from "./fx-provider";
|
|
4
4
|
import { FXTradingPolicies } from "./fx-trading-policy";
|
|
5
|
-
import { Processor } from "./processor";
|
|
6
5
|
import { Side } from "./side";
|
|
7
6
|
import { TVFXDataProvider } from "./TV-FX-data-provider";
|
|
8
7
|
export interface RioSettingsUpdate {
|
|
@@ -54,11 +53,6 @@ export interface RioSettingsUpdate {
|
|
|
54
53
|
[key in Side]?: number;
|
|
55
54
|
};
|
|
56
55
|
};
|
|
57
|
-
activeFiatPaymentProcessors?: {
|
|
58
|
-
[Side.Buy]: Processor[];
|
|
59
|
-
[Side.Sell]: Processor[];
|
|
60
|
-
bankAccountVerifications: Processor[];
|
|
61
|
-
};
|
|
62
56
|
TVFXDataProvider?: {
|
|
63
57
|
[key in Fiat]: TVFXDataProvider;
|
|
64
58
|
};
|
|
@@ -4,7 +4,7 @@ import { DeferredPaymentType } from "./deferred-payment-type";
|
|
|
4
4
|
import { Fiat } from "./fiat";
|
|
5
5
|
import { FXProvider } from "./fx-provider";
|
|
6
6
|
import { FXTradingPolicies } from "./fx-trading-policy";
|
|
7
|
-
import {
|
|
7
|
+
import { ProcessorRoutingConfig } from "./processor-routing";
|
|
8
8
|
import { Side } from "./side";
|
|
9
9
|
import { TVFXDataProvider } from "./TV-FX-data-provider";
|
|
10
10
|
export interface RioSettings {
|
|
@@ -68,11 +68,7 @@ export interface RioSettings {
|
|
|
68
68
|
[key in Side]?: number;
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
|
-
|
|
72
|
-
[Side.Buy]: Processor[];
|
|
73
|
-
[Side.Sell]: Processor[];
|
|
74
|
-
bankAccountVerifications: Processor[];
|
|
75
|
-
};
|
|
71
|
+
processorRouting?: ProcessorRoutingConfig;
|
|
76
72
|
TVFXDataProvider: {
|
|
77
73
|
[key in Fiat]?: TVFXDataProvider;
|
|
78
74
|
};
|
|
@@ -5,6 +5,7 @@ var TreasuryProvider;
|
|
|
5
5
|
(function (TreasuryProvider) {
|
|
6
6
|
TreasuryProvider["Bitso"] = "bitso";
|
|
7
7
|
TreasuryProvider["STP"] = "STP";
|
|
8
|
+
TreasuryProvider["Fintoc"] = "fintoc";
|
|
8
9
|
TreasuryProvider["Coinbase"] = "coinbase";
|
|
9
10
|
TreasuryProvider["Binance"] = "binance";
|
|
10
11
|
TreasuryProvider["Kraken"] = "kraken";
|
|
@@ -19,8 +19,6 @@ export declare enum UserAttribute {
|
|
|
19
19
|
DisburseEveningSellOrdersWithoutCosigner = "disburseEveningSellOrdersWithoutCosigner",
|
|
20
20
|
UseFireblocksOvernightAndWeekendVault = "useFireblocksOvernightAndWeekendVault",
|
|
21
21
|
SkipPeriodicWalletComplianceCheck = "skipPeriodicWalletComplianceCheck",
|
|
22
|
-
UseSTPForMXNWithdrawals = "useSTPForMXNWithdrawals",
|
|
23
|
-
UseSTPForMXNDeposits = "useSTPForMXNDeposits",
|
|
24
22
|
CanSpecifyQuotationTime = "canSpecifyQuotationTime",
|
|
25
23
|
SendBuyOrderMXNAxes = "sendBuyOrderMXNAxes",
|
|
26
24
|
SendSellOrderMXNAxes = "sendSellOrderMXNAxes",
|
|
@@ -43,9 +41,5 @@ export declare enum UserAttribute {
|
|
|
43
41
|
SellOrderMaintenanceModeActive = "sellOrderMaintenanceModeActive",
|
|
44
42
|
CanPlaceLongDatedForwards = "canPlaceLongDatedForwards",
|
|
45
43
|
CanViewBalances = "canViewBalances",
|
|
46
|
-
UseAlfinForPENDeposits = "useAlfinForPENDeposits",
|
|
47
|
-
UseAlfinForPENWithdrawals = "useAlfinForPENWithdrawals",
|
|
48
|
-
UseAlfinForUSDDeposits = "useAlfinForUSDDeposits",
|
|
49
|
-
UseAlfinForUSDWithdrawals = "useAlfinForUSDWithdrawals",
|
|
50
44
|
AllowOnboardingsViaAPI = "allowOnboardingsViaAPI"
|
|
51
45
|
}
|
|
@@ -23,8 +23,6 @@ var UserAttribute;
|
|
|
23
23
|
UserAttribute["DisburseEveningSellOrdersWithoutCosigner"] = "disburseEveningSellOrdersWithoutCosigner";
|
|
24
24
|
UserAttribute["UseFireblocksOvernightAndWeekendVault"] = "useFireblocksOvernightAndWeekendVault";
|
|
25
25
|
UserAttribute["SkipPeriodicWalletComplianceCheck"] = "skipPeriodicWalletComplianceCheck";
|
|
26
|
-
UserAttribute["UseSTPForMXNWithdrawals"] = "useSTPForMXNWithdrawals";
|
|
27
|
-
UserAttribute["UseSTPForMXNDeposits"] = "useSTPForMXNDeposits";
|
|
28
26
|
UserAttribute["CanSpecifyQuotationTime"] = "canSpecifyQuotationTime";
|
|
29
27
|
UserAttribute["SendBuyOrderMXNAxes"] = "sendBuyOrderMXNAxes";
|
|
30
28
|
UserAttribute["SendSellOrderMXNAxes"] = "sendSellOrderMXNAxes";
|
|
@@ -47,10 +45,6 @@ var UserAttribute;
|
|
|
47
45
|
UserAttribute["SellOrderMaintenanceModeActive"] = "sellOrderMaintenanceModeActive";
|
|
48
46
|
UserAttribute["CanPlaceLongDatedForwards"] = "canPlaceLongDatedForwards";
|
|
49
47
|
UserAttribute["CanViewBalances"] = "canViewBalances";
|
|
50
|
-
UserAttribute["UseAlfinForPENDeposits"] = "useAlfinForPENDeposits";
|
|
51
|
-
UserAttribute["UseAlfinForPENWithdrawals"] = "useAlfinForPENWithdrawals";
|
|
52
|
-
UserAttribute["UseAlfinForUSDDeposits"] = "useAlfinForUSDDeposits";
|
|
53
|
-
UserAttribute["UseAlfinForUSDWithdrawals"] = "useAlfinForUSDWithdrawals";
|
|
54
48
|
// Lets a broker onboard its own sub-accounts over the API: uploading
|
|
55
49
|
// documents and submitting additional information for users whose brokerId
|
|
56
50
|
// is the caller. Almost every onboarding now goes through the register page
|