@riocrypto/common 1.0.929 → 1.0.932

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.
@@ -3,7 +3,7 @@ import { Admin } from "../types/admin";
3
3
  import { Auth } from "../types/auth";
4
4
  import { AuthUpdate } from "../types/auth-update";
5
5
  import { BankPayout } from "../types/bank-payout";
6
- import { CheckedAddress } from "../types/checked-address";
6
+ import { CryptoAddress } from "../types/crypto-address";
7
7
  import { Country } from "../types/country";
8
8
  import { Fiat } from "../types/fiat";
9
9
  import { Order } from "../types/order";
@@ -100,7 +100,8 @@ export declare class RioAdminClient {
100
100
  getOrder(id: string): Promise<Order>;
101
101
  createBankPayout(oid: string, bankAccountId: string): Promise<BankPayout>;
102
102
  getBankPayout(orderId: string): Promise<BankPayout>;
103
- createCheckedAddress(address: string, crypto: Crypto): Promise<CheckedAddress>;
103
+ getCryptoAddresses(userId: string, address?: string, crypto?: Crypto): Promise<CryptoAddress[]>;
104
+ createCryptoAddress(address: string, crypto: Crypto, userId: string, label?: string): Promise<CryptoAddress>;
104
105
  createBankAccount(userId: string, country: Country, fiat: Fiat, bankName: string, accountHolderName: string, accountNumber: string, swiftCode?: string, notes?: string): Promise<BankAccount>;
105
106
  updateBankAccount(id: string, userId?: string, country?: Country, fiat?: Fiat, bankName?: string, accountHolderName?: string, accountNumber?: string, swiftCode?: string, notes?: string, approved?: boolean): Promise<BankAccount>;
106
107
  deleteBankAccount(id: string): Promise<void>;
@@ -336,11 +336,25 @@ class RioAdminClient {
336
336
  return response.data;
337
337
  });
338
338
  }
339
- createCheckedAddress(address, crypto) {
339
+ getCryptoAddresses(userId, address, crypto) {
340
340
  return __awaiter(this, void 0, void 0, function* () {
341
- const response = yield this.axios.post(`/api/kyt/address`, {
341
+ const response = yield this.axios.get(`/api/address`, {
342
+ params: {
343
+ userId,
344
+ address,
345
+ crypto,
346
+ },
347
+ });
348
+ return response.data;
349
+ });
350
+ }
351
+ createCryptoAddress(address, crypto, userId, label) {
352
+ return __awaiter(this, void 0, void 0, function* () {
353
+ const response = yield this.axios.post(`/api/address`, {
342
354
  address,
343
355
  crypto,
356
+ userId,
357
+ label,
344
358
  });
345
359
  return response.data;
346
360
  });
@@ -2,7 +2,7 @@ import { AxiosInstance, AxiosStatic } from "axios";
2
2
  import { Auth } from "../types/auth";
3
3
  import { AuthUpdate } from "../types/auth-update";
4
4
  import { BankPayout } from "../types/bank-payout";
5
- import { CheckedAddress } from "../types/checked-address";
5
+ import { CryptoAddress } from "../types/crypto-address";
6
6
  import { Country } from "../types/country";
7
7
  import { Fiat } from "../types/fiat";
8
8
  import { Order } from "../types/order";
@@ -74,7 +74,8 @@ export declare class RioClient {
74
74
  account_owner_name: string;
75
75
  last_4: string;
76
76
  }[]>;
77
- createCheckedAddress(address: string, crypto: Crypto): Promise<CheckedAddress>;
77
+ getCryptoAddresses(userId?: string, address?: string, crypto?: Crypto): Promise<CryptoAddress[]>;
78
+ createCryptoAddress(address: string, crypto: Crypto, userId?: string, label?: string): Promise<CryptoAddress>;
78
79
  createBridgePlaidLink(userId: string): Promise<string>;
79
80
  createBankAccount(userId: string, country: Country, fiat: Fiat, bankName: string, accountHolderName: string, accountNumber: string, swiftCode?: string, notes?: string): Promise<BankAccount>;
80
81
  updateBankAccount(id: string, userId?: string, country?: Country, fiat?: Fiat, accountNumber?: string, swiftCode?: string, notes?: string, approved?: boolean): Promise<BankAccount>;
@@ -228,9 +228,21 @@ class RioClient {
228
228
  return data;
229
229
  });
230
230
  }
231
- createCheckedAddress(address, crypto) {
231
+ getCryptoAddresses(userId, address, crypto) {
232
232
  return __awaiter(this, void 0, void 0, function* () {
233
- const response = yield this.axios.post(`/api/kyt/address`, {
233
+ const response = yield this.axios.get(`/api/address`, {
234
+ params: {
235
+ userId,
236
+ address,
237
+ crypto,
238
+ },
239
+ });
240
+ return response.data;
241
+ });
242
+ }
243
+ createCryptoAddress(address, crypto, userId, label) {
244
+ return __awaiter(this, void 0, void 0, function* () {
245
+ const response = yield this.axios.post(`/api/address`, {
234
246
  address,
235
247
  crypto,
236
248
  });
@@ -35,8 +35,6 @@ export declare enum Subjects {
35
35
  LiquidityRoutingFailed = "liquidity:routingFailed",
36
36
  FeesFailed = "fees:failed",
37
37
  DepositAddressFailed = "deposit:addressFailed",
38
- CheckedAddressCreated = "checkedAddress:created",
39
- CheckedAddressUpdated = "checkedAddress:updated",
40
38
  KYCPassed = "kyc:passed",
41
39
  KYCReview = "kyc:review",
42
40
  KYCFailed = "kyc:failed",
@@ -39,8 +39,6 @@ var Subjects;
39
39
  Subjects["LiquidityRoutingFailed"] = "liquidity:routingFailed";
40
40
  Subjects["FeesFailed"] = "fees:failed";
41
41
  Subjects["DepositAddressFailed"] = "deposit:addressFailed";
42
- Subjects["CheckedAddressCreated"] = "checkedAddress:created";
43
- Subjects["CheckedAddressUpdated"] = "checkedAddress:updated";
44
42
  Subjects["KYCPassed"] = "kyc:passed";
45
43
  Subjects["KYCReview"] = "kyc:review";
46
44
  Subjects["KYCFailed"] = "kyc:failed";
package/build/index.d.ts CHANGED
@@ -73,8 +73,6 @@ export * from "./events/processor-routing-failed-event";
73
73
  export * from "./events/liquidity-routing-failed-event";
74
74
  export * from "./events/fees-failed-event";
75
75
  export * from "./events/deposit-address-failed-event";
76
- export * from "./events/checked-address-created-event";
77
- export * from "./events/checked-address-updated-event";
78
76
  export * from "./events/kyc-passed-event";
79
77
  export * from "./events/kyc-review-event";
80
78
  export * from "./events/kyc-failed-event";
@@ -127,7 +125,7 @@ export * from "./types/rio-settings";
127
125
  export * from "./types/rio-settings-update";
128
126
  export * from "./types/rio-env";
129
127
  export * from "./types/bank-payout";
130
- export * from "./types/checked-address";
128
+ export * from "./types/crypto-address";
131
129
  export * from "./types/address-check-result";
132
130
  export * from "./types/fireblocks-vault";
133
131
  export * from "./types/fireblocks-transfer";
package/build/index.js CHANGED
@@ -89,8 +89,6 @@ __exportStar(require("./events/processor-routing-failed-event"), exports);
89
89
  __exportStar(require("./events/liquidity-routing-failed-event"), exports);
90
90
  __exportStar(require("./events/fees-failed-event"), exports);
91
91
  __exportStar(require("./events/deposit-address-failed-event"), exports);
92
- __exportStar(require("./events/checked-address-created-event"), exports);
93
- __exportStar(require("./events/checked-address-updated-event"), exports);
94
92
  __exportStar(require("./events/kyc-passed-event"), exports);
95
93
  __exportStar(require("./events/kyc-review-event"), exports);
96
94
  __exportStar(require("./events/kyc-failed-event"), exports);
@@ -143,7 +141,7 @@ __exportStar(require("./types/rio-settings"), exports);
143
141
  __exportStar(require("./types/rio-settings-update"), exports);
144
142
  __exportStar(require("./types/rio-env"), exports);
145
143
  __exportStar(require("./types/bank-payout"), exports);
146
- __exportStar(require("./types/checked-address"), exports);
144
+ __exportStar(require("./types/crypto-address"), exports);
147
145
  __exportStar(require("./types/address-check-result"), exports);
148
146
  __exportStar(require("./types/fireblocks-vault"), exports);
149
147
  __exportStar(require("./types/fireblocks-transfer"), exports);
@@ -0,0 +1,9 @@
1
+ export interface CryptoAddress {
2
+ id: string;
3
+ userId: string;
4
+ crypto: Crypto;
5
+ address: string;
6
+ approved: boolean;
7
+ lastChecked: Date;
8
+ label?: string;
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.929",
3
+ "version": "1.0.932",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -1,11 +0,0 @@
1
- import { AddressCheckResult } from "../types/address-check-result";
2
- import { Subjects } from "./subjects";
3
- export interface CheckedAddressCreatedEvent {
4
- subject: Subjects.CheckedAddressCreated;
5
- data: {
6
- id: string;
7
- address: string;
8
- result: AddressCheckResult;
9
- lastChecked: Date;
10
- };
11
- }
@@ -1,10 +0,0 @@
1
- import { AddressCheckResult } from "../types/address-check-result";
2
- import { Subjects } from "./subjects";
3
- export interface CheckedAddressUpdatedEvent {
4
- subject: Subjects.CheckedAddressUpdated;
5
- data: {
6
- id: string;
7
- result: AddressCheckResult;
8
- lastChecked: Date;
9
- };
10
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +0,0 @@
1
- import { AddressCheckResult } from "./address-check-result";
2
- export interface CheckedAddress {
3
- id: string;
4
- address: string;
5
- result: AddressCheckResult;
6
- lastChecked: Date;
7
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });