Skip to content

Commit 0d9bcc0

Browse files
authored
🤖 Merge PR DefinitelyTyped#74028 [invity-api] add terms url to provider info by @hehe100596
1 parent 63fb66a commit 0d9bcc0

File tree

2 files changed

+48
-42
lines changed

2 files changed

+48
-42
lines changed

types/invity-api/index.d.ts

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,31 @@ export type FiatCurrencyCode =
6969

7070
export type FiatCurrenciesProps = Record<FiatCurrencyCode, number>;
7171

72+
export interface ClientVersion {
73+
client: string;
74+
version: string;
75+
}
76+
77+
export interface ProviderMetadata {
78+
name: string; // unique internal name, e.g. "changenow"
79+
companyName: string; // name visible to clients, e.g. "ChangeNow"
80+
logo: string; // logo image filename, e.g. "changenow-icon.jpg"
81+
isActive: boolean;
82+
isDisabled?: boolean;
83+
disabledCurrencies?: string[]; // ['BTC', 'USD']
84+
supportedCountries?: string[]; // ['CZ', 'NL']
85+
disabledCountries?: string[];
86+
supportUrl?: string; // https://www.simplex.com/support/
87+
statusUrl?: string; // https://payment-status.simplex.com/api/v1/user/payments?uuid={{paymentId}}
88+
termsUrl?: string; // https://www.simplex.com/terms-of-use/payment-terms
89+
disabledClientVersions?: ClientVersion[];
90+
}
91+
92+
export interface BuySellProviderMetadata extends ProviderMetadata {
93+
supportedCountries: string[]; // ['AT', 'BE']
94+
tradedCoins: CryptoId[]; // ['BTC', 'BCH', 'LTC', 'XRP', 'ETH', 'bitcoin', 'ethereum', 'litecoin', 'ethereum--0xdac17f958d2ee523a2206206994597c13d831ec7']
95+
}
96+
7297
// buy types
7398

7499
export type BuyTradeFinalStatus =
@@ -119,22 +144,12 @@ export type BuyTradeTag =
119144
| "widget"
120145
| "noExternalAddress";
121146

122-
export interface BuyProviderInfo {
123-
name: string; // simplex
124-
companyName: string; // UAB Invity Finance
125-
brandName?: string; // Invity
126-
logo: string; // simplex-icon.jpg
127-
isActive: boolean;
128-
isDisabled?: boolean;
129-
tradedCoins: CryptoId[]; // ['bitcoin', 'ethereum', 'litecoin', 'ethereum--0xdac17f958d2ee523a2206206994597c13d831ec7']
147+
export interface BuyProviderInfo extends BuySellProviderMetadata {
130148
tradedFiatCurrencies: string[]; // ['EUR', 'USD']
131-
disabledCurrencies?: string[];
132-
supportedCountries: string[]; // ['CZ', 'NL']
133-
disabledCountries?: string[];
134149
paymentMethods: BuyCryptoPaymentMethod[];
135-
statusUrl?: string; // https://payment-status.simplex.com/api/v1/user/payments?uuid={{paymentId}}
136-
supportUrl?: string; // https://www.simplex.com/support/
137-
pendingTimeoutSeconds?: number; // Time until a SUBMITTED transaction automatically changes to APPROVAL_PENDING. Null means it does not change.
150+
disabledPaymentMethods?: BuyCryptoPaymentMethod[];
151+
brandName?: string; // Invity
152+
pendingTimeoutSeconds?: number; // time until a SUBMITTED transaction automatically changes to APPROVAL_PENDING, null means it does not change
138153
}
139154

140155
export interface BuyListResponse {
@@ -250,23 +265,18 @@ export type ExchangeMaximum =
250265
export type ExchangeTradeTag = "renewed" | "bestRate" | "favorite" | "kyc" | "widget" | "noExternalAddress";
251266
export type ExchangeKYCType = "KYC-required" | "KYC-norefund" | "KYC-yesrefund" | "noKYC" | "DEX";
252267

253-
export interface ExchangeProviderInfo {
254-
name: string; // changenow
255-
companyName: string; // ChangeNow
256-
logo: string; // changenow-icon.jpg
257-
isActive: boolean;
268+
export interface ExchangeProviderInfo extends ProviderMetadata {
258269
isFixedRate: boolean;
259270
isDex: boolean;
260271
buyTickers: CryptoId[];
261272
sellTickers: CryptoId[];
262-
addressFormats: StringMap; // specification of formats required by selected exchange
263-
statusUrl: string; // https://changenow.io/exchange/txs/{{orderId}}
273+
addressFormats: StringMap;
264274
kycUrl?: string; // https://changenow.io/faq#kyc
265275
supportUrl: string; // https://support.changenow.io
266276
// TODO region of operation
267-
kycPolicy?: string | undefined;
277+
kycPolicy?: string;
268278
kycPolicyType: ExchangeKYCType;
269-
isRefundRequired?: boolean | undefined;
279+
isRefundRequired?: boolean;
270280
}
271281

272282
export type ExchangeListResponse = ExchangeProviderInfo[];
@@ -463,25 +473,16 @@ export type SellProviderType = "Fiat" | "Voucher";
463473

464474
export type SellFiatFlowType = "BANK_ACCOUNT" | "PAYMENT_GATE" | "N/A";
465475

466-
export interface SellProviderInfo {
467-
name: string; // simplex
468-
companyName: string; // Simplex
469-
logo: string; // simplex-icon.jpg
476+
export interface SellProviderInfo extends BuySellProviderMetadata {
470477
type: SellProviderType;
471-
isActive: boolean;
472-
tradedCoins: CryptoId[]; // ['bitcoin', 'bitcoin-cash', 'litecoin']
473-
tradedFiatCurrencies?: string[] | undefined; // ['EUR', 'USD']
474-
supportedCountries: string[]; // ['AT', 'BE']
475-
statusUrl?: string | undefined; // https://payment-status.simplex.com/api/v1/user/payments?uuid={{paymentId}}
476-
supportUrl?: string | undefined; // https://www.simplex.com/support/
477-
quoteInfo?: string | undefined; // some info text shown on quote
478-
voucherSiteOrigin?: string | undefined;
479-
paymentMethods?: SellCryptoPaymentMethod[] | undefined;
480-
flow?: SellFiatFlowType | undefined;
481-
isRefundAddressRequired?: boolean | undefined;
482-
pendingTimeout?: number | undefined; // Time until a SUBMITTED transaction automatically changes to PENDING. Null means it does not change.
483-
/** Should be used when it's necessary to have the exact amount match between the trade and the transaction */
484-
lockSendAmount?: boolean;
478+
tradedFiatCurrencies?: string[]; // ['EUR', 'USD']
479+
quoteInfo?: string; // some info text shown on quote
480+
paymentMethods?: SellCryptoPaymentMethod[];
481+
disabledPaymentMethods?: SellCryptoPaymentMethod[];
482+
flow?: SellFiatFlowType;
483+
isRefundAddressRequired?: boolean;
484+
pendingTimeout?: number; // time until a SUBMITTED transaction automatically changes to PENDING, null means it does not change
485+
lockSendAmount?: boolean; // should be used when it's necessary to have the exact amount match between the trade and the transaction */
485486
}
486487

487488
export interface SellListResponse {

types/invity-api/invity-api-tests.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ const providerInfo: BuyProviderInfo = {
6767
tradedFiatCurrencies: [],
6868
supportedCountries: [],
6969
paymentMethods: [],
70+
statusUrl: 'https://test-finance.invity.io/#status/{{paymentId}}',
71+
supportUrl: '',
72+
termsUrl: 'https://invity.io/terms-of-use-invity-finance',
7073
};
7174

7275
const infoResponse: InfoResponse = {
@@ -105,7 +108,8 @@ const exchangeProviderInfo: ExchangeProviderInfo = {
105108
},
106109
statusUrl: "https://example.com/txs/{{orderId}}",
107110
kycUrl: "https://example.com/faq#kyc",
108-
supportUrl: " https://support.example.com",
111+
supportUrl: "https://support.example.com",
112+
termsUrl: "https://example.com/legal/terms-of-use",
109113
kycPolicy: "KYC is required...",
110114
kycPolicyType: "KYC-norefund",
111115
isRefundRequired: false,
@@ -122,6 +126,7 @@ const sellProviderInfo: SellProviderInfo = {
122126
supportedCountries: ["US"],
123127
statusUrl: "https://example.com/txs/{{orderId}}",
124128
supportUrl: " https://support.example.com",
129+
termsUrl: "https://example.com/legal/terms-of-use",
125130
flow: "PAYMENT_GATE",
126131
isRefundAddressRequired: false,
127132
lockSendAmount: false,

0 commit comments

Comments
 (0)