Skip to content

Commit

Permalink
chore: enable tweak signer for taproot address
Browse files Browse the repository at this point in the history
  • Loading branch information
slavastartsev committed Nov 7, 2024
1 parent 5699223 commit 05bba7e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/sats-wagmi/src/connectors/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ abstract class SatsConnector {
return this.ordinalsAddress;
}

/** Convience wrapper around the getAddressInfo function
/** Convenience wrapper around the getAddressInfo function
* @param address - The address to get the type of.
* @returns The address type of the address.
*/
Expand Down
9 changes: 7 additions & 2 deletions packages/sats-wagmi/src/connectors/unisat.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Network } from 'bitcoin-address-validation';
import { AddressType, Network } from 'bitcoin-address-validation';

import { bitgetLogo } from '../assets/bitget';

Expand Down Expand Up @@ -200,11 +200,16 @@ class UnisatConnector extends SatsConnector {
inputs.push(index);
}
}

if (!this.paymentAddress) {
throw new Error('No payment address specified');
}

const toSignInputs = inputs.map((index) => {
return {
index,
publicKey: this.publicKey,
disableTweakSigner: true
disableTweakSigner: this.getAddressType(this.paymentAddress!) !== AddressType.p2tr
};
});

Expand Down

0 comments on commit 05bba7e

Please sign in to comment.