importPhrase static method
Future<ICPSigner>
importPhrase(
- String phrase, {
- int index = 0,
- SourceType sourceType = SourceType.ii,
- CurveType curveType = CurveType.ed25519,
Implementation
static Future<ICPSigner> importPhrase(
String phrase, {
int index = 0,
SourceType sourceType = SourceType.ii,
CurveType curveType = CurveType.ed25519,
}) async {
switch (sourceType) {
case SourceType.ii:
return (await ICPSigner.fromPhrase(
phrase,
index: hardened,
icPath: icDerivationPath,
curveType: curveType,
))
..setSourceType(SourceType.ii);
case SourceType.keySmith:
return (await ICPSigner.fromPhrase(
phrase,
index: index,
icPath: icDerivationPath,
curveType: curveType,
))
..setSourceType(SourceType.keySmith);
case SourceType.plug:
return (await ICPSigner.fromPhrase(
phrase,
index: index,
icPath: icDerivationPath,
curveType: curveType,
))
..setSourceType(SourceType.keySmith);
case SourceType.base:
return (await ICPSigner.fromPhrase(
phrase,
index: index,
curveType: curveType,
))
..setSourceType(SourceType.base);
default:
return (await ICPSigner.fromPhrase(
phrase,
index: hardened,
icPath: icDerivationPath,
curveType: curveType,
))
..setSourceType(SourceType.ii);
}
}