Skip to content

Commit

Permalink
v13.7.0: upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNe0x1 committed Feb 9, 2024
1 parent 3a6a7ae commit 7aa697f
Show file tree
Hide file tree
Showing 10 changed files with 17,507 additions and 7,951 deletions.
12,502 changes: 8,624 additions & 3,878 deletions dist/esm/index.evm.js

Large diffs are not rendered by default.

77 changes: 45 additions & 32 deletions dist/esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ const getConfiguration = () =>{
return getWindow()._Web3ClientConfiguration
};

function _optionalChain$3(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
const BATCH_INTERVAL$1 = 10;
const CHUNK_SIZE$1 = 99;

Expand All @@ -151,37 +152,46 @@ class StaticJsonRpcBatchProvider extends ethers.providers.JsonRpcProvider {
}

requestChunk(chunk, endpoint) {

const request = chunk.map((inflight) => inflight.request);

return ethers.utils.fetchJson(endpoint, JSON.stringify(request))
.then((result) => {
// For each result, feed it to the correct Promise, depending
// on whether it was a success or error
chunk.forEach((inflightRequest, index) => {
const payload = result[index];
if (payload.error) {
const error = new Error(payload.error.message);
error.code = payload.error.code;
error.data = payload.error.data;
inflightRequest.reject(error);
}
else {
inflightRequest.resolve(payload.result);
}
});
}).catch((error) => {
if(error && error.code == 'SERVER_ERROR') {
const index = this._endpoints.indexOf(this._endpoint)+1;
this._failover();
this._endpoint = index >= this._endpoints.length ? this._endpoints[0] : this._endpoints[index];
this.requestChunk(chunk, this._endpoint);
} else {
chunk.forEach((inflightRequest) => {
inflightRequest.reject(error);

try {

const request = chunk.map((inflight) => inflight.request);
return ethers.utils.fetchJson(endpoint, JSON.stringify(request))
.then((result) => {
// For each result, feed it to the correct Promise, depending
// on whether it was a success or error
chunk.forEach((inflightRequest, index) => {
const payload = result[index];
if (_optionalChain$3([payload, 'optionalAccess', _ => _.error])) {
const error = new Error(payload.error.message);
error.code = payload.error.code;
error.data = payload.error.data;
inflightRequest.reject(error);
} else if(_optionalChain$3([payload, 'optionalAccess', _2 => _2.result])) {
inflightRequest.resolve(payload.result);
} else {
inflightRequest.reject();
}
});
}
})
}).catch((error) => {
if(error && error.code == 'SERVER_ERROR') {
const index = this._endpoints.indexOf(this._endpoint)+1;
this._failover();
this._endpoint = index >= this._endpoints.length ? this._endpoints[0] : this._endpoints[index];
this.requestChunk(chunk, this._endpoint);
} else {
chunk.forEach((inflightRequest) => {
inflightRequest.reject(error);
});
}
})

} catch (e) {

chunk.forEach((inflightRequest) => {
inflightRequest.reject();
});
}
}

send(method, params) {
Expand Down Expand Up @@ -340,6 +350,7 @@ var EVM = {
setProvider: setProvider$2,
};

function _optionalChain$2(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
const BATCH_INTERVAL = 10;
const CHUNK_SIZE = 99;

Expand Down Expand Up @@ -382,13 +393,15 @@ class StaticJsonRpcSequentialProvider extends Connection {
// on whether it was a success or error
chunk.forEach((inflightRequest, index) => {
const payload = result[index];
if (payload.error) {
if (_optionalChain$2([payload, 'optionalAccess', _ => _.error])) {
const error = new Error(payload.error.message);
error.code = payload.error.code;
error.data = payload.error.data;
inflightRequest.reject(error);
} else {
} else if(payload) {
inflightRequest.resolve(payload);
} else {
inflightRequest.reject();
}
});
}).catch(handleError)
Expand Down
77 changes: 45 additions & 32 deletions dist/esm/index.solana.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ const getConfiguration = () =>{
return getWindow()._Web3ClientConfiguration
};

function _optionalChain$3$1(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
const BATCH_INTERVAL$1 = 10;
const CHUNK_SIZE$1 = 99;

Expand All @@ -151,37 +152,46 @@ class StaticJsonRpcBatchProvider extends ethers.providers.JsonRpcProvider {
}

requestChunk(chunk, endpoint) {

const request = chunk.map((inflight) => inflight.request);

return ethers.utils.fetchJson(endpoint, JSON.stringify(request))
.then((result) => {
// For each result, feed it to the correct Promise, depending
// on whether it was a success or error
chunk.forEach((inflightRequest, index) => {
const payload = result[index];
if (payload.error) {
const error = new Error(payload.error.message);
error.code = payload.error.code;
error.data = payload.error.data;
inflightRequest.reject(error);
}
else {
inflightRequest.resolve(payload.result);
}
});
}).catch((error) => {
if(error && error.code == 'SERVER_ERROR') {
const index = this._endpoints.indexOf(this._endpoint)+1;
this._failover();
this._endpoint = index >= this._endpoints.length ? this._endpoints[0] : this._endpoints[index];
this.requestChunk(chunk, this._endpoint);
} else {
chunk.forEach((inflightRequest) => {
inflightRequest.reject(error);

try {

const request = chunk.map((inflight) => inflight.request);
return ethers.utils.fetchJson(endpoint, JSON.stringify(request))
.then((result) => {
// For each result, feed it to the correct Promise, depending
// on whether it was a success or error
chunk.forEach((inflightRequest, index) => {
const payload = result[index];
if (_optionalChain$3$1([payload, 'optionalAccess', _ => _.error])) {
const error = new Error(payload.error.message);
error.code = payload.error.code;
error.data = payload.error.data;
inflightRequest.reject(error);
} else if(_optionalChain$3$1([payload, 'optionalAccess', _2 => _2.result])) {
inflightRequest.resolve(payload.result);
} else {
inflightRequest.reject();
}
});
}
})
}).catch((error) => {
if(error && error.code == 'SERVER_ERROR') {
const index = this._endpoints.indexOf(this._endpoint)+1;
this._failover();
this._endpoint = index >= this._endpoints.length ? this._endpoints[0] : this._endpoints[index];
this.requestChunk(chunk, this._endpoint);
} else {
chunk.forEach((inflightRequest) => {
inflightRequest.reject(error);
});
}
})

} catch (e) {

chunk.forEach((inflightRequest) => {
inflightRequest.reject();
});
}
}

send(method, params) {
Expand Down Expand Up @@ -340,6 +350,7 @@ var EVM = {
setProvider: setProvider$2,
};

function _optionalChain$2$1(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
const BATCH_INTERVAL = 10;
const CHUNK_SIZE = 99;

Expand Down Expand Up @@ -382,13 +393,15 @@ class StaticJsonRpcSequentialProvider extends Connection {
// on whether it was a success or error
chunk.forEach((inflightRequest, index) => {
const payload = result[index];
if (payload.error) {
if (_optionalChain$2$1([payload, 'optionalAccess', _ => _.error])) {
const error = new Error(payload.error.message);
error.code = payload.error.code;
error.data = payload.error.data;
inflightRequest.reject(error);
} else {
} else if(payload) {
inflightRequest.resolve(payload);
} else {
inflightRequest.reject();
}
});
}).catch(handleError)
Expand Down
Loading

0 comments on commit 7aa697f

Please sign in to comment.