address method
String
address({
- dynamic account = 0,
- dynamic change = 0,
- dynamic index = 0,
- dynamic hardened = false,
- bool checksum = true,
Implementation
String address(
{account = 0,
change = 0,
index = 0,
hardened = false,
bool checksum = true}) {
final t = coins[_coinType]!["type"];
switch (t) {
case '0':
final pubk = publicKey(
account: account, change: change, index: index, hardened: hardened);
const version = 0x00;
return btcAddress(pubk, version);
case '1':
final pubk = publicKey(
account: account, change: change, index: index, hardened: hardened);
const version = 0x6F;
return btcAddress(pubk, version);
// default: coin type = 60, ethereum address
default:
final pubk = publicKeyUncompressed(
account: account, change: change, index: index, hardened: hardened);
return ethAddress(pubk, checksum: checksum);
}
}