NodeWithAddress.fromChainIndex constructor
Implementation
factory NodeWithAddress.fromChainIndex({
required BIP32 node,
required String address,
required int chainIndex,
required String derivationPath,
required Map<AddressType, String> addresses,
HDWalletPurpose? walletPurpose,
}) {
if (chainIndex == EXTERNAL_CHAIN_INDEX) {
return ReceiveNode(
bip32Node: node,
address: address,
derivationPath: derivationPath,
addresses: addresses,
walletPurpose: walletPurpose,
publicKey: node.publicKey.toHex,
);
}
if (chainIndex == INTERNAL_CHAIN_INDEX) {
return ChangeNode(
bip32Node: node,
address: address,
derivationPath: derivationPath,
addresses: addresses,
walletPurpose: walletPurpose,
publicKey: node.publicKey.toHex,
);
}
throw UnsupportedError("unexpected chainIndex");
}