Skip to content
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

Add a wallet rpc endpoint to get in-use addresses for a particular wallet ID #14603

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

Conversation

cmmarslender
Copy link
Contributor

Purpose:

Adds the ability to get in-use addresses for a particular wallet ID via the RPC.

Current Behavior:

Currently, there is not a straight forward way to get this, aside from iterating through all of the coins in the wallet and finding the unique puzzlehashes. Its another step to then determine if the address is observer or non-observer.

New Behavior:

New behavior adds an endpoint with a relatively simple query to get this data directly.

Testing Notes:

chia rpc wallet get_used_addresses - Returns addresses for the (default) wallet_id 1

chia rpc wallet get_used_addresses '{"wallet_id":3}' - Returns addresses for wallet_id 3

Example Response

    "addresses": [
        {
            "address": "xch...",
            "observer": true,
            "puzzle_hash": "xxxxx"
        },
        {
            "address": "xch...",
            "observer": false,
            "puzzle_hash": "xxxxx"
        },
        ...
    ],
    "success": true
}

Note that when testing, this worked fine for the normal XCH wallet and all my CAT wallets, but did not seem to work for NFT wallets. It doesn't appear that we store any data in derivation_paths for NFTs which is the joined table utilized to determine hardened or unhardened, so that would explain why no results come back for NFT wallets.

@cmmarslender cmmarslender added RPC Pull requests that change or introduce RPC commands Added Required label for PR that categorizes merge commit message as "Added" for changelog labels Feb 16, 2023
@cmmarslender cmmarslender requested a review from a team as a code owner February 16, 2023 23:30
@cmmarslender cmmarslender marked this pull request as draft February 17, 2023 00:03
@github-actions
Copy link
Contributor

github-actions bot commented Apr 3, 2023

This PR has been flagged as stale due to no activity for over 60 days. It will not be automatically closed, but it has been given a stale-pr label and should be manually reviewed by the relevant parties.

@github-actions github-actions bot added the stale-pr Flagged as stale and in need of manual review label Apr 3, 2023
@github-actions github-actions bot added the merge_conflict Branch has conflicts that prevent merge to main label Aug 16, 2023
@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the stale-pr Flagged as stale and in need of manual review label Oct 13, 2023
Copy link
Contributor

This PR has been flagged as stale due to no activity for over 60 days. It will not be automatically closed, but it has been given a stale-pr label and should be manually reviewed by the relevant parties.

@github-actions github-actions bot added the stale-pr Flagged as stale and in need of manual review label Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Added Required label for PR that categorizes merge commit message as "Added" for changelog merge_conflict Branch has conflicts that prevent merge to main RPC Pull requests that change or introduce RPC commands stale-pr Flagged as stale and in need of manual review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant