Skip to content

Commit

Permalink
feat: support vote delegation also on BitBox hw wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
refi93 committed Oct 4, 2024
1 parent c8c07e8 commit 8dc1d31
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
12 changes: 8 additions & 4 deletions app/frontend/wallet/shelley/shelley-bitbox02-crypto-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,18 @@ const ShelleyBitBox02CryptoProvider = async ({
poolKeyhash: Buffer.from(certificate.poolHash, 'hex'),
},
}
case CertificateType.VOTE_DELEGATION:
return {
voteDelegation: {
keypath: addressToAbsPathMapper(certificate.stakingAddress),
type: certificate.dRep.type,
drepCredhash: null,
},
}
case CertificateType.STAKEPOOL_REGISTRATION:
throw new UnexpectedError(UnexpectedErrorReason.UnsupportedOperationError, {
message: 'Stakepool registration not supported',
})
case CertificateType.VOTE_DELEGATION:
throw new UnexpectedError(UnexpectedErrorReason.UnsupportedOperationError, {
message: 'Vote delegation not supported',
})
default:
return safeAssertUnreachable(certificate)
}
Expand Down
Binary file added app/libs/bitbox-api-0.7.0.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"babel-polyfill": "6.26.0",
"bignumber.js": "^9.0.2",
"bip39-light": "^1.0.7",
"bitbox-api": "^0.5.0",
"bitbox-api": "file:./libs/bitbox-api-0.7.0.tgz",
"cardano-crypto.js": "^6.1.2",
"cbor": "^8.1.0",
"chacha-js": "^2.1.1",
Expand Down
7 changes: 3 additions & 4 deletions app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1261,10 +1261,9 @@ bip66@^1.1.5:
dependencies:
safe-buffer "^5.0.1"

bitbox-api@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/bitbox-api/-/bitbox-api-0.5.0.tgz#c1d002ba9b72a8032ff1b5d2ff3ef1113ff515f7"
integrity sha512-5VFN01Kk/iUgFvXm5lPBepvf6bM8cv6LQFGBjgkTiTuusGdmCcSjDiVqQrMvBhJUMLoBkAFf7QsFDw3G/RaQ9w==
"bitbox-api@file:./libs/bitbox-api-0.7.0.tgz":
version "0.7.0"
resolved "file:./libs/bitbox-api-0.7.0.tgz#9bf55e3675315dbffa3af3ab0f0eadc04f127d51"

bitcoin-ops@^1.3.0, bitcoin-ops@^1.4.1:
version "1.4.1"
Expand Down

0 comments on commit 8dc1d31

Please sign in to comment.