Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
83 changes: 0 additions & 83 deletions .circleci/config.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
push:
branches: [master]
pull_request:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn

- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libudev-dev libusb-dev libusb-1.0-0-dev libtool

- name: Install dependencies
run: yarn --frozen-lockfile

- name: Build
run: yarn build

- name: Lint
run: yarn lint

- name: Unit tests
run: yarn test --runInBand --coverage=false

- name: Ensure no uncommitted changes
run: git diff --quiet || exit 1
61 changes: 0 additions & 61 deletions examples/sandbox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import * as core from "@keepkey/hdwallet-core";
import * as keepkey from "@keepkey/hdwallet-keepkey";
import * as keepkeyTcp from "@keepkey/hdwallet-keepkey-tcp";
import * as keepkeyWebUSB from "@keepkey/hdwallet-keepkey-webusb";
import * as native from "@keepkey/hdwallet-native";
import * as sigUtil from "@metamask/eth-sig-util";
import { TypedData } from "eip-712";
import $ from "jquery";
Expand Down Expand Up @@ -217,25 +216,9 @@ class BIP39PathEditor {
}
}

const testPublicWalletXpubs = [
"xpub661MyMwAqRbcFLgDU7wpcEVubSF7NkswwmXBUkDiGUW6uopeUMys4AqKXNgpfZKRTLnpKQgffd6a2c3J8JxLkF1AQN17Pm9QYHEqEfo1Rsx", // all seed root key
"xpub68Zyu13qjcQxDzLNfTYnUXtJuX2qJgnxP6osrcAvJGdo6bs9M2Adt2BunbwiYrZS5qpA1QKoMf3uqS2NHpbyZp4KMJxDrL58NTyvHXBeAv6", // all seed m/44'
"xpub6APRH5kELakva27TFbzpfhfsY3Jd4dRGo7NocHb63qWecSgK2dUkjWaYevJsCunicpdAkPg9fvHAdpSFMDCMCDMit8kiTM1w9QoGmfyVwDo", // all seed m/44'/0'
"xpub6BiVtCpG9fQPxnPmHXG8PhtzQdWC2Su4qWu6XW9tpWFYhxydCLJGrWBJZ5H6qTAHdPQ7pQhtpjiYZVZARo14qHiay2fvrX996oEP42u8wZy", // all seed m/44'/0'/0'
"xpub6APRH5kELakyDsZMmBU9HEoeRUzM9F8STp6ztXLPUJQLiXGrbsfACbngkw5vySPfa9vFs2p3kMsRPxhyDTLhKYEf5HLVfDcDuTTazgzvArk", // all seed m/44'/60'
"xpub6CNFa58kEQJu2hwMVoofpDEKVVSg6gfwqBqE2zHAianaUnQkrJzJJ42iLDp7Dmg2aP88qCKoFZ4jidk3tECdQuF4567NGHDfe7iBRwHxgke", // all seed m/44'/60'/0'
"xpub68Zyu13qjcQxUZiesSWiHJMqkg8G8Guft6MvDhwP72zSYXr9iKnNmDo7LxuSVwtpamrNwGQHkGDWoK8MAp3S9GW5fVxsjBY6AdvZc1hB7kK", // all seed m/49'
"xpub6AA5piovovuKytxa5QtBWAbixSjg7fbmu5gqs6QmvARrUMgewJV51roNH4M7GtvZmjBY1m5oAgAjoHivasewSh4S2H7LAikCyuhJxfHdSsK", // all seed m/49'/0'
"xpub6CVKsQYXc9awxgV1tWbG4foDvdcnieK2JkbpPEBKB5WwAPKBZ1mstLbKVB4ov7QzxzjaxNK6EfmNY5Jsk2cG26EVcEkycGW4tchT2dyUhrx", // all seed m/49'/0'/0'
"xpub68Zyu13qjcQz2DTzkBfLNCfsCTgT39rsUY9JT7MFvG3oEJvS8gUYwRX4RheUTFGZ6EtW4dFYhCdBX32GHJCodkQLAARjNsw4Drj1oDxvo9p", // all seed m/84'
"xpub69s3dQnszuX49hTwhNAQEMJyTcRQNZyhtKAqNgQXApquzXdR3fEjXg75ScXzMMMLkUjQnz2Giwt2L7vesiswkAYwzbHezaUXayU8Z81CW56", // all seed m/84'/0'
"xpub6DDUPHpUo4pcy43iJeZjbSVWGav1SMMmuWdMHiGtkK8rhKmfbomtkwW6GKs1GGAKehT6QRocrmda3WWxXawpjmwaUHfFRXuKrXSapdckEYF", // all seed m/84'/0'/0'
].join(" ");

const keepkeyAdapter = keepkeyWebUSB.WebUSBKeepKeyAdapter.useKeyring(keyring);
const kkbridgeAdapter = keepkeyTcp.TCPKeepKeyAdapter.useKeyring(keyring);
const kkemuAdapter = keepkeyTcp.TCPKeepKeyAdapter.useKeyring(keyring);
const nativeAdapter = native.NativeAdapter.useKeyring(keyring);

window["keyring"] = keyring;

Expand All @@ -247,7 +230,6 @@ window["wallet"] = wallet;
const $keepkey = $("#keepkey");
const $keepkeybridge = $("#keepkeybridge");
const $kkemu = $("#kkemu");
const $native = $("#native");
const $keyring = $("#keyring");

$keepkey.on("click", async (e) => {
Expand All @@ -271,13 +253,6 @@ $kkemu.on("click", async (e) => {
$("#keyring select").val(await wallet.transport.getDeviceID());
});

$native.on("click", async (e) => {
e.preventDefault();
wallet = await nativeAdapter.pairDevice("testid");
window["wallet"] = wallet;
$("#keyring select").val(await wallet.getDeviceID());
});

// Update settings button visibility based on wallet connection
function updateSettingsButtonVisibility() {
if (wallet && wallet.transport) {
Expand Down Expand Up @@ -337,20 +312,13 @@ async function deviceConnected(deviceId) {

keyring.on(["*", "*", core.Events.PIN_REQUEST], () => window["pinOpen"]());
keyring.on(["*", "*", core.Events.PASSPHRASE_REQUEST], () => window["passphraseOpen"]());
keyring.on(["*", "*", native.NativeEvents.MNEMONIC_REQUIRED], () => window["mnemonicOpen"]());

try {
await kkbridgeAdapter.pairDevice("http://localhost:1646");
} catch (e) {
console.error("Could not initialize keepkey bridge", e);
}

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

for (const deviceID of Object.keys(keyring.wallets)) {
await deviceConnected(deviceID);
}
Expand Down Expand Up @@ -423,9 +391,6 @@ window["mnemonicEntered"] = async function () {
};

window["useTestWallet"] = async function () {
wallet.loadDevice({
mnemonic: await native.crypto.Isolation.Engines.Dummy.BIP39.Mnemonic.create(testPublicWalletXpubs),
});
document.getElementById("#mnemonicModal").className = "modal";
};

Expand Down Expand Up @@ -480,16 +445,6 @@ $("#settings-kkemu").on("click", async (e) => {
updateSettingsButtonVisibility();
});

$("#settings-native").on("click", async (e) => {
e.preventDefault();
wallet = await nativeAdapter.pairDevice("testid");
window["wallet"] = wallet;
const deviceID = await wallet.getDeviceID();
$("#keyring").val(deviceID);
$("#settings-keyring").val(deviceID);
updateSettingsButtonVisibility();
});

// Settings modal device management buttons
$("#settings-getLabel").on("click", async () => {
if (!wallet) {
Expand Down Expand Up @@ -1082,22 +1037,6 @@ $("#kyc-pair-emulator").on("click", async function (e) {
}
});

// KYC Pair Native
$("#kyc-pair-native").on("click", async function (e) {
e.preventDefault();
try {
kycWallet = await nativeAdapter.pairDevice("kyc-testid");
window["wallet"] = kycWallet;
wallet = kycWallet;
const deviceID = await kycWallet.getDeviceID();
updateKycDeviceStatus(true, `Native Wallet ${deviceID.substring(0, 8)}...`);
await updateKycAddressPreview();
} catch (error) {
console.error("Failed to pair native wallet:", error);
alert("Failed to pair native wallet.");
}
});

// KYC Chain Selection
$(".chain-option").on("click", async function () {
$(".chain-option").removeClass("selected");
Expand Down
1 change: 0 additions & 1 deletion examples/sandbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"@keepkey/hdwallet-core": "1.53.16",
"@keepkey/hdwallet-keepkey-tcp": "1.53.16",
"@keepkey/hdwallet-keepkey-webusb": "1.53.16",
"@keepkey/hdwallet-native": "1.53.16",
"@metamask/eth-sig-util": "^7.0.0",
"@pioneer-platform/pioneer-coins": "^9.11.11",
"bip32": "^2.0.4",
Expand Down
1 change: 0 additions & 1 deletion integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"@keepkey/hdwallet-keepkey": "1.53.16",
"@keepkey/hdwallet-keepkey-nodewebusb": "1.53.16",
"@keepkey/hdwallet-keepkey-tcp": "1.53.16",
"@keepkey/hdwallet-native": "1.53.16",
"fast-json-stable-stringify": "^2.1.0",
"msw": "^0.27.1",
"whatwg-fetch": "^3.6.2"
Expand Down
16 changes: 0 additions & 16 deletions integration/src/bitcoin/bitcoin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as core from "@keepkey/hdwallet-core";
import * as native from "@keepkey/hdwallet-native";

import { each } from "../utils";

Expand Down Expand Up @@ -360,11 +359,6 @@ export function bitcoinTests(get: () => { wallet: core.HDWallet; info: core.HDWa
async () => {
if (!wallet) return;

// not implemented for native
if (native.isNative(wallet)) {
return;
}

const res = wallet.btcSignMessage({
addressNList: core.bip32ToAddressNList("m/44'/0'/0'/0/0"),
coin: "Bitcoin",
Expand All @@ -386,11 +380,6 @@ export function bitcoinTests(get: () => { wallet: core.HDWallet; info: core.HDWa
async () => {
if (!wallet) return;

// not implemented for native
if (native.isNative(wallet)) {
return;
}

const res = await wallet.btcVerifyMessage({
address: "1FH6ehAd5ZFXCM1cLGzHxK1s4dGdq1JusM",
coin: "Bitcoin",
Expand All @@ -409,11 +398,6 @@ export function bitcoinTests(get: () => { wallet: core.HDWallet; info: core.HDWa
async () => {
if (!wallet) return;

// not implemented for native
if (native.isNative(wallet)) {
return;
}

const res = await wallet.btcVerifyMessage({
address: "1FH6ehAd5ZFXCM1cLGzHxK1s4dGdq1JusM",
coin: "Bitcoin",
Expand Down
Loading