@riocrypto/common-server 1.0.1647 → 1.0.1650
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.
- package/build/clients/coinbase-client.d.ts +1 -1
- package/build/clients/coinbase-client.js +12 -4
- package/build/index.d.ts +1 -1
- package/build/index.js +1 -1
- package/build/models/{multi-part-liquidity-order.d.ts → multipart-liquidity-order.d.ts} +6 -6
- package/build/models/{multi-part-liquidity-order.js → multipart-liquidity-order.js} +10 -10
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@ declare class CoinbaseClient {
|
|
|
3
3
|
private apiKey;
|
|
4
4
|
private baseUrl;
|
|
5
5
|
private productIdMappings;
|
|
6
|
-
constructor(apiKey: string);
|
|
6
|
+
constructor(apiKey: string, env?: "production" | "sandbox");
|
|
7
7
|
private getRequestHeaders;
|
|
8
8
|
createMarketOrder(crypto: Crypto, amount: number): Promise<any>;
|
|
9
9
|
}
|
|
@@ -18,13 +18,21 @@ const axios_1 = __importDefault(require("axios"));
|
|
|
18
18
|
const common_1 = require("@riocrypto/common");
|
|
19
19
|
const crypto_1 = require("crypto");
|
|
20
20
|
class CoinbaseClient {
|
|
21
|
-
constructor(apiKey) {
|
|
21
|
+
constructor(apiKey, env) {
|
|
22
22
|
this.apiKey = apiKey;
|
|
23
|
-
if (
|
|
24
|
-
this.baseUrl =
|
|
23
|
+
if (env) {
|
|
24
|
+
this.baseUrl =
|
|
25
|
+
env === "production"
|
|
26
|
+
? "https://api.exchange.coinbase.com"
|
|
27
|
+
: "https://api-public.sandbox.exchange.coinbase.com";
|
|
25
28
|
}
|
|
26
29
|
else {
|
|
27
|
-
|
|
30
|
+
if ([common_1.RioEnv.Development, common_1.RioEnv.Production, common_1.RioEnv.Staging].includes(process.env.RIO_ENV)) {
|
|
31
|
+
this.baseUrl = "https://api.exchange.coinbase.com";
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.baseUrl = "https://api-public.sandbox.exchange.coinbase.com";
|
|
35
|
+
}
|
|
28
36
|
}
|
|
29
37
|
this.productIdMappings = {
|
|
30
38
|
[common_1.Crypto.USDTEthereum]: "USDT-USD",
|
package/build/index.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export * from "./models/address-verification";
|
|
|
58
58
|
export * from "./models/bank-account-verification";
|
|
59
59
|
export * from "./models/coincover-transaction";
|
|
60
60
|
export * from "./models/coinbase-order";
|
|
61
|
-
export * from "./models/
|
|
61
|
+
export * from "./models/multipart-liquidity-order";
|
|
62
62
|
export * from "./clients/bitstamp-client";
|
|
63
63
|
export * from "./clients/ccxt-client";
|
|
64
64
|
export * from "./clients/slack-client";
|
package/build/index.js
CHANGED
|
@@ -74,7 +74,7 @@ __exportStar(require("./models/address-verification"), exports);
|
|
|
74
74
|
__exportStar(require("./models/bank-account-verification"), exports);
|
|
75
75
|
__exportStar(require("./models/coincover-transaction"), exports);
|
|
76
76
|
__exportStar(require("./models/coinbase-order"), exports);
|
|
77
|
-
__exportStar(require("./models/
|
|
77
|
+
__exportStar(require("./models/multipart-liquidity-order"), exports);
|
|
78
78
|
__exportStar(require("./clients/bitstamp-client"), exports);
|
|
79
79
|
__exportStar(require("./clients/ccxt-client"), exports);
|
|
80
80
|
__exportStar(require("./clients/slack-client"), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Crypto, Fiat } from "@riocrypto/common";
|
|
2
2
|
import mongoose from "mongoose";
|
|
3
|
-
interface
|
|
3
|
+
interface MultipartLiquidityOrderAttrs {
|
|
4
4
|
createdAt: Date;
|
|
5
5
|
destinationCrypto: Crypto;
|
|
6
6
|
originFiat: Fiat;
|
|
@@ -9,7 +9,7 @@ interface MultiPartLiquidityOrderAttrs {
|
|
|
9
9
|
status: "bbvaWithdrawn" | "brexDeposited" | "brexWithdrawn" | "coinbaseDeposited" | "coinbaseTrading" | "coinbaseTraded" | "coinbaseWithdrawn" | "done";
|
|
10
10
|
coinbaseOrderId?: string;
|
|
11
11
|
}
|
|
12
|
-
interface
|
|
12
|
+
interface MultipartLiquidityOrderDoc extends mongoose.Document {
|
|
13
13
|
createdAt: Date;
|
|
14
14
|
destinationCrypto: Crypto;
|
|
15
15
|
originFiat: Fiat;
|
|
@@ -18,8 +18,8 @@ interface MultiPartLiquidityOrderDoc extends mongoose.Document {
|
|
|
18
18
|
status: "bbvaWithdrawn" | "brexDeposited" | "brexWithdrawn" | "coinbaseDeposited" | "coinbaseTrading" | "coinbaseTraded" | "coinbaseWithdrawn" | "done";
|
|
19
19
|
coinbaseOrderId?: string;
|
|
20
20
|
}
|
|
21
|
-
interface
|
|
22
|
-
build(attrs:
|
|
21
|
+
interface MultipartLiquidityOrderModel extends mongoose.Model<MultipartLiquidityOrderDoc> {
|
|
22
|
+
build(attrs: MultipartLiquidityOrderAttrs): MultipartLiquidityOrderDoc;
|
|
23
23
|
}
|
|
24
|
-
declare const
|
|
25
|
-
export {
|
|
24
|
+
declare const buildMultipartLiquidityOrder: (mongoose: typeof mongoose) => MultipartLiquidityOrderModel;
|
|
25
|
+
export { buildMultipartLiquidityOrder, MultipartLiquidityOrderDoc, MultipartLiquidityOrderAttrs, };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
3
|
+
exports.buildMultipartLiquidityOrder = void 0;
|
|
4
|
+
const buildMultipartLiquidityOrder = (mongoose) => {
|
|
5
5
|
// if model is already defined, return it
|
|
6
|
-
if (mongoose.models.
|
|
7
|
-
return mongoose.model("
|
|
6
|
+
if (mongoose.models.MultipartLiquidityOrder) {
|
|
7
|
+
return mongoose.model("MultipartLiquidityOrder");
|
|
8
8
|
}
|
|
9
|
-
const
|
|
9
|
+
const MultipartLiquidityOrderSchema = new mongoose.Schema({
|
|
10
10
|
createdAt: {
|
|
11
11
|
type: Date,
|
|
12
12
|
required: true,
|
|
@@ -42,10 +42,10 @@ const buildMultiPartLiquidityOrder = (mongoose) => {
|
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
});
|
|
45
|
-
|
|
46
|
-
return new
|
|
45
|
+
MultipartLiquidityOrderSchema.statics.build = (attrs) => {
|
|
46
|
+
return new MultipartLiquidityOrder(attrs);
|
|
47
47
|
};
|
|
48
|
-
const
|
|
49
|
-
return
|
|
48
|
+
const MultipartLiquidityOrder = mongoose.model("MultipartLiquidityOrder", MultipartLiquidityOrderSchema);
|
|
49
|
+
return MultipartLiquidityOrder;
|
|
50
50
|
};
|
|
51
|
-
exports.
|
|
51
|
+
exports.buildMultipartLiquidityOrder = buildMultipartLiquidityOrder;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1650",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@google-cloud/storage": "^6.9.5",
|
|
29
29
|
"@google-cloud/vision": "^4.0.2",
|
|
30
30
|
"@hyperdx/node-opentelemetry": "^0.4.2",
|
|
31
|
-
"@riocrypto/common": "^1.0.
|
|
31
|
+
"@riocrypto/common": "^1.0.1467",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.6.0",
|
|
34
34
|
"ccxt": "^3.0.30",
|