Skip to content

Commit

Permalink
debug onboarding
Browse files Browse the repository at this point in the history
  • Loading branch information
BitHighlander committed Nov 12, 2023
1 parent c8e1edf commit 19c9994
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 14 deletions.

This file was deleted.

3 changes: 0 additions & 3 deletions .yarn/cache/url-npm-0.11.3-d3652df78a-f9e7886f46.zip

This file was deleted.

3 changes: 2 additions & 1 deletion packages/keepkey-desktop-app/.env
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ REACT_APP_BOARDROOM_APP_BASE_URL=https://boardroom.io/shapeshift/
REACT_APP_KEEPKEY_UPDATER_RELEASE_PAGE=https://github.com/keepkey/keepkey-desktop/releases/latest
REACT_APP_KEEPKEY_UPDATER_BASE_URL=https://github.com/keepkey/keepkey-desktop/releases/download/v1.3.0/
REACT_APP_ETHERSCAN_API_KEY=XT8BI6VDYUGD9675X861ATHZNK3AN6HRMF
REACT_APP_DAPP_URL=https://pioneers.dev/spec/swagger.json
REACT_APP_DAPP_URL=http://localhost:9001/spec/swagger.json
#REACT_APP_DAPP_URL=https://pioneers.dev/spec/swagger.json
REACT_APP_REFERRER=no-referrer
REACT_APP_UNCHAINED_ETHEREUM_HTTP_URL=https://api.ethereum.shapeshift.com
REACT_APP_UNCHAINED_ETHEREUM_WS_URL=wss://api.ethereum.shapeshift.com
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export class KKStateController {
})
return undefined
})
console.log("resultInit: ", resultInit)
this.wallet = resultInit?.wallet
if (!resultInit) return

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,34 @@ export const initializeWallet = async (
) => {
const webUsbAdapter = await NodeWebUSBKeepKeyAdapter.useKeyring(keyring)
const hidAdapter = await HIDKeepKeyAdapter.useKeyring(keyring)

console.log("initializeWallet checkpoint 1 ")
const wallet = await (async () => {
// webUsbAdapter recognizes a device even if it does not support webUsb
const webUsbDevice = await webUsbAdapter.getDevice().catch(() => undefined)
console.log("initializeWallet checkpoint 2 ")
if (webUsbDevice) {
console.log("initializeWallet checkpoint 2a ")
console.log("webUsbDevice: ",webUsbDevice)
// this line throws the error if the device does not support webUsb
const webUsbWallet = await webUsbAdapter.pairRawDevice(webUsbDevice)
if (webUsbWallet) return webUsbWallet
try{
const webUsbWallet = await webUsbAdapter.pairRawDevice(webUsbDevice)
console.log("webUsbWallet: ",webUsbWallet)
if (webUsbWallet) return webUsbWallet
}catch(e){
console.error("Fauked to pair webUsbDevice: ",e)
}
}
console.log("initializeWallet checkpoint 3 ")
const hidDevice = await hidAdapter.getDevice().catch(() => undefined)
console.log("hidDevice:", hidDevice)
if (hidDevice) {
console.log("initializeWallet checkpoint 3a ")
const hidWallet = await hidAdapter.pairRawDevice(hidDevice)
return hidWallet
}
return undefined
})()

console.log("wallet:", wallet)
if (!wallet) {
return { wallet }
}
Expand Down
6 changes: 3 additions & 3 deletions packages/keepkey-sdk-server/src/controllers/ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ export class EthereumController extends ApiController {
// if (insight.recommended.gasPrice) {
// msg.gasPrice = insight.recommended.gasPrice
// }
// if (insight.recommended.gasLimit) {
// msg.gasLimit = insight.recommended.gasLimit
// }
if (parseInt(insight.recommended.gasLimit) > parseInt(msg.gasLimit)) {
msg.gasLimit = insight.recommended.gasLimit
}
// if (insight.recommended.maxPriorityFeePerGas) {
// msg.maxPriorityFeePerGas = insight.recommended.maxPriorityFeePerGas
// }
Expand Down

0 comments on commit 19c9994

Please sign in to comment.