AccountRefDoc.fromIds constructor

AccountRefDoc.fromIds(
  1. String ledgerId,
  2. Object accountId
)

Implementation

factory AccountRefDoc.fromIds(String ledgerId, Object accountId) {
  var intAccountId = <int>[];
  if (accountId is String) {
    intAccountId = hex.decode(accountId);
  } else if (accountId is! List<int>) {
    throw ArgumentError('Invalid type for account ID');
  } else {
    intAccountId = accountId;
  }

  final accountRef = AccountRef()
    ..ledgerId = ledgerId
    ..accountId = intAccountId;
  return AccountRefDoc(accountRef);
}