w3wallets 0.4.2 → 0.5.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/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +16 -13
- package/dist/index.mjs +16 -13
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -67,7 +67,8 @@ declare class Metamask extends Wallet {
|
|
|
67
67
|
* @param mnemonic 12-word mnemonic seed phrase
|
|
68
68
|
*/
|
|
69
69
|
onboard(mnemonic: string, password?: string): Promise<void>;
|
|
70
|
-
connectToNetwork(
|
|
70
|
+
connectToNetwork(networkName: string): Promise<void>;
|
|
71
|
+
connectToNetwork(settings: NetworkSettings): Promise<void>;
|
|
71
72
|
approve(): Promise<void>;
|
|
72
73
|
deny(): Promise<void>;
|
|
73
74
|
private usingNotificationPage;
|
package/dist/index.d.ts
CHANGED
|
@@ -67,7 +67,8 @@ declare class Metamask extends Wallet {
|
|
|
67
67
|
* @param mnemonic 12-word mnemonic seed phrase
|
|
68
68
|
*/
|
|
69
69
|
onboard(mnemonic: string, password?: string): Promise<void>;
|
|
70
|
-
connectToNetwork(
|
|
70
|
+
connectToNetwork(networkName: string): Promise<void>;
|
|
71
|
+
connectToNetwork(settings: NetworkSettings): Promise<void>;
|
|
71
72
|
approve(): Promise<void>;
|
|
72
73
|
deny(): Promise<void>;
|
|
73
74
|
private usingNotificationPage;
|
package/dist/index.js
CHANGED
|
@@ -222,21 +222,24 @@ var Metamask = class extends Wallet {
|
|
|
222
222
|
await this.page.getByTestId("pin-extension-next").click();
|
|
223
223
|
await this.page.getByTestId("pin-extension-done").click();
|
|
224
224
|
}
|
|
225
|
-
async connectToNetwork(
|
|
226
|
-
|
|
227
|
-
await this.page.getByRole("button", { name: "Add a custom network" }).click();
|
|
228
|
-
await this.page.getByTestId("network-form-network-name").fill(settings.name);
|
|
229
|
-
await this.page.getByTestId("network-form-chain-id").fill(settings.chainId.toString());
|
|
230
|
-
await this.page.getByTestId("network-form-ticker-input").fill(settings.currencySymbol);
|
|
231
|
-
await this.page.getByTestId("test-add-rpc-drop-down").click();
|
|
232
|
-
await this.page.getByRole("button", { name: "Add RPC URL" }).click();
|
|
233
|
-
await this.page.getByTestId("rpc-url-input-test").fill(settings.rpc);
|
|
234
|
-
await this.page.getByRole("button", { name: "Add URL" }).click();
|
|
235
|
-
await this.page.getByRole("button", { name: "Save" }).click();
|
|
236
|
-
if (switchNetwork) {
|
|
225
|
+
async connectToNetwork(settingsOrName) {
|
|
226
|
+
if (typeof settingsOrName !== "string") {
|
|
237
227
|
await this.page.locator(".mm-picker-network").click();
|
|
238
|
-
await this.page.
|
|
228
|
+
await this.page.getByRole("button", { name: "Add a custom network" }).click();
|
|
229
|
+
await this.page.getByTestId("network-form-network-name").fill(settingsOrName.name);
|
|
230
|
+
await this.page.getByTestId("network-form-chain-id").fill(settingsOrName.chainId.toString());
|
|
231
|
+
await this.page.getByTestId("network-form-ticker-input").fill(settingsOrName.currencySymbol);
|
|
232
|
+
await this.page.getByTestId("test-add-rpc-drop-down").click();
|
|
233
|
+
await this.page.getByRole("button", { name: "Add RPC URL" }).click();
|
|
234
|
+
await this.page.getByTestId("rpc-url-input-test").fill(settingsOrName.rpc);
|
|
235
|
+
await this.page.getByRole("button", { name: "Add URL" }).click();
|
|
236
|
+
await this.page.getByRole("button", { name: "Save" }).click();
|
|
239
237
|
}
|
|
238
|
+
await this.page.locator(".mm-picker-network").click();
|
|
239
|
+
await this.page.locator("text=Show test networks >> xpath=following-sibling::label").click();
|
|
240
|
+
await this.page.getByTestId(
|
|
241
|
+
typeof settingsOrName === "string" ? settingsOrName : settingsOrName.name
|
|
242
|
+
).click();
|
|
240
243
|
}
|
|
241
244
|
// async approve() {
|
|
242
245
|
// return this.usingNotificationPage((p) =>
|
package/dist/index.mjs
CHANGED
|
@@ -188,21 +188,24 @@ var Metamask = class extends Wallet {
|
|
|
188
188
|
await this.page.getByTestId("pin-extension-next").click();
|
|
189
189
|
await this.page.getByTestId("pin-extension-done").click();
|
|
190
190
|
}
|
|
191
|
-
async connectToNetwork(
|
|
192
|
-
|
|
193
|
-
await this.page.getByRole("button", { name: "Add a custom network" }).click();
|
|
194
|
-
await this.page.getByTestId("network-form-network-name").fill(settings.name);
|
|
195
|
-
await this.page.getByTestId("network-form-chain-id").fill(settings.chainId.toString());
|
|
196
|
-
await this.page.getByTestId("network-form-ticker-input").fill(settings.currencySymbol);
|
|
197
|
-
await this.page.getByTestId("test-add-rpc-drop-down").click();
|
|
198
|
-
await this.page.getByRole("button", { name: "Add RPC URL" }).click();
|
|
199
|
-
await this.page.getByTestId("rpc-url-input-test").fill(settings.rpc);
|
|
200
|
-
await this.page.getByRole("button", { name: "Add URL" }).click();
|
|
201
|
-
await this.page.getByRole("button", { name: "Save" }).click();
|
|
202
|
-
if (switchNetwork) {
|
|
191
|
+
async connectToNetwork(settingsOrName) {
|
|
192
|
+
if (typeof settingsOrName !== "string") {
|
|
203
193
|
await this.page.locator(".mm-picker-network").click();
|
|
204
|
-
await this.page.
|
|
194
|
+
await this.page.getByRole("button", { name: "Add a custom network" }).click();
|
|
195
|
+
await this.page.getByTestId("network-form-network-name").fill(settingsOrName.name);
|
|
196
|
+
await this.page.getByTestId("network-form-chain-id").fill(settingsOrName.chainId.toString());
|
|
197
|
+
await this.page.getByTestId("network-form-ticker-input").fill(settingsOrName.currencySymbol);
|
|
198
|
+
await this.page.getByTestId("test-add-rpc-drop-down").click();
|
|
199
|
+
await this.page.getByRole("button", { name: "Add RPC URL" }).click();
|
|
200
|
+
await this.page.getByTestId("rpc-url-input-test").fill(settingsOrName.rpc);
|
|
201
|
+
await this.page.getByRole("button", { name: "Add URL" }).click();
|
|
202
|
+
await this.page.getByRole("button", { name: "Save" }).click();
|
|
205
203
|
}
|
|
204
|
+
await this.page.locator(".mm-picker-network").click();
|
|
205
|
+
await this.page.locator("text=Show test networks >> xpath=following-sibling::label").click();
|
|
206
|
+
await this.page.getByTestId(
|
|
207
|
+
typeof settingsOrName === "string" ? settingsOrName : settingsOrName.name
|
|
208
|
+
).click();
|
|
206
209
|
}
|
|
207
210
|
// async approve() {
|
|
208
211
|
// return this.usingNotificationPage((p) =>
|