BitShares Forum

Main => Technical Support => Topic started by: daydream on January 07, 2015, 07:38:55 pm

Title: Validate BTS address
Post by: daydream on January 07, 2015, 07:38:55 pm
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.

Title: Re: Validate BTS address
Post by: toast on January 07, 2015, 07:48:07 pm
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.
Title: Re: Validate BTS address
Post by: yak on January 12, 2015, 05:56:00 pm
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