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

fullNode.getUnspentCoins() not working? #30

Closed
nielsoo opened this issue May 31, 2021 · 1 comment
Closed

fullNode.getUnspentCoins() not working? #30

nielsoo opened this issue May 31, 2021 · 1 comment

Comments

@nielsoo
Copy link

nielsoo commented May 31, 2021

Hi!

getBlockchainState() does work ...

but as soon as I try

fullNode.getUnspentCoins({
  puzzleHash: '<any puzzle hash>',
  startHeight: 10000,
  endHeight: 50000
}).then((value) => {
  console.log("getUnspentCoins result:", value);
}).catch((e) => {
  console.error("getUnspentCoins error:", e)
})

it returns:

getUnspentCoins result: { error: ''dict' object has no attribute 'startswith'',
success: false }

while checking the same puzzle hash with CURL works

curl --insecure --cert ~/.chia/mainnet/config/ssl/full_node/private_full_node.crt --key ~/.chia/mainnet/config/ssl/full_node/private_full_node.key -H "Content-Type: application/json" -X POST https://localhost:8555/get_coin_records_by_puzzle_hash -d '{"puzzle_hash": "< some puzzle hash >", "start_height": 350000, "include_spend_coins":false}' | python3 -m json.tool

any idea what I'm doing wrong?

@nielsoo nielsoo closed this as completed May 31, 2021
@nielsoo
Copy link
Author

nielsoo commented May 31, 2021

Sorry case closed .. I sent parameters as json

correct way:

fullNode.getUnspentCoins(
  '<any puzzle hash>',
  10000,
  50000
}).then((value) => {
  console.log("getUnspentCoins result:", value);
}).catch((e) => {
  console.error("getUnspentCoins error:", e)
})

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

No branches or pull requests

1 participant