You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update params to make it easier to implement multiple chain messages
* Params include: versions object, network object
* Updated types and readme
v1.0.0
Message signing defaults to Bitcoin '\u0018Bitcoin Signed Message:\n'. See [@hyperbitjs/chains](https://github.com/hyperbit-dev/chains) for message prefix options provided by different blockchains.
Copy file name to clipboardExpand all lines: src/index.ts
+34-20Lines changed: 34 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -1,47 +1,56 @@
1
+
import{btc}from'@hyperbitjs/chains';
1
2
importbitcoinMessagefrom'bitcoinjs-message';
2
3
importCoinKeyfrom'coinkey';
3
4
import{Sign,Verify}from'./types';
4
5
5
-
/**
6
-
* TODO:
7
-
* Fix version usage. See chains versions.public/private and https://github.com/cryptocoinjs/coinkey/blob/master/lib/coinkey.js#L9
8
-
* Update to pull in network of blockchain
9
-
*/
10
-
11
6
/**
12
7
* Sign for proof of ownership of wallet address.
13
8
* @param param
14
9
* @param {string} param.message Hash used for signing your message.
15
10
* @param {string|Buffer} param.privateKey Wallet Import Format (WIF) string or private key Buffer.
16
11
* @param {boolean=} param.compressed
17
12
* @param {string=} [param.messagePrefix=\u0018Bitcoin Signed Message:\n] Message prefix used by the blockchain for signing.
18
-
* @param {any=} sigOptions Pass in any option after the initial object to make use of additional https://github.com/bitcoinjs/bitcoinjs-message parameters.
13
+
* @param {object=} param.versions Versions object derived from Network object from @hyperbitjs/chains. Only private and public strings required
14
+
* @param {object=} param.network Network object from @hyperbitjs/chains
15
+
* @param {any=} params Pass in any signature option after the initial object to make use of additional https://github.com/bitcoinjs/bitcoinjs-message parameters.
19
16
* @returns A base64 encoded string representation of the signature.
0 commit comments