You can get address of account using getAddress() function.
var coinType =DcentWebConnector.coinType.ETHEREUMvar keyPath ="m/44'/60'/0'/0/0"// key path of the accountvar resulttry{// Get Ethereum Address corresponding to keyPath result =awaitDcentWebConnector.getAddress(coinType, keyPath)}catch(e){ result = e}
The address string format is depend on the coin type.
For ss58 addresses used by the Substrate ecosystems such as Astar, prefix is added. The value of prefix is the prefix for each network defined in ss58-registry.
var coinType =DcentWebConnector.coinType.PARAvar keyPath ="m/44'/810'/0'/0/0"// key path of the Astar's accountvar prefix =5// The address prefix of Astarvar resulttry{// Get the address corresponding to keyPath & prefix result =awaitDcentWebConnector.getAddress(coinType, keyPath, prefix)}catch(e){ result = e}
Please note that Astar EVM features an EVM (Ethereum Virtual Machine) compatible runtime environment, so it is the same as getting the address of ETHEREUM account.
You can get xpub using getXPUB() function. The BIP32 key path must be at least 2 depth or more.
var keyPath ="m/44'/0'"// key path of the accountvar resulttry{// Get extended public key corresponding to keyPath result =awaitDcentWebConnector.getXPUB(keyPath)}catch(e){ result = e}
Show you address list and you can select an address using selectAddress() function.
var resulttry{// Get extended public key corresponding to keyPathlet addresses = [ { address:'0x1234567812345678123456781234567812345678', path:`m'/44'/60'/0'/0/0` }, { address:'0xabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd', path:`m'/44'/8217'/0'/0/0` } ] result =awaitDcentWebConnector.selectAddress(addresses)}catch(e){ result = e}