Author Topic: Validate BTS address  (Read 1735 times)

0 Members and 1 Guest are viewing this topic.

Offline yak

Hello,
I'm implementing Bitshares client and encounter a issue with BTS address validating rpc call:
the rpc call validate_address only work for account key and not for BTS addresses (account public address or addresses created by calling wallet_address_create accountName).
- validate_address accountKey : return true
- validate_address BTSaddress , it always return false
I need to validate BTS address
Any help is appreciated, thanks a lot.


have you tried looking at:
wallet_get_account <bts public name>
wallet_get_account_public_address <bts public name>

i believe this is exactly what you want.

Quote
>>> wallet_get_account_public_address asfdasdfsfdsfasfsafsdfsdfs
20006 unknown_account: unknown account
Unknown account name!
    {"account_name":"asfdasdfsfdsfasfsafsdfsdfs"}
    th_a  wallet.cpp:1315 get_account

    {}
    th_a  wallet.cpp:1334 get_account

    {"account_name":"asfdasdfsfdsfasfsafsdfsdfs"}
    th_a  wallet_api.cpp:771 wallet_get_account_public_address

    {}
    th_a  common_api_client.cpp:4575 wallet_get_account_public_address

    {"command":"wallet_get_account_public_address"}
    th_a  cli.cpp:579 execute_command


Quote
>>> wallet_get_account_public_address yaksbeard
BTS7GQB9CABxXKLGmP75b6sBc1DhsRtHGfHY

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
This call only checks if something is a valid public key. It is misnamed.

Also, it doesn't check that it belongs to an account or is in your wallet or anything. It literally just checks if a public key is well-formed.
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline daydream

  • Newbie
  • *
  • Posts: 2
    • View Profile
Hello,
I'm implementing Bitshares client and encounter a issue with BTS address validating rpc call:
the rpc call validate_address only work for account key and not for BTS addresses (account public address or addresses created by calling wallet_address_create accountName).
- validate_address accountKey : return true
- validate_address BTSaddress , it always return false
I need to validate BTS address
Any help is appreciated, thanks a lot.