otherSignatoriesForPubkey method
Returns the list of other signatories excluding the current signer (using public key).
This is the public key variant of otherSignatoriesForAddress. Use this when you already have the public key and want to avoid address decoding overhead.
Parameters:
signerPubkey: The 32-byte public key of the current signer
Returns: A List<Uint8List> containing the public keys of all other signatories in sorted order.
Throws:
- ArgumentError if the signer public key is not found in the signatories list
Example:
// Alice is signing, using her public key directly
final others = multisigAccount.otherSignatoriesForPubkey(alice.pubKey);
// Returns public keys of Bob and Charlie (sorted)
Implementation
List<Uint8List> otherSignatoriesForPubkey(final Uint8List signerPubkey) {
// Find and exclude the signer
final others = <Uint8List>[];
bool foundSigner = false;
for (final pubkey in publicKeys) {
if (_matchesPubkey(pubkey, signerPubkey)) {
foundSigner = true;
} else {
others.add(pubkey);
}
}
if (!foundSigner) {
throw ArgumentError('Address $signerPubkey is not a signatory of this multisig');
}
return others;
}