can't get the same publickey from api.signatureProvider.getAvailableKeys() as cleos
Version of EOSJS ^20.0.0-beta1
Describe the bug
when i using the api.signatureProvider.getAvailableKeys() with default private key 5KPRRKtJmKEcVifeLd8mGGdtKP855HDDQ97sWG1wM4EGCDpyB8m,it retrurns PUB_K1_8QPw89hqrzohK6gKTHG8bVCte3thbwceE7rFN25k8GdPhTY43L,but when i use cleos wit h command cleos wallet private_keys,i can get :
[
"EOS8QPw89hqrzohK6gKTHG8bVCte3thbwceE7rFN25k8GdPgsBJuu",
"5KPRRKtJmKEcVifeLd8mGGdtKP855HDDQ97sWG1wM4EGCDpyB8m"
]
the last few chars from these two string are diffrent. and i can get right account names from RPC with the cleos publickey, but the publickey from eosjs can not. have i do something wrong?
public key from eosjs:
PUB_K1_8QPw89hqrzohK6gKTHG8bVCte3thbwceE7rFN25k8GdPhTY43L

public key from cleos:
EOS8QPw89hqrzohK6gKTHG8bVCte3thbwceE7rFN25k8GdPgsBJuu

using the key from eosjs to get account names:
using the key from cleos to get account names:
K1 Public keys have two different ascii representations of the same underlying binary data. The EOS prefix is the prefix for the legacy format. The /v1/ rpc api uses it for backwards compatibility. Future rpc apis won’t produce that format. The PUB_K1_ prefix is the prefix for the current format. The checksum bytes at the end are different. Both the /v1/ api and eosjs2 understand either format on input.
K1 Public keys have two different ascii representations of the same underlying binary data. The EOS prefix is the prefix for the legacy format. The /v1/ rpc api uses it for backwards compatibility. Future rpc apis won’t produce that format. The PUB_K1_ prefix is the prefix for the current format. The checksum bytes at the end are different. Both the /v1/ api and eosjs2 understand either format on input.
Wow!got it!perhaps the PUB_K1_prefix i used at first time has something wrong,i try it agian and it works, thanks a lot 😄 😄