@riocrypto/common 1.0.1068 → 1.0.1070

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.
@@ -103,7 +103,7 @@ export declare class RioAdminClient {
103
103
  }>;
104
104
  refreshAdminToken(): Promise<void>;
105
105
  createOrder(order: OrderInput): Promise<Order>;
106
- createBridgeExternalAccount(userId: string, bankName: string, accountNumber: string, routingNumber: string, accountOwnerName: string, streetLine1: string, streetLine2: string, city: string, state: string, postalCode: string): Promise<string>;
106
+ createBridgeExternalAccount(userId: string, bankName: string, accountNumber: string, routingNumber: string, accountOwnerName: string, streetLine1: string, streetLine2: string, city: string, state: string, postalCode: string, country: Country): Promise<string>;
107
107
  getChainedOrders(page: number, limit?: number, query?: ChainedOrderQuery): Promise<ChainedOrder[]>;
108
108
  getChainedQuote(id: string): Promise<ChainedQuote>;
109
109
  getChainedOrder(id: string): Promise<ChainedOrder>;
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.RioAdminClient = void 0;
13
- const country_1 = require("../types/country");
14
13
  class RioAdminClient {
15
14
  constructor(axios) {
16
15
  this.axios = axios;
@@ -317,7 +316,7 @@ class RioAdminClient {
317
316
  return response.data;
318
317
  });
319
318
  }
320
- createBridgeExternalAccount(userId, bankName, accountNumber, routingNumber, accountOwnerName, streetLine1, streetLine2, city, state, postalCode) {
319
+ createBridgeExternalAccount(userId, bankName, accountNumber, routingNumber, accountOwnerName, streetLine1, streetLine2, city, state, postalCode, country) {
321
320
  return __awaiter(this, void 0, void 0, function* () {
322
321
  const response = yield this.axios.post("/api/bank/us/accounts", {
323
322
  userId,
@@ -330,7 +329,7 @@ class RioAdminClient {
330
329
  city,
331
330
  state,
332
331
  postalCode,
333
- country: country_1.Country.UnitedStates,
332
+ country,
334
333
  });
335
334
  return response.data.id;
336
335
  });
@@ -88,7 +88,7 @@ export declare class RioClient {
88
88
  getCryptoAddresses(page: number, limit?: number, query?: CryptoAddressQuery): Promise<CryptoAddress[]>;
89
89
  createCryptoAddress(address: string, crypto: Crypto, userId?: string, label?: string): Promise<CryptoAddress>;
90
90
  createBridgePlaidLink(userId: string): Promise<string>;
91
- createBridgeExternalAccount(userId: string, bankName: string, accountNumber: string, routingNumber: string, accountOwnerName: string, streetLine1: string, streetLine2: string, city: string, state: string, postalCode: string): Promise<string>;
91
+ createBridgeExternalAccount(userId: string, bankName: string, accountNumber: string, routingNumber: string, accountOwnerName: string, streetLine1: string, streetLine2: string, city: string, state: string, postalCode: string, country: Country): Promise<string>;
92
92
  createBankAccount(userId: string, country: Country, fiat: Fiat, bankName: string, accountHolderName: string, accountNumber: string, swiftCode?: string, CCI?: string, notes?: string): Promise<BankAccount>;
93
93
  updateBankAccount(id: string, userId?: string, country?: Country, fiat?: Fiat, accountNumber?: string, swiftCode?: string, notes?: string, approved?: boolean): Promise<BankAccount>;
94
94
  getFeesByVolume(): Promise<{
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.RioClient = void 0;
13
- const country_1 = require("../types/country");
14
13
  class RioClient {
15
14
  constructor(axios) {
16
15
  this.axios = axios;
@@ -294,7 +293,7 @@ class RioClient {
294
293
  return response.data.url;
295
294
  });
296
295
  }
297
- createBridgeExternalAccount(userId, bankName, accountNumber, routingNumber, accountOwnerName, streetLine1, streetLine2, city, state, postalCode) {
296
+ createBridgeExternalAccount(userId, bankName, accountNumber, routingNumber, accountOwnerName, streetLine1, streetLine2, city, state, postalCode, country) {
298
297
  return __awaiter(this, void 0, void 0, function* () {
299
298
  const response = yield this.axios.post("/api/bank/us/accounts", {
300
299
  userId,
@@ -307,7 +306,7 @@ class RioClient {
307
306
  city,
308
307
  state,
309
308
  postalCode,
310
- country: country_1.Country.UnitedStates,
309
+ country,
311
310
  });
312
311
  return response.data.id;
313
312
  });
@@ -0,0 +1,2 @@
1
+ import { Country } from "../types/country";
2
+ export declare function convertAlpha2ToAlpha3(alpha2Code: Country): string | undefined;
@@ -0,0 +1,256 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertAlpha2ToAlpha3 = void 0;
4
+ const alpha2ToAlpha3 = {
5
+ AF: "AFG",
6
+ AX: "ALA",
7
+ AL: "ALB",
8
+ DZ: "DZA",
9
+ AS: "ASM",
10
+ AD: "AND",
11
+ AO: "AGO",
12
+ AI: "AIA",
13
+ AQ: "ATA",
14
+ AG: "ATG",
15
+ AR: "ARG",
16
+ AM: "ARM",
17
+ AW: "ABW",
18
+ AU: "AUS",
19
+ AT: "AUT",
20
+ AZ: "AZE",
21
+ BS: "BHS",
22
+ BH: "BHR",
23
+ BD: "BGD",
24
+ BB: "BRB",
25
+ BY: "BLR",
26
+ BE: "BEL",
27
+ BZ: "BLZ",
28
+ BJ: "BEN",
29
+ BM: "BMU",
30
+ BT: "BTN",
31
+ BO: "BOL",
32
+ BA: "BIH",
33
+ BW: "BWA",
34
+ BV: "BVT",
35
+ BR: "BRA",
36
+ IO: "IOT",
37
+ BN: "BRN",
38
+ BG: "BGR",
39
+ BF: "BFA",
40
+ BI: "BDI",
41
+ KH: "KHM",
42
+ CM: "CMR",
43
+ CA: "CAN",
44
+ CV: "CPV",
45
+ KY: "CYM",
46
+ CF: "CAF",
47
+ TD: "TCD",
48
+ CL: "CHL",
49
+ CN: "CHN",
50
+ CX: "CXR",
51
+ CC: "CCK",
52
+ CO: "COL",
53
+ KM: "COM",
54
+ CG: "COG",
55
+ CD: "COD",
56
+ CK: "COK",
57
+ CR: "CRI",
58
+ CI: "CIV",
59
+ HR: "HRV",
60
+ CU: "CUB",
61
+ CY: "CYP",
62
+ CZ: "CZE",
63
+ DK: "DNK",
64
+ DJ: "DJI",
65
+ DM: "DMA",
66
+ DO: "DOM",
67
+ EC: "ECU",
68
+ EG: "EGY",
69
+ SV: "SLV",
70
+ GQ: "GNQ",
71
+ ER: "ERI",
72
+ EE: "EST",
73
+ ET: "ETH",
74
+ FK: "FLK",
75
+ FO: "FRO",
76
+ FJ: "FJI",
77
+ FI: "FIN",
78
+ FR: "FRA",
79
+ GF: "GUF",
80
+ PF: "PYF",
81
+ TF: "ATF",
82
+ GA: "GAB",
83
+ GM: "GMB",
84
+ GE: "GEO",
85
+ DE: "DEU",
86
+ GH: "GHA",
87
+ GI: "GIB",
88
+ GR: "GRC",
89
+ GL: "GRL",
90
+ GD: "GRD",
91
+ GP: "GLP",
92
+ GU: "GUM",
93
+ GT: "GTM",
94
+ GG: "GGY",
95
+ GN: "GIN",
96
+ GW: "GNB",
97
+ GY: "GUY",
98
+ HT: "HTI",
99
+ HM: "HMD",
100
+ VA: "VAT",
101
+ HN: "HND",
102
+ HK: "HKG",
103
+ HU: "HUN",
104
+ IS: "ISL",
105
+ IN: "IND",
106
+ ID: "IDN",
107
+ IR: "IRN",
108
+ IQ: "IRQ",
109
+ IE: "IRL",
110
+ IM: "IMN",
111
+ IL: "ISR",
112
+ IT: "ITA",
113
+ JM: "JAM",
114
+ JP: "JPN",
115
+ JE: "JEY",
116
+ JO: "JOR",
117
+ KZ: "KAZ",
118
+ KE: "KEN",
119
+ KI: "KIR",
120
+ KP: "PRK",
121
+ KR: "KOR",
122
+ KW: "KWT",
123
+ KG: "KGZ",
124
+ LA: "LAO",
125
+ LV: "LVA",
126
+ LB: "LBN",
127
+ LS: "LSO",
128
+ LR: "LBR",
129
+ LY: "LBY",
130
+ LI: "LIE",
131
+ LT: "LTU",
132
+ LU: "LUX",
133
+ MO: "MAC",
134
+ MK: "MKD",
135
+ MG: "MDG",
136
+ MW: "MWI",
137
+ MY: "MYS",
138
+ MV: "MDV",
139
+ ML: "MLI",
140
+ MT: "MLT",
141
+ MH: "MHL",
142
+ MQ: "MTQ",
143
+ MR: "MRT",
144
+ MU: "MUS",
145
+ YT: "MYT",
146
+ MX: "MEX",
147
+ FM: "FSM",
148
+ MD: "MDA",
149
+ MC: "MCO",
150
+ MN: "MNG",
151
+ ME: "MNE",
152
+ MS: "MSR",
153
+ MA: "MAR",
154
+ MZ: "MOZ",
155
+ MM: "MMR",
156
+ NA: "NAM",
157
+ NR: "NRU",
158
+ NP: "NPL",
159
+ NL: "NLD",
160
+ AN: "ANT",
161
+ NC: "NCL",
162
+ NZ: "NZL",
163
+ NI: "NIC",
164
+ NE: "NER",
165
+ NG: "NGA",
166
+ NU: "NIU",
167
+ NF: "NFK",
168
+ MP: "MNP",
169
+ NO: "NOR",
170
+ OM: "OMN",
171
+ PK: "PAK",
172
+ PW: "PLW",
173
+ PS: "PSE",
174
+ PA: "PAN",
175
+ PG: "PNG",
176
+ PY: "PRY",
177
+ PE: "PER",
178
+ PH: "PHL",
179
+ PN: "PCN",
180
+ PL: "POL",
181
+ PT: "PRT",
182
+ PR: "PRI",
183
+ QA: "QAT",
184
+ RE: "REU",
185
+ RO: "ROU",
186
+ RU: "RUS",
187
+ RW: "RWA",
188
+ BL: "BLM",
189
+ SH: "SHN",
190
+ KN: "KNA",
191
+ LC: "LCA",
192
+ MF: "MAF",
193
+ PM: "SPM",
194
+ VC: "VCT",
195
+ WS: "WSM",
196
+ SM: "SMR",
197
+ ST: "STP",
198
+ SA: "SAU",
199
+ SN: "SEN",
200
+ RS: "SRB",
201
+ SC: "SYC",
202
+ SL: "SLE",
203
+ SG: "SGP",
204
+ SK: "SVK",
205
+ SI: "SVN",
206
+ SB: "SLB",
207
+ SO: "SOM",
208
+ ZA: "ZAF",
209
+ GS: "SGS",
210
+ ES: "ESP",
211
+ LK: "LKA",
212
+ SD: "SDN",
213
+ SR: "SUR",
214
+ SJ: "SJM",
215
+ SZ: "SWZ",
216
+ SE: "SWE",
217
+ CH: "CHE",
218
+ SY: "SYR",
219
+ TW: "TWN",
220
+ TJ: "TJK",
221
+ TZ: "TZA",
222
+ TH: "THA",
223
+ TL: "TLS",
224
+ TG: "TGO",
225
+ TK: "TKL",
226
+ TO: "TON",
227
+ TT: "TTO",
228
+ TN: "TUN",
229
+ TR: "TUR",
230
+ TM: "TKM",
231
+ TC: "TCA",
232
+ TV: "TUV",
233
+ UG: "UGA",
234
+ UA: "UKR",
235
+ AE: "ARE",
236
+ GB: "GBR",
237
+ US: "USA",
238
+ UM: "UMI",
239
+ UY: "URY",
240
+ UZ: "UZB",
241
+ VU: "VUT",
242
+ VE: "VEN",
243
+ VN: "VNM",
244
+ VG: "VGB",
245
+ VI: "VIR",
246
+ WF: "WLF",
247
+ EH: "ESH",
248
+ YE: "YEM",
249
+ ZM: "ZMB",
250
+ ZW: "ZWE",
251
+ };
252
+ function convertAlpha2ToAlpha3(alpha2Code) {
253
+ const upperCaseAlpha2 = alpha2Code.toUpperCase();
254
+ return alpha2ToAlpha3[upperCaseAlpha2];
255
+ }
256
+ exports.convertAlpha2ToAlpha3 = convertAlpha2ToAlpha3;
package/build/index.d.ts CHANGED
@@ -197,6 +197,7 @@ export * from "./helpers/humanize-kyc-status";
197
197
  export * from "./helpers/format-transaction-hash";
198
198
  export * from "./helpers/round-to-decimals";
199
199
  export * from "./helpers/number-with-commas";
200
+ export * from "./helpers/alpha-2-to-alpha-3";
200
201
  export * from "./clients/rio-client";
201
202
  export * from "./clients/rio-admin-client";
202
203
  export * from "./constants/mexico-fiscal-regimens";
package/build/index.js CHANGED
@@ -213,6 +213,7 @@ __exportStar(require("./helpers/humanize-kyc-status"), exports);
213
213
  __exportStar(require("./helpers/format-transaction-hash"), exports);
214
214
  __exportStar(require("./helpers/round-to-decimals"), exports);
215
215
  __exportStar(require("./helpers/number-with-commas"), exports);
216
+ __exportStar(require("./helpers/alpha-2-to-alpha-3"), exports);
216
217
  __exportStar(require("./clients/rio-client"), exports);
217
218
  __exportStar(require("./clients/rio-admin-client"), exports);
218
219
  __exportStar(require("./constants/mexico-fiscal-regimens"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.1068",
3
+ "version": "1.0.1070",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",