http sync api
This commit is contained in:
@ -56,21 +56,17 @@ var ProviderManager = function() {
|
||||
};
|
||||
|
||||
/// sends outgoing requests, if provider is not available, enqueue the request
|
||||
ProviderManager.prototype.send = function(data, cb) {
|
||||
ProviderManager.prototype.send = function(data) {
|
||||
data._id = this.id;
|
||||
if (cb) {
|
||||
web3._callbacks[data._id] = cb;
|
||||
}
|
||||
|
||||
data.args = data.args || [];
|
||||
this.id++;
|
||||
|
||||
if(this.provider !== undefined) {
|
||||
this.provider.send(data);
|
||||
} else {
|
||||
console.warn("provider is not set");
|
||||
this.queued.push(data);
|
||||
if (this.provider === undefined) {
|
||||
console.error("provider is not set");
|
||||
}
|
||||
|
||||
return this.provider.send(data);
|
||||
};
|
||||
|
||||
/// setups provider, which will be used for sending messages
|
||||
|
Reference in New Issue
Block a user