@exodus/bitcoin-api 2.31.1 → 2.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.32.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@2.31.1...@exodus/bitcoin-api@2.32.0) (2025-04-01)
7
+
8
+
9
+ ### Features
10
+
11
+
12
+ * feat(bitcoin): allow message signing with external signer (#5365)
13
+
14
+
15
+
6
16
  ## [2.31.1](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@2.31.0...@exodus/bitcoin-api@2.31.1) (2025-03-19)
7
17
 
8
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/bitcoin-api",
3
- "version": "2.31.1",
3
+ "version": "2.32.0",
4
4
  "description": "Bitcoin transaction and fee monitors, RPC with the blockchain node, other networking code.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -23,7 +23,7 @@
23
23
  "@exodus/asset-lib": "^5.0.0",
24
24
  "@exodus/basic-utils": "^3.0.1",
25
25
  "@exodus/bip32": "^3.3.0",
26
- "@exodus/bip322-js": "^2.0.0",
26
+ "@exodus/bip322-js": "^2.1.0",
27
27
  "@exodus/bip44-constants": "^195.0.0",
28
28
  "@exodus/bitcoin-lib": "^2.4.3",
29
29
  "@exodus/bitcoinjs": "^1.1.0",
@@ -56,5 +56,5 @@
56
56
  "type": "git",
57
57
  "url": "git+https://github.com/ExodusMovement/assets.git"
58
58
  },
59
- "gitHead": "f1b6ccb198231db1fb6c9c51a0173967ec4efd1f"
59
+ "gitHead": "1f9c50ecd68233dd86ca4275d005a8baf93c85c5"
60
60
  }
package/src/index.js CHANGED
@@ -23,7 +23,7 @@ export * from './move-funds.js'
23
23
  export { createEncodeMultisigContract } from './multisig-address.js'
24
24
  export { toAsyncSigner } from './tx-sign/taproot.js'
25
25
  export * from './ordinals-utils.js'
26
- export { signMessage } from './sign-message.js'
26
+ export { signMessage, signMessageWithSigner } from './sign-message.js'
27
27
 
28
28
  // TODO: remove these, kept for compat
29
29
  export { scriptClassify } from '@exodus/bitcoinjs'
@@ -9,3 +9,13 @@ export const signMessage = async ({ privateKey, message: _message }) => {
9
9
 
10
10
  return Buffer.isBuffer(signedMessage) ? signedMessage : Buffer.from(signedMessage, 'base64')
11
11
  }
12
+
13
+ export const signMessageWithSigner = async ({ signer, message: { bip322Message, ...rest } }) => {
14
+ assert(bip322Message, `expected bip322Message`)
15
+ assert(Object.keys(rest).length === 0, `unexpected message properties`)
16
+
17
+ const { address, message } = bip322Message
18
+ const signedMessage = await Signer.signAsync(signer, address, message)
19
+
20
+ return Buffer.isBuffer(signedMessage) ? signedMessage : Buffer.from(signedMessage, 'base64')
21
+ }