diff --git a/packages/sats-wagmi/src/connectors/base.ts b/packages/sats-wagmi/src/connectors/base.ts index 9ddc0ec..643e457 100644 --- a/packages/sats-wagmi/src/connectors/base.ts +++ b/packages/sats-wagmi/src/connectors/base.ts @@ -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. */ diff --git a/packages/sats-wagmi/src/connectors/unisat.ts b/packages/sats-wagmi/src/connectors/unisat.ts index 242e8ba..094cf66 100644 --- a/packages/sats-wagmi/src/connectors/unisat.ts +++ b/packages/sats-wagmi/src/connectors/unisat.ts @@ -1,4 +1,4 @@ -import { Network } from 'bitcoin-address-validation'; +import { AddressType, Network } from 'bitcoin-address-validation'; import { bitgetLogo } from '../assets/bitget'; @@ -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 }; });