mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-05 05:15:48 +00:00
Compare commits
3 Commits
ripple-key
...
nn/blitz
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e9c922e41 | ||
|
|
e71123ad9d | ||
|
|
248445acd9 |
@@ -84,7 +84,7 @@
|
||||
"watch": "run-s build:lib --watch",
|
||||
"clean": "rm -rf dist",
|
||||
"docgen": "typedoc ./src/index.ts",
|
||||
"prepublish": "run-s clean build",
|
||||
"prepublish": "npm run clean && npm run build",
|
||||
"test": "nyc mocha --config=test/.mocharc.json --exit",
|
||||
"test:integration": "TS_NODE_PROJECT=tsconfig.build.json nyc mocha ./test/integration/**/*.ts ./test/integration/*.ts",
|
||||
"test:browser": "npm run build:browserTests && TS_NODE_PROJECT=tsconfig.build.json nyc mocha ./test/browser/*.ts",
|
||||
|
||||
@@ -216,6 +216,7 @@ export class Connection extends EventEmitter {
|
||||
* @throws ConnectionError if there is a connection error, RippleError if there is already a WebSocket in existence.
|
||||
*/
|
||||
public async connect(): Promise<void> {
|
||||
console.log('CONNECTING IN CONNECTION.CONNECT')
|
||||
if (this.isConnected()) {
|
||||
return Promise.resolve()
|
||||
}
|
||||
@@ -325,6 +326,7 @@ export class Connection extends EventEmitter {
|
||||
if (!this.shouldBeConnected || this.ws == null) {
|
||||
throw new NotConnectedError()
|
||||
}
|
||||
|
||||
const [id, message, responsePromise] = this.requestManager.createRequest(
|
||||
request,
|
||||
timeout ?? this.config.timeout,
|
||||
|
||||
@@ -182,6 +182,8 @@ class Client extends EventEmitter {
|
||||
// eslint-disable-next-line max-lines-per-function -- okay because we have to set up all the connection handlers
|
||||
public constructor(server: string, options: ClientOptions = {}) {
|
||||
super()
|
||||
console.log('CONSTRUCTING CLIENT')
|
||||
|
||||
if (typeof server !== 'string' || !/wss?(?:\+unix)?:\/\//u.exec(server)) {
|
||||
throw new ValidationError(
|
||||
'server URI must start with `wss://`, `ws://`, `wss+unix://`, or `ws+unix://`.',
|
||||
@@ -500,6 +502,8 @@ class Client extends EventEmitter {
|
||||
* @returns A promise that resolves with a void value when a connection is established.
|
||||
*/
|
||||
public async connect(): Promise<void> {
|
||||
console.log('CONNECTING IN CLIENT.CONNECT')
|
||||
|
||||
return this.connection.connect()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user