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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@airmoney-degn/controller-sdk

v7.7.0

Published

SDK for controlling AirMoney devices, providing button screen management, key event handling, and device communication capabilities

Downloads

287

Readme

AirMoney Controller SDK

A TypeScript SDK for interacting with AirMoney device. This SDK provides core functionality to control device screens, handle key events, and perform cryptographic operations.

Development

Prerequisites for Development

Before developing with this SDK, make sure you have the following installed:

  • Node.js (v18 or higher)
  • Yarn package manager

Development Workflow

  1. Clone and Install Dependencies

    git clone <repository-url>
    cd controller-sdk
    yarn install
  2. Start Development Mode

    yarn dev

    This command will build the SDK and provide instructions for local testing.

  3. Make Changes and Test

    • Make your changes to the SDK source code
    • Run yarn dev again to rebuild the package
    • Test your changes in your consuming project

Available Scripts

  • yarn dev - Build the SDK for development
  • yarn build - Build the SDK for production
  • yarn preview - Preview the built SDK locally
  • yarn lint - Run ESLint to check code quality
  • yarn check-types - Run TypeScript type checking
  • yarn changeset - Create a changeset for version management
  • yarn version - Apply changesets and update version
  • yarn release - Build and publish to npm registry

Code Quality

The project uses:

  • ESLint for code linting with AirMoney's custom configuration
  • Prettier for code formatting
  • TypeScript for type safety
  • Changesets for version management

Run linting and type checking:

yarn lint
yarn check-types

Preview

To preview the built SDK locally:

yarn preview

This will start a local preview server where you can test the built SDK.

Release

Version Management

This project uses Changesets for version management.

Creating a Release

  1. Create a Changeset

    yarn changeset

    This will prompt you to:

    • Select which packages to include
    • Choose the type of change (patch, minor, major)
    • Write a summary of the changes
  2. Apply Changesets and Update Version

    yarn version

    This will:

    • Apply all pending changesets
    • Update package versions
    • Update CHANGELOG.md
  3. Build and Publish

    yarn release

    This will:

    • Build the SDK
    • Publish to npm registry

Release Process

  1. Make your changes and commit them
  2. Create a changeset describing your changes
  3. Run yarn version to update versions
  4. Run yarn release to publish
  5. Push changes and tags to the repository

API Reference

AirMoneyService

Constructor

new AirMoneyService(options?: { [key in Methods]?: Options<key> })

Methods

setImage
setImage(params: { id: 'left' | 'right', imageName: string }): Promise<AMServiceScreenResponse>

Displays a static image on the specified screen. Supports throttling configuration.

setAnimate
setAnimate(params: { id: 'left' | 'right', imageName: string }): Promise<AMServiceScreenResponse>

Displays an animated GIF on the specified screen. Supports throttling configuration.

initialize
initialize(): Promise<void>

Initializes the service by loading the app name from metadata.json or window.AIRMONEY_APP_ID.

AirMoneyKeyEvent

Constructor

new AirMoneyKeyEvent(config?: Partial<AMKeyEventConfig>)

Configuration Options

interface AMKeyEventConfig {
  threshold: number; // milliseconds for long press detection
  combinations?: Record<string, AMKey[]>; // key combinations
  doubleClicks?: Record<string, AMKey>; // double click keys
  debug?: boolean; // enable debug logging
}

Methods

on
on(callback: AMKeyEventCallback): void

Registers a callback for key events.

off
off(): void

Removes all event listeners and callbacks.

updateConfig
updateConfig(config?: Partial<AMKeyEventConfig>): void

Updates the configuration of the key event handler.

AirMoneyKeyEventManager

Constructor

new AirMoneyKeyEventManager(config: { instance: AirMoneyKeyEvent, debug?: boolean })

Methods

subscribe
subscribe(config: AMKeyEventTriggerGroupConfig): string

Registers a group of triggers with a config object. Returns a unique listener ID.

unsubscribe
unsubscribe(listenerId: string): boolean

Unsubscribe from key events by group ID. Returns true if successfully unsubscribed.

unsubscribeAll
unsubscribeAll(): void

Unsubscribe from all key events.

getKeyEventInstance
getKeyEventInstance(): AirMoneyKeyEvent

Returns the underlying AirMoneyKeyEvent instance.

updateConfig
updateConfig(config: Partial<AMKeyEventConfig>): void

Updates the configuration of the AirMoneyKeyEvent instance.

destroy
destroy(): void

Unsubscribes all listeners and cleans up the manager and AirMoneyKeyEvent instance.

AirMoneyCryptoService

Constructor

new AirMoneyCryptoService()

EVM Methods

getDefaultEvmWallet
getDefaultEvmWallet(): Promise<AMCryptoServiceGetDefaultEvmWalletResponse>

Gets the default EVM wallet address.

signEvmMessage
signEvmMessage(params: { address: string, message: string }): Promise<AMCryptoServiceEvmMessageResponse>

Signs a message with the specified EVM wallet.

signEvmTransaction
signEvmTransaction(params: { address: string, transaction: EVMTransaction, chainId: string }): Promise<AMCryptoServiceEvmTransactionResponse>

Signs an EVM transaction.

signGeneralEvmTransaction
signGeneralEvmTransaction(params: { address: string, transaction: EVMTransaction, chainId: string }): Promise<AMCryptoServiceEvmTransactionResponse>

Signs a general EVM transaction.

signEip712TypedData
signEip712TypedData(params: { address: string, domain: object, types: object, primaryType: string, message: object }): Promise<AMCryptoServiceEip712TypedDataResponse>

Signs EIP-712 typed data.

verifyEip1271Signature
verifyEip1271Signature(params: { address: string, message: string, signature: string }): Promise<AMCryptoServiceVerifyEip1271SignatureResponse>

Verifies an EIP-1271 signature.

signEVMRawTransaction
signEVMRawTransaction(params: { address: string, rawTransaction: RawEVMTransaction, chainId: string | number }): Promise<AMCryptoServiceEvmTransactionResponse>

Signs a raw EVM transaction.

Solana Methods

getDefaultSvmWallet
getDefaultSvmWallet(): Promise<AMCryptoServiceGetDefaultSvmWalletResponse>

Gets the default Solana wallet address.

signSolanaMessage
signSolanaMessage(params: { address: string, message: string }): Promise<AMCryptoServiceSolanaMessageResponse>

Signs a message with the specified Solana wallet.

signSolanaTransaction
signSolanaTransaction(params: { address: string, transaction_base64: string }): Promise<AMCryptoServiceSolanaTransactionResponse>

Signs a Solana transaction.

Bitcoin Methods

getDefaultBitcoinWallet
getDefaultBitcoinWallet(): Promise<AMCryptoServiceGetDefaultBitcoinWalletResponse>

Gets the default Bitcoin wallet address.

signBitcoinMessage
signBitcoinMessage(params: { address: string, message: string }): Promise<AMCryptoServiceBitcoinMessageResponse>

Signs a Bitcoin message.

verifyBitcoinSignature
verifyBitcoinSignature(params: { address: string, message: string, signature: string }): Promise<AMCryptoServiceVerifyBitcoinSignatureResponse>

Verifies a Bitcoin signature.

signBitcoinTransaction
signBitcoinTransaction(params: { address: string, transaction: string }): Promise<AMCryptoServiceBitcoinTransactionResponse>

Signs a Bitcoin transaction.

Utility Functions

Navigation Functions

backToHome
backToHome(): void

Navigates back to the home page.

goToApp
goToApp(appName?: string): void

Navigates to a specific app.

getAppLink
getAppLink(appName?: string): string

Gets the link for an app.

displayAsset
displayAsset(appName?: string, path?: string): string

Gets the display URL for an asset.

getAppLogo
getAppLogo(appName?: string): string

Gets the logo URL for an app.

Transaction Functions

normalizeEVMTransaction
normalizeEVMTransaction(obj: RawEVMTransaction): EVMTransaction

Normalizes an EVM transaction object.

toHexString
toHexString(obj: bigint | number | string): HexString

Converts a value to a hex string.

License

MIT © AirMoney