Repository navigation
feat: decodeAddressPsbtData and vault-aware example dApp - #259
Open
victorkirov wants to merge 8 commits into
Open
victorkirov wants to merge 8 commits into
victorkirov wants to merge 8 commits into
Conversation
- decodeAddressPsbtData() turns the new Address scriptPubKey / unlockDefinition metadata (@sats-connect/core 0.18.0) into a scure addInput-ready object - jest ESM setup and tests for every unlock variant - example: shows the metadata, builds and signs PSBTs for all five address variants, derives the network from the wallet (read-network permission), describes real-time vault co-signing
✅ Deploy Preview for sats-connect ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
- signMessage / signMultipleMessages panel for the connected vault (BIP-322) - Starknet typed-data signing case with an is_valid_signature check - wallet_connect panel requests the Spark and Starknet purposes
# Conflicts: # example/src/components/wallet/WalletConnect.tsx # package-lock.json # package.json # src/index.ts
The example reads the connected account through stx_getAccounts and builds non-sequential multisig transactions (numSignatures, publicKeys, useNonSequentialMultiSig) for a vault entry; single-sig stays on publicKey. The batch result shows transactions and txids, and a stopped batch shows the per-transaction statuses from the error data. Pins @sats-connect/core 0.18.2-263ae91.
Adds a Bitcoin batch card that builds one PSBT per UTXO, each spending that UTXO back to the address that owns it, and sends them through signMultipleTransactions. Distinct UTXOs mean no conflicting inputs and nothing leaves the wallet but the fee; the batch payload carries no broadcast flag, so the wallet signs and broadcasts nothing. Stacks batches were already covered by SignTransactions. Both Bitcoin PSBT cards previously required scriptPubKey and unlockDefinition from the wallet and silently disabled themselves against older wallets that omit them. For a single-sig address both are now derived locally from the address and its public key. A vault address is not derivable and still needs a wallet that supplies them.
The builders default to mainnet, so a testnet vault's transactions carried a mainnet signer version byte and the wallet rejected them as not bound to the vault. Also fix the single-PSBT source select comparing an Address object to its string.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Package pre-release info
Built at (UTC): 2026-09-25T13:06:19.099Z
Summary
Consumes
@sats-connect/core@0.18.0(secretkeylabs/sats-connect-core#127) and adds:decodeAddressPsbtData(address)— hex-decodes the newscriptPubKey/unlockDefinitionAddress metadata into an object that spreads straight into@scure/btc-signer'stx.addInput(redeemScript, witnessScript, tapInternalKey, or tapLeafScript with a decoded control block), with typed errors for missing or malformed data.Example dApp:
wallet_getNetwork(requests the read-network permission; fails closed instead of assuming mainnet);Pins
@sats-connect/coreto the PR prerelease0.18.0-6d6c9b4; bump to the stable release before merging.Update 2026-09-10
signMessage/signMultipleMessages), Starknet typed-data case with anis_valid_signaturecheck,wallet_connectpanel requests Spark and Starknet purposes.