Skip to content

feat: add accountInfo request to retrieve account details #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Kiranchaudhary537
Copy link

@Kiranchaudhary537 Kiranchaudhary537 commented Mar 31, 2025

I’ve submitted a PR to introduce a new method, getAddressInfo, which retrieves a wallet’s account data (e.g., publicKey, address, and optional addressType).

Why this change?
While using the package for wallet interactions (signing, connecting, etc.), I needed access to the user’s public key for building unsigned PSBTs. Since the current implementation didn’t provide this data, I added it to the accountInfo method while ensuring existing integrations remain unaffected.

Changes made:

  1. Added getAddressInfo(client) request which take no params and return BtcAccount[].

ex.

import { getAddressInfo } from '@bigmi/core';  
const accountInfo = await getAddressInfo(client);

Copy link
Member

@chybisov chybisov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had a discussion and agreed for the next structure of BtcAccount type returned from getAccount.

{
      address: string
      addressType: 'p2tr' | 'p2wpkh' | 'p2sh' | 'p2pkh'
      purpose: 'payment' | 'ordinals'
      publicKey: string
      accounts: readonly BtcAccount[]
      chain: chain | undefined
      chainId: number
      connector: Connector
      isConnected: true
      isConnecting: false
      isDisconnected: false
      isReconnecting: false
      status: 'connected'
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants