gn-provider 1.0.9 → 1.1.0
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/dist/gn-provider.d.ts +0 -1
- package/dist/gn-provider.js +16 -5
- package/package.json +1 -1
package/dist/gn-provider.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ export declare class GNProvider extends Provider {
|
|
|
10
10
|
private _network;
|
|
11
11
|
private _isConnected;
|
|
12
12
|
private _apiKey;
|
|
13
|
-
protected _initializeConnection: () => void;
|
|
14
13
|
constructor(network: scryptlib.bsv.Networks.Network, apiKey?: string);
|
|
15
14
|
get apiPrefix(): string;
|
|
16
15
|
isConnected(): boolean;
|
package/dist/gn-provider.js
CHANGED
|
@@ -59,16 +59,27 @@ var ProviderEvent;
|
|
|
59
59
|
ProviderEvent["NetworkChange"] = "networkChange";
|
|
60
60
|
})(ProviderEvent || (ProviderEvent = {}));
|
|
61
61
|
class GNProvider extends abstract_provider_1.Provider {
|
|
62
|
+
/*protected _initializeConnection = () => {
|
|
63
|
+
this.connect().catch(console.error);
|
|
64
|
+
}*/
|
|
65
|
+
/*constructor(network: scryptlib.bsv.Networks.Network, apiKey = '') {
|
|
66
|
+
super();
|
|
67
|
+
Object.setPrototypeOf(this, EventEmitter.prototype);
|
|
68
|
+
this._network = network;
|
|
69
|
+
this._apiKey = apiKey;
|
|
70
|
+
this._initializeConnection();
|
|
71
|
+
}*/
|
|
62
72
|
constructor(network, apiKey = '') {
|
|
63
73
|
super();
|
|
64
74
|
this._isConnected = false;
|
|
65
|
-
|
|
66
|
-
this.connect().catch(console.error);
|
|
67
|
-
};
|
|
68
|
-
Object.setPrototypeOf(this, events_1.EventEmitter.prototype);
|
|
75
|
+
// Inicializa propiedades primero
|
|
69
76
|
this._network = network;
|
|
70
77
|
this._apiKey = apiKey;
|
|
71
|
-
this.
|
|
78
|
+
this._isConnected = false;
|
|
79
|
+
// Configura EventEmitter
|
|
80
|
+
Object.setPrototypeOf(this, events_1.EventEmitter.prototype);
|
|
81
|
+
// Conexión directa
|
|
82
|
+
this.connect().catch(console.error);
|
|
72
83
|
}
|
|
73
84
|
get apiPrefix() {
|
|
74
85
|
const networkStr = this._network.name === scryptlib.bsv.Networks.mainnet.name ? 'main' : 'test';
|