Allow passing JsonRpcApiProviderOptions to BrowserProvider
This commit is contained in:
parent
ad5f1c5fc7
commit
ec36bfb799
4
dist/ethers.js
vendored
4
dist/ethers.js
vendored
@ -22943,9 +22943,9 @@ class BrowserProvider extends JsonRpcApiPollingProvider {
|
||||
* Connnect to the %%ethereum%% provider, optionally forcing the
|
||||
* %%network%%.
|
||||
*/
|
||||
constructor(ethereum, network) {
|
||||
constructor(ethereum, network, options) {
|
||||
assertArgument(ethereum && ethereum.request, "invalid EIP-1193 provider", "ethereum", ethereum);
|
||||
super(network, { batchMaxCount: 1 });
|
||||
super(network, { batchMaxCount: 1, ...options });
|
||||
this.#request = async (method, params) => {
|
||||
const payload = { method, params };
|
||||
this.emit("debug", { action: "sendEip1193Request", payload });
|
||||
|
2
dist/ethers.js.map
vendored
2
dist/ethers.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/ethers.min.js
vendored
2
dist/ethers.min.js
vendored
File diff suppressed because one or more lines are too long
4
dist/ethers.umd.js
vendored
4
dist/ethers.umd.js
vendored
@ -22949,9 +22949,9 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
|
||||
* Connnect to the %%ethereum%% provider, optionally forcing the
|
||||
* %%network%%.
|
||||
*/
|
||||
constructor(ethereum, network) {
|
||||
constructor(ethereum, network, options) {
|
||||
assertArgument(ethereum && ethereum.request, "invalid EIP-1193 provider", "ethereum", ethereum);
|
||||
super(network, { batchMaxCount: 1 });
|
||||
super(network, { batchMaxCount: 1, ...options });
|
||||
this.#request = async (method, params) => {
|
||||
const payload = { method, params };
|
||||
this.emit("debug", { action: "sendEip1193Request", payload });
|
||||
|
2
dist/ethers.umd.js.map
vendored
2
dist/ethers.umd.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/ethers.umd.min.js
vendored
2
dist/ethers.umd.min.js
vendored
File diff suppressed because one or more lines are too long
4
lib.commonjs/providers/provider-browser.d.ts
vendored
4
lib.commonjs/providers/provider-browser.d.ts
vendored
@ -1,5 +1,5 @@
|
||||
import { JsonRpcApiPollingProvider } from "./provider-jsonrpc.js";
|
||||
import type { JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcSigner } from "./provider-jsonrpc.js";
|
||||
import type { JsonRpcApiProviderOptions, JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcSigner } from "./provider-jsonrpc.js";
|
||||
import type { Networkish } from "./network.js";
|
||||
/**
|
||||
* The interface to an [[link-eip-1193]] provider, which is a standard
|
||||
@ -43,7 +43,7 @@ export declare class BrowserProvider extends JsonRpcApiPollingProvider {
|
||||
* Connnect to the %%ethereum%% provider, optionally forcing the
|
||||
* %%network%%.
|
||||
*/
|
||||
constructor(ethereum: Eip1193Provider, network?: Networkish);
|
||||
constructor(ethereum: Eip1193Provider, network?: Networkish, options?: JsonRpcApiProviderOptions);
|
||||
send(method: string, params: Array<any> | Record<string, any>): Promise<any>;
|
||||
_send(payload: JsonRpcPayload | Array<JsonRpcPayload>): Promise<Array<JsonRpcResult | JsonRpcError>>;
|
||||
getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-browser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EACR,YAAY,EAAE,cAAc,EAAE,aAAa,EAC3C,aAAa,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC5B;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CACj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AAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAYrD,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAiBrE"}
|
@ -15,9 +15,9 @@ class BrowserProvider extends provider_jsonrpc_js_1.JsonRpcApiPollingProvider {
|
||||
* Connnect to the %%ethereum%% provider, optionally forcing the
|
||||
* %%network%%.
|
||||
*/
|
||||
constructor(ethereum, network) {
|
||||
constructor(ethereum, network, options) {
|
||||
(0, index_js_1.assertArgument)(ethereum && ethereum.request, "invalid EIP-1193 provider", "ethereum", ethereum);
|
||||
super(network, { batchMaxCount: 1 });
|
||||
super(network, { batchMaxCount: 1, ...options });
|
||||
this.#request = async (method, params) => {
|
||||
const payload = { method, params };
|
||||
this.emit("debug", { action: "sendEip1193Request", payload });
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-browser.js","sourceRoot":"","sources":["../../src.ts/providers/provider-browser.ts"],"names":[],"mappings":";;;AAAA,gDAAmD;AAEnD,+DAAkE;AAkBjE,CAAC;AAkBF;;;;GAIG;AACH,MAAa,eAAgB,SAAQ,+CAAyB;IAC1D,QAAQ,CAA6E;IAErF;;;OAGG;IACH,YAAY,QAAyB,EAAE,OAAoB;QACvD,IAAA,yBAAc,EAAC,QAAQ,IAAI,QAAQ,CAAC,OAAO,EAAE,2BAA2B,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QAEhG,KAAK,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;QAErC,IAAI,CAAC,QAAQ,GAAG,KAAK,EAAE,MAAc,EAAE,MAAwC,EAAE,EAAE;YAC/E,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC,CAAC;YAC9D,IAAI;g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C,WAAW,EAAE,CAAC;QAChC,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;IACtF,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,OAAyB;QACrC,IAAI,OAAO,IAAI,IAAI,EAAE;YAAE,OAAO,GAAG,CAAC,CAAC;SAAE;QAErC,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE;YAClC,IAAI;gBACA,eAAe;gBACf,MAAM,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,EAAG,CAAC,CAAC;gBAChD,4BAA4B;aAE/B;YAAC,OAAO,KAAU,EAAE;gBACjB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;gBAC9B,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;aAC9D;SACJ;QAED,OAAO,MAAM,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;CACJ;AApGD,0CAoGC"}
|
4
lib.esm/providers/provider-browser.d.ts
vendored
4
lib.esm/providers/provider-browser.d.ts
vendored
@ -1,5 +1,5 @@
|
||||
import { JsonRpcApiPollingProvider } from "./provider-jsonrpc.js";
|
||||
import type { JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcSigner } from "./provider-jsonrpc.js";
|
||||
import type { JsonRpcApiProviderOptions, JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcSigner } from "./provider-jsonrpc.js";
|
||||
import type { Networkish } from "./network.js";
|
||||
/**
|
||||
* The interface to an [[link-eip-1193]] provider, which is a standard
|
||||
@ -43,7 +43,7 @@ export declare class BrowserProvider extends JsonRpcApiPollingProvider {
|
||||
* Connnect to the %%ethereum%% provider, optionally forcing the
|
||||
* %%network%%.
|
||||
*/
|
||||
constructor(ethereum: Eip1193Provider, network?: Networkish);
|
||||
constructor(ethereum: Eip1193Provider, network?: Networkish, options?: JsonRpcApiProviderOptions);
|
||||
send(method: string, params: Array<any> | Record<string, any>): Promise<any>;
|
||||
_send(payload: JsonRpcPayload | Array<JsonRpcPayload>): Promise<Array<JsonRpcResult | JsonRpcError>>;
|
||||
getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-browser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EACR,YAAY,EAAE,cAAc,EAAE,aAAa,EAC3C,aAAa,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC5B;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CACjG;AAED;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACpC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;KAAE,CAAA;CAClD,GAAG;IACA,MAAM,EAAE,sBAAsB,CAAC;IAC/B,MAAM,EAAE,GAAG,CAAA;CACd,GAAG;IACA,MAAM,EAAE,qBAAqB,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAA;CACf,CAAC;AAGF;;;;GAIG;AACH,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yBAAyB,GAAG;IACpC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;KAAE,CAAA;CAClD,GAAG;IACA,MAAM,EAAE,sBAAsB,CAAC;IAC/B,MAAM,EAAE,GAAG,CAAA;CACd,GAAG;IACA,MAAM,EAAE,qBAAqB,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAA;CACf,CAAC;AAGF;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,yBAAyB;;IAG1D;;;OAGG;gBACS,QAAQ,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,yBAAyB;IAuB1F,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAM5E,KAAK,CAAC,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC;IAc1G,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK;IAkBhE;;OAEG;IACG,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAYrD,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAiBrE"}
|
@ -12,9 +12,9 @@ export class BrowserProvider extends JsonRpcApiPollingProvider {
|
||||
* Connnect to the %%ethereum%% provider, optionally forcing the
|
||||
* %%network%%.
|
||||
*/
|
||||
constructor(ethereum, network) {
|
||||
constructor(ethereum, network, options) {
|
||||
assertArgument(ethereum && ethereum.request, "invalid EIP-1193 provider", "ethereum", ethereum);
|
||||
super(network, { batchMaxCount: 1 });
|
||||
super(network, { batchMaxCount: 1, ...options });
|
||||
this.#request = async (method, params) => {
|
||||
const payload = { method, params };
|
||||
this.emit("debug", { action: "sendEip1193Request", payload });
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-browser.js","sourceRoot":"","sources":["../../src.ts/providers/provider-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAkBjE,CAAC;AAkBF;;;;GAIG;AACH,MAAM,OAAO,eAAgB,SAAQ,yBAAyB;IAC1D,QAAQ,CAA6E;IAErF;;;OAGG;IACH,YAAY,QAAyB,EAAE,OAAoB;QACvD,cAAc,CAAC,QAAQ,IAAI,QAAQ,CAAC,OAAO,EAAE,2BAA2B,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QAEhG,KAAK,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;QAErC,IAAI,CAAC,QAAQ,GAAG,KAAK,EAAE,MAAc,EAAE,MAAwC,EAAE,EAAE;YAC/E,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC,CAAC;YAC9D,IAAI;gBACA,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC/C,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,EAAE,CAAC,CAAC;gBAC/D,OAAO,MAAM,CAAC;aACjB;YAAC,OAAO,CAAM,EAAE;gBACb,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;gBAC7B,KAAM,CAAC,IA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AC;SAAE;QAErC,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE;YAClC,IAAI;gBACA,eAAe;gBACf,MAAM,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,EAAG,CAAC,CAAC;gBAChD,4BAA4B;aAE/B;YAAC,OAAO,KAAU,EAAE;gBACjB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;gBAC9B,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;aAC9D;SACJ;QAED,OAAO,MAAM,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;CACJ"}
|
@ -3,6 +3,7 @@ import { assertArgument } from "../utils/index.js";
|
||||
import { JsonRpcApiPollingProvider } from "./provider-jsonrpc.js";
|
||||
|
||||
import type {
|
||||
JsonRpcApiProviderOptions,
|
||||
JsonRpcError, JsonRpcPayload, JsonRpcResult,
|
||||
JsonRpcSigner
|
||||
} from "./provider-jsonrpc.js";
|
||||
@ -48,10 +49,10 @@ export class BrowserProvider extends JsonRpcApiPollingProvider {
|
||||
* Connnect to the %%ethereum%% provider, optionally forcing the
|
||||
* %%network%%.
|
||||
*/
|
||||
constructor(ethereum: Eip1193Provider, network?: Networkish) {
|
||||
constructor(ethereum: Eip1193Provider, network?: Networkish, options?: JsonRpcApiProviderOptions) {
|
||||
assertArgument(ethereum && ethereum.request, "invalid EIP-1193 provider", "ethereum", ethereum);
|
||||
|
||||
super(network, { batchMaxCount: 1 });
|
||||
super(network, { batchMaxCount: 1, ...options });
|
||||
|
||||
this.#request = async (method: string, params: Array<any> | Record<string, any>) => {
|
||||
const payload = { method, params };
|
||||
|
Loading…
Reference in New Issue
Block a user