Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: eip-6963 support #689

Merged
merged 49 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
81aaadc
feat: bloodbath
gomesalexandre Oct 3, 2024
356cefb
feat: add todo
gomesalexandre Oct 3, 2024
1524b56
feat: more bloodbath
gomesalexandre Oct 3, 2024
590cc73
feat: and more
gomesalexandre Oct 3, 2024
e883551
[skip ci] feat: the bloodbath continues
gomesalexandre Oct 3, 2024
d48968d
feat: more cleanup
gomesalexandre Oct 3, 2024
c6e9944
feat: and more
gomesalexandre Oct 3, 2024
76ba4ad
feat: install
gomesalexandre Oct 3, 2024
42e4694
chore: trigger CI
gomesalexandre Oct 3, 2024
2b558bb
feat: install from upstream npm vs. verdaccio
gomesalexandre Oct 3, 2024
d2cb6e8
chore: trigger CI
gomesalexandre Oct 3, 2024
ba374d7
feat: yarn pls
gomesalexandre Oct 3, 2024
c94b3a2
fix: package naming was poop, tests were sad
gomesalexandre Oct 3, 2024
fbbcf70
feat: bump locally
gomesalexandre Oct 3, 2024
e5137c6
chore(release): publish 1.55.10
gomesalexandre Oct 3, 2024
2729762
feat: unnuke cache
gomesalexandre Oct 3, 2024
a9fa9f5
feat: rename class
gomesalexandre Oct 4, 2024
64ddd3b
feat: install upstream
gomesalexandre Oct 4, 2024
4fc209c
chore(release): publish 1.55.10
gomesalexandre Oct 4, 2024
53886b5
feat: add providerRdns
gomesalexandre Oct 7, 2024
530761d
fix: tests
gomesalexandre Oct 7, 2024
e93893a
fix: lint
gomesalexandre Oct 7, 2024
e4360ef
chore: trigger CI
gomesalexandre Oct 7, 2024
59c7ae2
fix: integration tests, revert ts-ignore in follow-up
gomesalexandre Oct 7, 2024
0336736
feat: ts-expect-error
gomesalexandre Oct 7, 2024
c1ca591
feat: rm cache nuke
gomesalexandre Oct 7, 2024
9aeb794
feat: install upstream
gomesalexandre Oct 7, 2024
e8d0d10
feat: cleanup
gomesalexandre Oct 7, 2024
3c524b8
feat: bring back onboarding
gomesalexandre Oct 7, 2024
c564cae
fix: yarn.lock
gomesalexandre Oct 7, 2024
df02ebb
feat: consistently describe eth path with conventional "Ethereum"
gomesalexandre Oct 7, 2024
de2247e
feat: bump sandbox packages to latest
gomesalexandre Oct 7, 2024
e0e8f4e
feat: more cleanup
gomesalexandre Oct 7, 2024
1b4ad64
feat: throw on generic rdns no provider found
gomesalexandre Oct 8, 2024
c9923c7
feat: more cleanup
gomesalexandre Oct 8, 2024
abd4383
feat: bump snap packages
gomesalexandre Oct 8, 2024
fe95c82
feat: sandbox use 1.55.10 for hdwallet-metamask-multichain
gomesalexandre Oct 8, 2024
841de8c
feat: bring back hdwallet-coinbase
gomesalexandre Oct 9, 2024
93ca994
fix: ci
gomesalexandre Oct 9, 2024
b66188a
fix: regen yarn.lock
gomesalexandre Oct 9, 2024
6882c64
chore: trigger CI
gomesalexandre Oct 9, 2024
644b281
chore: trigger CI (maybe? pls?)
gomesalexandre Oct 9, 2024
efa6d0d
Merge remote-tracking branch 'origin/master' into mipd
gomesalexandre Oct 9, 2024
05e6692
chore(release): publish 1.55.11
gomesalexandre Oct 9, 2024
c36c984
chore: trigger CI (maybe? pls? ser?)
gomesalexandre Oct 9, 2024
561ce08
attempt fix ci build
kaladinlight Oct 9, 2024
15ba92a
fix test
kaladinlight Oct 9, 2024
85f8039
fix: use providerRdns as deviceId
gomesalexandre Oct 15, 2024
d6b6c96
fix: correct deviceId
gomesalexandre Oct 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions examples/sandbox/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ <h4>Select</h4>
<button id="native">Pair Native</button>
<button id="metaMask">Pair MetaMask</button>
<button id="phantom">Pair Phantom</button>
<button id="xdefi">Pair XDEFI</button>
<button id="keplr">Pair Keplr</button>
<button id="tallyHo">Pair Tally Ho</button>
<button id="coinbase">Pair Coinbase</button>
kaladinlight marked this conversation as resolved.
Show resolved Hide resolved
<button id="walletConnect">Pair WalletConnect</button>
<button id="walletConnectV2">Pair WalletConnect V2</button>

Expand Down
73 changes: 2 additions & 71 deletions examples/sandbox/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import * as sigUtil from "@metamask/eth-sig-util";
import * as coinbase from "@shapeshiftoss/hdwallet-coinbase";
import { CoinbaseProviderConfig } from "@shapeshiftoss/hdwallet-coinbase";
import * as core from "@shapeshiftoss/hdwallet-core";
import { BTCSignTxInput, BTCSignTxOutput, EosTx, Thorchain } from "@shapeshiftoss/hdwallet-core";
import * as keepkey from "@shapeshiftoss/hdwallet-keepkey";
Expand All @@ -9,16 +7,14 @@ import * as keepkeyWebUSB from "@shapeshiftoss/hdwallet-keepkey-webusb";
import * as keplr from "@shapeshiftoss/hdwallet-keplr";
import * as ledgerWebHID from "@shapeshiftoss/hdwallet-ledger-webhid";
import * as ledgerWebUSB from "@shapeshiftoss/hdwallet-ledger-webusb";
import * as metaMask from "@shapeshiftoss/hdwallet-metamask";
kaladinlight marked this conversation as resolved.
Show resolved Hide resolved
import * as metaMask from "@shapeshiftoss/hdwallet-metamask-multichain";
import * as native from "@shapeshiftoss/hdwallet-native";
import * as phantom from "@shapeshiftoss/hdwallet-phantom";
import * as portis from "@shapeshiftoss/hdwallet-portis";
import * as tallyHo from "@shapeshiftoss/hdwallet-tallyho";
import * as trezorConnect from "@shapeshiftoss/hdwallet-trezor-connect";
import { WalletConnectProviderConfig } from "@shapeshiftoss/hdwallet-walletconnect";
import * as walletConnect from "@shapeshiftoss/hdwallet-walletconnect";
import * as walletConnectv2 from "@shapeshiftoss/hdwallet-walletconnectv2";
import * as xdefi from "@shapeshiftoss/hdwallet-xdefi";
import { EthereumProviderOptions } from "@walletconnect/ethereum-provider/dist/types/EthereumProvider";
import { TypedData } from "eip-712";
import $, { noop } from "jquery";
Expand Down Expand Up @@ -97,14 +93,6 @@ const walletConnectV2Options: EthereumProviderOptions = {
showQrModal: true,
};

const coinbaseOptions: CoinbaseProviderConfig = {
appName: "ShapeShift Sandbox",
appLogoUrl: "https://shapeshift.com/favicon.ico",
defaultJsonRpcUrl: "https://avatars.githubusercontent.com/u/52928763?s=50&v=4",
defaultChainId: 1,
darkMode: false,
};

const testPublicWalletXpubs = [
"xpub661MyMwAqRbcFLgDU7wpcEVubSF7NkswwmXBUkDiGUW6uopeUMys4AqKXNgpfZKRTLnpKQgffd6a2c3J8JxLkF1AQN17Pm9QYHEqEfo1Rsx", // all seed root key
"xpub68Zyu13qjcQxDzLNfTYnUXtJuX2qJgnxP6osrcAvJGdo6bs9M2Adt2BunbwiYrZS5qpA1QKoMf3uqS2NHpbyZp4KMJxDrL58NTyvHXBeAv6", // all seed m/44'
Expand All @@ -120,17 +108,14 @@ const testPublicWalletXpubs = [
"xpub6DDUPHpUo4pcy43iJeZjbSVWGav1SMMmuWdMHiGtkK8rhKmfbomtkwW6GKs1GGAKehT6QRocrmda3WWxXawpjmwaUHfFRXuKrXSapdckEYF", // all seed m/84'/0'/0'
].join(" ");

const coinbaseAdapter = coinbase.CoinbaseAdapter.useKeyring(keyring, coinbaseOptions);
const keepkeyAdapter = keepkeyWebUSB.WebUSBKeepKeyAdapter.useKeyring(keyring);
const kkbridgeAdapter = keepkeyTcp.TCPKeepKeyAdapter.useKeyring(keyring);
const kkemuAdapter = keepkeyTcp.TCPKeepKeyAdapter.useKeyring(keyring);
const portisAdapter = portis.PortisAdapter.useKeyring(keyring, { portisAppId });
const metaMaskAdapter = metaMask.MetaMaskAdapter.useKeyring(keyring);
const metaMaskAdapter = metaMask.MetaMaskAdapter.useKeyring(keyring, "io.metamask");
const phantomAdapter = phantom.PhantomAdapter.useKeyring(keyring);
const tallyHoAdapter = tallyHo.TallyHoAdapter.useKeyring(keyring);
const walletConnectAdapter = walletConnect.WalletConnectAdapter.useKeyring(keyring, walletConnectOptions);
const walletConnectV2Adapter = walletConnectv2.WalletConnectV2Adapter.useKeyring(keyring, walletConnectV2Options);
const xdefiAdapter = xdefi.XDEFIAdapter.useKeyring(keyring);
const keplrAdapter = keplr.KeplrAdapter.useKeyring(keyring);
const nativeAdapter = native.NativeAdapter.useKeyring(keyring);
const trezorAdapter = trezorConnect.TrezorAdapter.useKeyring(keyring, {
Expand Down Expand Up @@ -160,11 +145,8 @@ const $portis = $("#portis");
const $native = $("#native");
const $metaMask = $("#metaMask");
const $phantom = $("#phantom");
const $coinbase = $("#coinbase");
const $tallyHo = $("#tallyHo");
const $walletConnect = $("#walletConnect");
const $walletConnectV2 = $("#walletConnectV2");
const $xdefi = $("#xdefi");
const $keplr = $("#keplr");
const $keyring = $("#keyring");

Expand Down Expand Up @@ -257,19 +239,6 @@ $phantom.on("click", async (e) => {
}
});

$coinbase.on("click", async (e) => {
e.preventDefault();
wallet = await coinbaseAdapter.pairDevice();
window["wallet"] = wallet;
let deviceID = "nothing";
try {
deviceID = await wallet.getDeviceID();
$("#keyring select").val(deviceID);
} catch (error) {
console.error(error);
}
});

$keplr.on("click", async (e) => {
e.preventDefault();
wallet = await keplrAdapter.pairDevice();
Expand All @@ -283,19 +252,6 @@ $keplr.on("click", async (e) => {
}
});

$tallyHo.on("click", async (e) => {
e.preventDefault();
wallet = await tallyHoAdapter.pairDevice();
window["wallet"] = wallet;
let deviceID = "nothing";
try {
deviceID = await wallet.getDeviceID();
$("#keyring select").val(deviceID);
} catch (error) {
console.error(error);
}
});

$walletConnect.on("click", async (e) => {
e.preventDefault();
try {
Expand All @@ -322,19 +278,6 @@ $walletConnectV2.on("click", async (e) => {
}
});

$xdefi.on("click", async (e) => {
e.preventDefault();
wallet = await xdefiAdapter.pairDevice();
window["wallet"] = wallet;
let deviceID = "nothing";
try {
deviceID = await wallet.getDeviceID();
$("#keyring select").val(deviceID);
} catch (error) {
console.error(error);
}
});

async function deviceConnected(deviceId) {
wallet = keyring.get(deviceId);
if (!$keyring.find(`option[value="${deviceId}"]`).length) {
Expand Down Expand Up @@ -425,24 +368,12 @@ async function deviceConnected(deviceId) {
console.error("Could not initialize PhantomAdapter", e);
}

try {
await tallyHoAdapter.initialize();
} catch (e) {
console.error("Could not initialize TallyHoAdapter", e);
}

try {
await keplrAdapter.initialize();
} catch (e) {
console.error("Could not initialize KeplrAdapter", e);
}

try {
await coinbaseAdapter.initialize();
} catch (e) {
console.error("Could not initialize CoinbaseAdapter", e);
}

try {
await walletConnectAdapter.initialize();
} catch (e) {
Expand Down
37 changes: 17 additions & 20 deletions examples/sandbox/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/hdwallet-sandbox",
"version": "1.55.9",
"version": "1.55.10",
"license": "MIT",
"private": true,
"browserslist": "> 0.5%, last 2 versions, not dead",
Expand All @@ -12,25 +12,22 @@
"dependencies": {
"@esm2cjs/p-queue": "^7.3.0",
"@metamask/eth-sig-util": "^7.0.0",
"@shapeshiftoss/hdwallet-coinbase": "1.55.9",
"@shapeshiftoss/hdwallet-core": "1.55.9",
"@shapeshiftoss/hdwallet-keepkey": "1.55.9",
"@shapeshiftoss/hdwallet-keepkey-tcp": "1.55.9",
"@shapeshiftoss/hdwallet-keepkey-webusb": "1.55.9",
"@shapeshiftoss/hdwallet-keplr": "1.55.9",
"@shapeshiftoss/hdwallet-ledger": "1.55.9",
"@shapeshiftoss/hdwallet-ledger-webhid": "1.55.9",
"@shapeshiftoss/hdwallet-ledger-webusb": "1.55.9",
"@shapeshiftoss/hdwallet-metamask": "1.55.9",
"@shapeshiftoss/hdwallet-native": "1.55.9",
"@shapeshiftoss/hdwallet-phantom": "1.55.9",
"@shapeshiftoss/hdwallet-portis": "1.55.9",
"@shapeshiftoss/hdwallet-tallyho": "1.55.9",
"@shapeshiftoss/hdwallet-trezor": "1.55.9",
"@shapeshiftoss/hdwallet-trezor-connect": "1.55.9",
"@shapeshiftoss/hdwallet-walletconnect": "1.55.9",
"@shapeshiftoss/hdwallet-walletconnectv2": "1.55.9",
"@shapeshiftoss/hdwallet-xdefi": "1.55.9",
"@shapeshiftoss/hdwallet-core": "1.55.10",
"@shapeshiftoss/hdwallet-keepkey": "1.55.10",
"@shapeshiftoss/hdwallet-keepkey-tcp": "1.55.10",
"@shapeshiftoss/hdwallet-keepkey-webusb": "1.55.10",
"@shapeshiftoss/hdwallet-keplr": "1.55.10",
"@shapeshiftoss/hdwallet-ledger": "1.55.10",
"@shapeshiftoss/hdwallet-ledger-webhid": "1.55.10",
"@shapeshiftoss/hdwallet-ledger-webusb": "1.55.10",
"@shapeshiftoss/hdwallet-metamask-multichain": "1.55.10-mipd.1",
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
"@shapeshiftoss/hdwallet-native": "1.55.10",
"@shapeshiftoss/hdwallet-phantom": "1.55.10",
"@shapeshiftoss/hdwallet-portis": "1.55.10",
"@shapeshiftoss/hdwallet-trezor": "1.55.10",
"@shapeshiftoss/hdwallet-trezor-connect": "1.55.10",
"@shapeshiftoss/hdwallet-walletconnect": "1.55.10",
"@shapeshiftoss/hdwallet-walletconnectv2": "1.55.10",
"bip32": "^2.0.4",
"eip-712": "^1.0.0",
"jquery": "^3.7.1",
Expand Down
20 changes: 10 additions & 10 deletions integration/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/integration",
"version": "1.55.9",
"version": "1.55.10",
"main": "index.js",
"license": "MIT",
"private": true,
Expand All @@ -10,15 +10,15 @@
"dev": "lerna run test --scope integration --parallel --include-filtered-dependencies"
},
"dependencies": {
"@shapeshiftoss/hdwallet-core": "1.55.9",
"@shapeshiftoss/hdwallet-keepkey": "1.55.9",
"@shapeshiftoss/hdwallet-keepkey-nodewebusb": "1.55.9",
"@shapeshiftoss/hdwallet-keepkey-tcp": "1.55.9",
"@shapeshiftoss/hdwallet-ledger": "1.55.9",
"@shapeshiftoss/hdwallet-native": "1.55.9",
"@shapeshiftoss/hdwallet-portis": "1.55.9",
"@shapeshiftoss/hdwallet-trezor": "1.55.9",
"@shapeshiftoss/hdwallet-xdefi": "1.55.9",
"@shapeshiftoss/hdwallet-core": "1.55.10",
"@shapeshiftoss/hdwallet-keepkey": "1.55.10",
"@shapeshiftoss/hdwallet-keepkey-nodewebusb": "1.55.10",
"@shapeshiftoss/hdwallet-keepkey-tcp": "1.55.10",
"@shapeshiftoss/hdwallet-ledger": "1.55.10",
"@shapeshiftoss/hdwallet-metamask-multichain": "1.55.10",
"@shapeshiftoss/hdwallet-native": "1.55.10",
"@shapeshiftoss/hdwallet-portis": "1.55.10",
"@shapeshiftoss/hdwallet-trezor": "1.55.10",
"fast-json-stable-stringify": "^2.1.0",
"msw": "^0.27.1",
"whatwg-fetch": "^3.6.2"
Expand Down
50 changes: 26 additions & 24 deletions integration/src/bitcoin/bitcoin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as core from "@shapeshiftoss/hdwallet-core";
import * as ledger from "@shapeshiftoss/hdwallet-ledger";
import * as metamask from "@shapeshiftoss/hdwallet-metamask-multichain";
import * as native from "@shapeshiftoss/hdwallet-native";
import * as portis from "@shapeshiftoss/hdwallet-portis";
import * as trezor from "@shapeshiftoss/hdwallet-trezor";
Expand Down Expand Up @@ -61,6 +62,8 @@ export function bitcoinTests(get: () => { wallet: core.HDWallet; info: core.HDWa
"btcSupportsCoin()",
async () => {
if (!wallet || portis.isPortis(wallet)) return;
// Non-EVM things are a pain to test with snaps on test env, this wasn't tested before and still isn't
if (metamask.isMetaMask(wallet)) return;
expect(wallet.btcSupportsCoin("Bitcoin")).toBeTruthy();
expect(await info.btcSupportsCoin("Bitcoin")).toBeTruthy();
expect(wallet.btcSupportsCoin("Testnet")).toBeTruthy();
Expand All @@ -72,6 +75,9 @@ export function bitcoinTests(get: () => { wallet: core.HDWallet; info: core.HDWa
test("getPublicKeys", async () => {
if (!wallet || ledger.isLedger(wallet) || trezor.isTrezor(wallet) || portis.isPortis(wallet)) return;

// Non-EVM things are a pain to test with snaps on test env, this wasn't tested before and still isn't
if (metamask.isMetaMask(wallet)) return;

/* FIXME: Expected failure (trezor does not use scriptType in deriving public keys
and ledger's dependency bitcoinjs-lib/src/crypto.js throws a mysterious TypeError
in between mock transport calls.
Expand Down Expand Up @@ -194,10 +200,14 @@ export function bitcoinTests(get: () => { wallet: core.HDWallet; info: core.HDWa
const scriptType = args[3] as core.BTCInputScriptType;
const expected = args[4] as string;

// Non-EVM things are a pain to test with snaps on test env, this wasn't tested before and still isn't
if (metamask.isMetaMask(wallet)) return;

if (!(await wallet.btcSupportsCoin(coin))) return;
expect(await info.btcSupportsCoin(coin)).toBeTruthy();
if (!(await wallet.btcSupportsScriptType(coin, scriptType))) return;
expect(await info.btcSupportsScriptType(coin, scriptType)).toBeTruthy();

const res = await wallet.btcGetAddress({
addressNList: core.bip32ToAddressNList(path),
coin: coin,
Expand All @@ -215,6 +225,8 @@ export function bitcoinTests(get: () => { wallet: core.HDWallet; info: core.HDWa
"btcSignTx() - p2pkh",
async () => {
if (!wallet || portis.isPortis(wallet)) return;
// Non-EVM things are a pain to test with snaps on test env, this wasn't tested before and still isn't
if (metamask.isMetaMask(wallet)) return;
if (ledger.isLedger(wallet)) return; // FIXME: Expected failure
const tx: core.BitcoinTx = {
version: 1,
Expand Down Expand Up @@ -290,6 +302,8 @@ export function bitcoinTests(get: () => { wallet: core.HDWallet; info: core.HDWa
"btcSignTx() - thorchain swap",
async () => {
if (!wallet || portis.isPortis(wallet)) return;
// Non-EVM things are a pain to test with snaps on test env, this wasn't tested before and still isn't
if (metamask.isMetaMask(wallet)) return;
if (ledger.isLedger(wallet)) return; // FIXME: Expected failure
if (trezor.isTrezor(wallet)) return; //TODO: Add trezor support for op return data passed at top level
const tx: core.BitcoinTx = {
Expand Down Expand Up @@ -375,6 +389,8 @@ export function bitcoinTests(get: () => { wallet: core.HDWallet; info: core.HDWa
"btcSignMessage()",
async () => {
if (!wallet) return;
// Non-EVM things are a pain to test with snaps on test env, this wasn't tested before and still isn't
if (metamask.isMetaMask(wallet)) return;

// not implemented for native
if (native.isNative(wallet)) {
Expand Down Expand Up @@ -408,6 +424,8 @@ export function bitcoinTests(get: () => { wallet: core.HDWallet; info: core.HDWa
"btcVerifyMessage() - good",
async () => {
if (!wallet) return;
// Non-EVM things are a pain to test with snaps on test env, this wasn't tested before and still isn't
if (metamask.isMetaMask(wallet)) return;

// not implemented for native
if (native.isNative(wallet)) {
Expand All @@ -431,6 +449,8 @@ export function bitcoinTests(get: () => { wallet: core.HDWallet; info: core.HDWa
"btcVerifyMessage() - bad",
async () => {
if (!wallet) return;
// Non-EVM things are a pain to test with snaps on test env, this wasn't tested before and still isn't
if (metamask.isMetaMask(wallet)) return;

// not implemented for native
if (native.isNative(wallet)) {
Expand All @@ -454,6 +474,8 @@ export function bitcoinTests(get: () => { wallet: core.HDWallet; info: core.HDWa
"btcSupportsSecureTransfer()",
async () => {
if (!wallet) return;
// Non-EVM things are a pain to test with snaps on test env, this wasn't tested before and still isn't
if (metamask.isMetaMask(wallet)) return;
expect(typeof (await wallet.btcSupportsSecureTransfer()) === typeof true).toBeTruthy();
if (await wallet.btcSupportsSecureTransfer()) {
// eslint-disable-next-line jest/no-conditional-expect
Expand All @@ -468,6 +490,8 @@ export function bitcoinTests(get: () => { wallet: core.HDWallet; info: core.HDWa
"btcSupportsNativeShapeShift()",
async () => {
if (!wallet) return;
// Non-EVM things are a pain to test with snaps on test env, this wasn't tested before and still isn't
if (metamask.isMetaMask(wallet)) return;
expect(typeof wallet.btcSupportsNativeShapeShift()).toBe("boolean");
if (wallet.btcSupportsNativeShapeShift()) {
// eslint-disable-next-line jest/no-conditional-expect
Expand Down Expand Up @@ -499,6 +523,8 @@ export function bitcoinTests(get: () => { wallet: core.HDWallet; info: core.HDWa
const accountIdx = args[1] as number;
const scriptType = args[2] as core.BTCInputScriptType;
if (!wallet) return;
// Non-EVM things are a pain to test with snaps on test env, this wasn't tested before and still isn't
if (metamask.isMetaMask(wallet)) return;
if (!(await wallet.btcSupportsCoin(coin))) return;
expect(await info.btcSupportsCoin(coin)).toBeTruthy();
if (!(await wallet.btcSupportsScriptType(coin, scriptType))) return;
Expand All @@ -521,29 +547,5 @@ export function bitcoinTests(get: () => { wallet: core.HDWallet; info: core.HDWa
},
TIMEOUT
);

test(
"btcIsSameAccount()",
async () => {
if (!wallet) return;
[0, 1, 9].forEach((idx) => {
const paths = wallet.btcGetAccountPaths({
coin: "Bitcoin",
accountIdx: idx,
});
expect(typeof wallet.btcIsSameAccount(paths) === typeof true).toBeTruthy();
paths.forEach((path) => {
if (wallet.getVendor() === "Portis") {
// eslint-disable-next-line jest/no-conditional-expect
expect(wallet.btcNextAccountPath(path)).toBeUndefined();
} else {
// eslint-disable-next-line jest/no-conditional-expect
expect(wallet.btcNextAccountPath(path)).not.toBeUndefined();
}
});
});
},
TIMEOUT
);
});
}
Loading