npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

patrick-hub-adapter

v0.2.0

Published

Low-level adapter for signing Stacks transactions with Turnkey's raw signing API.

Readme

patrick-hub-adapter

Low-level adapter package for signing Stacks blockchain transactions using Turnkey's secure embedded wallet infrastructure.


Overview

This package provides essential utilities to integrate Turnkey's raw signing API with Stacks.js transactions. It enables passwordless, enclave-secured transaction signing workflows leveraging Turnkey's passkey and social authentication, while maintaining compatibility with Stacks' SIP-010 token standards and Clarity smart contracts.


Features

  • Convert hex public keys to Stacks addresses for the correct network
  • Support transaction signing with Turnkey's raw payload signing API
  • Poll for asynchronous signing activity results
  • Sign and broadcast Stacks transactions securely without exposing private keys
  • Compatible with single-signature Stacks transactions only (multi-sig not supported)
  • TypeScript support with strict typing for improved developer experience

Installation

Install via npm:

npm install patrick-hub-adapter

Or using yarn:

yarn add patrick-hub-adapter

Usage

Import key functions

import {
  publicKeyToStacksAddress,
  signStacksTransaction,
  signAndBroadcastTransaction,
} from 'patrick-hub-adapter';

Example: Convert a public key to a Stacks address

const stacksAddress = publicKeyToStacksAddress(yourHexPublicKey, 'mainnet');
console.log('Stacks address:', stacksAddress);

Example: Sign and broadcast a Stacks transaction

import { StacksTransaction } from '@stacks/transactions';
import { StacksMainnet } from '@stacks/network';
import { TurnkeyClient } from '@turnkey/http';

const turnkeyClient = new TurnkeyClient({
  baseUrl: 'https://api.turnkey.com'
});

const signerConfig = {
  turnkeyClient,
  turnkeyOrganizationId: 'your-org-id',
  stacksAddress: 'ST1...',
};

async function signAndSend(tx: StacksTransaction, network: StacksMainnet) {
  const signedTx = await signStacksTransaction(tx, signerConfig);
  const result = await signAndBroadcastTransaction(tx, signerConfig, network);
  console.log('Broadcast result:', result);
}

API

publicKeyToStacksAddress(publicKey: string, networkName: 'mainnet' | 'testnet'): string

Converts a hex-encoded public key to a Stacks address string for the specified network.

Parameters:

  • publicKey - Hex-encoded public key string
  • networkName - Target network ('mainnet' or 'testnet')

Returns: Stacks address string


signStacksTransaction(unsignedTx: StacksTransaction, signerConfig: TurnkeyStacksSignerConfig): Promise<StacksTransaction>

Signs a single-signature Stacks transaction using Turnkey's raw signing API.

Parameters:

  • unsignedTx - Unsigned Stacks transaction object
  • signerConfig - Configuration object with Turnkey credentials

Returns: Promise resolving to signed StacksTransaction


signAndBroadcastTransaction(unsignedTx: StacksTransaction, signerConfig: TurnkeyStacksSignerConfig, network: StacksNetwork): Promise<TxBroadcastResult>

Signs and broadcasts a Stacks transaction in one step.

Parameters:

  • unsignedTx - Unsigned Stacks transaction object
  • signerConfig - Configuration object with Turnkey credentials
  • network - Stacks network instance

Returns: Promise resolving to transaction broadcast result


Types

TurnkeyStacksSignerConfig

Configuration object for Turnkey signing operations:

interface TurnkeyStacksSignerConfig {
  turnkeyClient: TurnkeyClient;
  turnkeyOrganizationId: string;
  stacksAddress: string;
}

Keywords

  • turnkey - Turnkey wallet infrastructure
  • stacks - Stacks blockchain
  • sbtc - sBTC (Stacks Bitcoin)
  • signer - Transaction signing utilities

Dependencies

This package has 4 dependencies. View the full dependency tree on npm.


Package Information

  • Version: 0.1.0
  • License: MIT
  • Size: 9.5 kB (unpacked)
  • Files: 14 total files

Development

Build

npm run build

Test

npm run test

Security

This package handles sensitive cryptographic operations. Always:

  • Keep your Turnkey organization credentials secure
  • Never expose private keys or API keys in client-side code
  • Use environment variables for sensitive configuration
  • Review transaction details before signing

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.


License

MIT License


Acknowledgments

  • Built with Stacks.js
  • Powered by Turnkey
  • Inspired by open-source blockchain developer workflows

Support

For questions or support, please open an issue or contact the maintainers.