onekeyhq / hardware-js-sdk Goto Github PK
View Code? Open in Web Editor NEWJavascript SDK for easily connect OneKey hardware device.
Javascript SDK for easily connect OneKey hardware device.
I noticed in the passphrase docs that entering the passphrase through keyboard requires the user-facing wallet to request the passphrase from the user https://github.com/OneKeyHQ/docs/blob/main/connect-to-hardware/hardware-sdk/passphrase.md#enter-the-passphrase-in-the-software. This seems incorrect to me, as the purpose of the hardware wallet is to ensure that the user-facing wallet does not know anything about the PIN or passphrase. Shouldn't this be handled by the bridge software instead? This is what Trezor does, for example.
Hi team,
I've read the doc about how to sign a BTC transaction https://developer.onekey.so/connect-to-hardware/hardware-sdk/api-reference/bitcoin/btcsigntransaction. It requires passing a struct to describe the transaction
HardwareSDK.btcSignTransaction(connectId, deviceId, {
inputs: [
{
address_n: [(44 | 0x80000000) >>> 0, (0 | 0x80000000) >>> 0, (2 | 0x80000000) >>> 0, 1, 0],
prev_index: 0,
prev_hash: 'b035d89d4543ce5713c553d69431698116a822c57c03ddacf3f04b763d1999ac',
}
],
outputs: [
{
address_n: [(44 | 0x80000000) >>> 0, (0 | 0x80000000) >>> 0, (2 | 0x80000000) >>> 0, 1, 1],
amount: '3181747',
script_type: 'PAYTOADDRESS',
}, {
address: '18WL2iZKmpDYWk1oFavJapdLALxwSjcSk2',
amount: '200000',
script_type: 'PAYTOADDRESS',
}
],
coin: 'btc'
});
I'm wondering if there's a way to call a method to sign with ECDSA, directly passing the sighashPreimage
instead of a struct tx, so that we can call like
HardwareSDK.signEcdsa(connectId, deviceId, {
path: "m/44'/0'/0'",
sighashPreimage: "xxxxxxxxxx"
});
this method would return the result of the DER signature 3045xxxxxxx
, or the raw ECDSA signature (r, s).
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.