getPrivateKeyWallet function
Implementation
WalletType getPrivateKeyWallet(String coin, String privateKey) {
final wallet = getWallet(coin);
final setting = getChainConfig(coin).mainnet;
switch (wallet) {
case Wallet.NONE:
throw Exception('Unsupported chain');
case Wallet.DOT:
return DotCoin.fromPrivateKey(privateKey, setting);
case Wallet.XRP:
return XrpCoin.fromPrivateKey(privateKey, setting);
case Wallet.SUI:
return SuiCoin.fromPrivateKey(privateKey, setting);
case Wallet.SC:
return SiaCoin.fromPrivateKey(privateKey, setting);
case Wallet.CKB:
return CkbCoin.fromPrivateKey(privateKey, setting);
case Wallet.HNS:
return HnsCoin.fromPrivateKey(privateKey, setting);
case Wallet.ALPH:
return AlphCoin.fromPrivateKey(privateKey, setting);
case Wallet.ATOM:
return Cosmos.fromPrivateKey(privateKey, setting);
case Wallet.SEI:
return Cosmos.fromPrivateKey(privateKey, setting);
case Wallet.KAVA:
return Cosmos.fromPrivateKey(privateKey, setting);
case Wallet.KAS:
return KasCoin.fromPrivateKey(privateKey, setting);
case Wallet.KLS:
return KasCoin.fromPrivateKey(privateKey, setting);
case Wallet.SOL:
return SolCoin.fromPrivateKey(privateKey, setting);
case Wallet.NEAR:
return NearCoin.fromPrivateKey(privateKey, setting);
case Wallet.APTOS:
return AptosCoin.fromPrivateKey(privateKey, setting);
case Wallet.FIL:
return FileCoin.fromPrivateKey(privateKey, setting);
case Wallet.ETH:
return EthCoin.fromPrivateKey(privateKey, setting);
case Wallet.ICP:
return IcpCoin.fromPrivateKey(privateKey, setting);
}
}