@riocrypto/common 1.0.501 → 1.0.502

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.
@@ -42,6 +42,7 @@ declare class CCXTClient {
42
42
  crypto: Crypto;
43
43
  fiat: Fiat;
44
44
  }>;
45
+ getDepositAddress(crypto: Crypto): Promise<string>;
45
46
  }
46
47
  export declare const ccxtWrapper: CCXTClient;
47
48
  export {};
@@ -184,6 +184,17 @@ class CCXTClient {
184
184
  }
185
185
  });
186
186
  }
187
+ getDepositAddress(crypto) {
188
+ return __awaiter(this, void 0, void 0, function* () {
189
+ const exchange = yield this.getOptimalExchange(crypto);
190
+ if (!exchange)
191
+ throw new Error("Unable to get optimal exchange");
192
+ let depositAddress = yield exchange.fetchDepositAddress(crypto);
193
+ if (!depositAddress)
194
+ throw new Error("Unable to get deposit address");
195
+ return depositAddress.address;
196
+ });
197
+ }
187
198
  }
188
199
  exports.ccxtWrapper = new CCXTClient([rio_env_1.RioEnv.Production, rio_env_1.RioEnv.Staging].includes(process.env.RIO_ENV)
189
200
  ? "production"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.501",
3
+ "version": "1.0.502",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",