coinbase-pro-node
Advanced tools
Comparing version 2.15.0 to 2.16.0
import { RESTClient } from './client/RESTClient'; | ||
import { WebSocketClient } from './client/WebSocketClient'; | ||
export interface ClientAuthentication { | ||
export interface ClientAuthenticationBase { | ||
apiKey: string; | ||
apiSecret: string; | ||
passphrase: string; | ||
} | ||
export interface ClientAuthenticationBaseUrls extends ClientAuthenticationBase { | ||
apiKey: string; | ||
apiSecret: string; | ||
passphrase: string; | ||
useSandbox: boolean; | ||
} | ||
export interface ClientAuthenticationCustomUrls extends ClientAuthenticationBase { | ||
apiKey: string; | ||
apiSecret: string; | ||
httpUrl: string; | ||
passphrase: string; | ||
wsUrl: string; | ||
} | ||
export declare type ClientAuthentication = ClientAuthenticationBaseUrls | ClientAuthenticationCustomUrls; | ||
export interface ClientConnection { | ||
@@ -10,0 +23,0 @@ REST: string; |
@@ -23,3 +23,15 @@ "use strict"; | ||
}) { | ||
this.url = auth.useSandbox === true ? CoinbasePro.SETUP.SANDBOX : CoinbasePro.SETUP.PRODUCTION; | ||
if (typeof auth.useSandbox === 'boolean') { | ||
this.url = | ||
auth.useSandbox === true | ||
? CoinbasePro.SETUP.SANDBOX | ||
: CoinbasePro.SETUP.PRODUCTION; | ||
} | ||
else { | ||
const { httpUrl, wsUrl } = auth; | ||
this.url = { | ||
REST: httpUrl, | ||
WebSocket: wsUrl, | ||
}; | ||
} | ||
const signRequest = (setup) => __awaiter(this, void 0, void 0, function* () { | ||
@@ -26,0 +38,0 @@ const clockSkew = yield this.rest.time.getClockSkew(); |
@@ -28,4 +28,15 @@ "use strict"; | ||
}); | ||
it('supports custom URLs to use a proxy server', () => { | ||
const proxyUrl = 'http://localhost:3000/rest-proxy'; | ||
const client = new CoinbasePro_1.CoinbasePro({ | ||
apiKey: '', | ||
apiSecret: '', | ||
passphrase: '', | ||
httpUrl: proxyUrl, | ||
wsUrl: 'wss://ws-feed-public.sandbox.pro.coinbase.com', | ||
}); | ||
expect(client.url.REST).toBe(proxyUrl); | ||
}); | ||
}); | ||
}); | ||
//# sourceMappingURL=CoinbasePro.test.js.map |
@@ -103,3 +103,3 @@ { | ||
}, | ||
"version": "2.15.0" | ||
"version": "2.16.0" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
393430
4605