Skip to content

Commit ebca5bf

Browse files
authored
🤖 Merge PR DefinitelyTyped#74330 [invity-api] add subdivisions by @hehe100596
1 parent 82a1cbf commit ebca5bf

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

types/invity-api/index.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ export interface ClientVersion {
7474
version: string;
7575
}
7676

77+
export interface Subdivisions {
78+
[country: string]: string[];
79+
}
80+
7781
export interface ProviderMetadata {
7882
name: string; // unique internal name, e.g. "changenow"
7983
companyName: string; // name visible to clients, e.g. "ChangeNow"
@@ -91,7 +95,9 @@ export interface ProviderMetadata {
9195

9296
export interface BuySellProviderMetadata extends ProviderMetadata {
9397
supportedCountries: string[]; // ['AT', 'BE']
98+
supportedSubdivisions: Subdivisions; // { 'US': ['AL', 'NY', 'WA'] }
9499
tradedCoins: CryptoId[]; // ['BTC', 'BCH', 'LTC', 'XRP', 'ETH', 'bitcoin', 'ethereum', 'litecoin', 'ethereum--0xdac17f958d2ee523a2206206994597c13d831ec7']
100+
disabledSubdivisions?: Subdivisions;
95101
}
96102

97103
// buy types
@@ -168,6 +174,7 @@ export interface BuyTradeQuoteRequest {
168174
fiatCurrency: string; // USD
169175
receiveCurrency: CryptoId; // bitcoin
170176
country?: string | undefined;
177+
subdivision?: string | undefined;
171178
paymentMethod?: BuyCryptoPaymentMethod | undefined;
172179
}
173180

@@ -501,6 +508,7 @@ export interface SellFiatTradeQuoteRequest {
501508
cryptoStringAmount?: string | undefined; // 0.3 - requested amount in crypto currency
502509
cryptoCurrency: CryptoId; // bitcoin
503510
country?: string | undefined;
511+
subdivision?: string | undefined;
504512
paymentMethod?: SellCryptoPaymentMethod | undefined;
505513
flows?: SellFiatFlowType[] | undefined;
506514
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ const providerInfo: BuyProviderInfo = {
6666
tradedCoins: [],
6767
tradedFiatCurrencies: [],
6868
supportedCountries: [],
69+
supportedSubdivisions: {},
70+
disabledSubdivisions: {},
6971
paymentMethods: [],
7072
statusUrl: "https://test-finance.invity.io/#status/{{paymentId}}",
7173
supportUrl: "",
@@ -124,6 +126,8 @@ const sellProviderInfo: SellProviderInfo = {
124126
tradedCoins: ["bitcoin", "ethereum"] as CryptoId[],
125127
tradedFiatCurrencies: ["USD"],
126128
supportedCountries: ["US"],
129+
supportedSubdivisions: {"US": ["WA"]},
130+
disabledSubdivisions: {},
127131
statusUrl: "https://example.com/txs/{{orderId}}",
128132
supportUrl: " https://support.example.com",
129133
termsUrl: "https://example.com/legal/terms-of-use",

0 commit comments

Comments
 (0)