Skip to content

Commit

Permalink
refactor(sdk): accept address type to sign message to override default (
Browse files Browse the repository at this point in the history
#93)

refactor: allow signer to pass adr type to sign w/
  • Loading branch information
iamcrazycoder authored Nov 6, 2023
1 parent 718c3db commit 089683e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/sdk/src/wallet/Ordit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,9 @@ export class Ordit {
return psbt.toHex()
}

signMessage(message: string) {
const node = this.allAddresses.find((wallet) => wallet.format === this.selectedAddressType) as Account
signMessage(message: string, type?: AddressFormats) {
const addressType = type || this.selectedAddressType
const node = this.allAddresses.find((wallet) => wallet.format === addressType) as Account
const signature = BIP22Address.isP2PKH(node.address!)
? sign(message, node.child.privateKey!)
: Signer.sign(node.child.toWIF(), node.address!, message, getNetwork(this.#network))
Expand Down

0 comments on commit 089683e

Please sign in to comment.