From 6ce7997aa6d906a2b512b02bf32e1677996264f0 Mon Sep 17 00:00:00 2001 From: PeterYinusa Date: Wed, 11 Dec 2024 20:25:18 +0000 Subject: [PATCH] feat: add headless wallet port configuration --- package.json | 2 +- src/session/dapp-driver.ts | 2 +- src/types/index.ts | 1 + yarn.lock | 8 ++++---- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 5081bee..c26d6a4 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "author": "Assert Equals Ltd", "license": "MIT", "dependencies": { - "@assert-equals/headless-wallet": "^0.0.9", + "@assert-equals/headless-wallet": "^0.0.11", "adm-zip": "^0.5.16", "axios": "^1.7.7", "chalk": "^4.1.2", diff --git a/src/session/dapp-driver.ts b/src/session/dapp-driver.ts index 1b04f5a..177fd38 100644 --- a/src/session/dapp-driver.ts +++ b/src/session/dapp-driver.ts @@ -268,7 +268,7 @@ export class DappDriver { DappDriver.Instance.Wallet = HEADLESS; if (DappDriver.Instance.Framework === PLAYWRIGHT) { const page = DappDriver.Instance.Page as Page; - await installHeadlessWallet({ page }); + await installHeadlessWallet({ page, port: options.extension.port }); } else if (DappDriver.Instance.Framework === WEBDRIVER) { const driver = DappDriver.Instance.Driver as WebDriver; await installHeadlessWallet({ driver }); diff --git a/src/types/index.ts b/src/types/index.ts index 5357d9a..027bf55 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -27,6 +27,7 @@ export type WalletOptions = { wallet: Wallet; path?: string; seed?: string; + port?: number; }; export type BrowserOptions = { diff --git a/yarn.lock b/yarn.lock index 51aca46..1a2f9c3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16,10 +16,10 @@ css-tree "^2.3.1" is-potential-custom-element-name "^1.0.1" -"@assert-equals/headless-wallet@^0.0.9": - version "0.0.9" - resolved "https://registry.yarnpkg.com/@assert-equals/headless-wallet/-/headless-wallet-0.0.9.tgz#d6d29506261f9bd225f522789a22b5216a32e5ad" - integrity sha512-3xCiNDYkJorihnFP2IE59NgL61gkXgNC9CEt7yG3kaKVAy3v23Fdv9gfdtK20oVAuJXoKOTg1uPy8Xxk5bgyrQ== +"@assert-equals/headless-wallet@^0.0.11": + version "0.0.11" + resolved "https://registry.yarnpkg.com/@assert-equals/headless-wallet/-/headless-wallet-0.0.11.tgz#97504f566ddba6a9b596d6938a0c2d5bd172b67d" + integrity sha512-L2ZpBdQqzyjnkaoKGNN2KBVLCuvyPEchVU7sCnjUxGOmiCAV9NFk/eIJ+vnlBhpkAXLW7e6HxM2U5OudCAMlrw== "@babel/code-frame@^7.0.0": version "7.24.2"