revokeClaimableBalanceSponsorship method

RevokeSponsorshipOperationBuilder revokeClaimableBalanceSponsorship(
  1. String balanceId
)

Implementation

RevokeSponsorshipOperationBuilder revokeClaimableBalanceSponsorship(
    String balanceId) {
  if (_ledgerKey != null || _signerKey != null) {
    throw new Exception("can not revoke multiple entries per builder");
  }

  _ledgerKey = XdrLedgerKey(XdrLedgerEntryType.CLAIMABLE_BALANCE);

  XdrClaimableBalanceID bId = XdrClaimableBalanceID(
      XdrClaimableBalanceIDType.CLAIMABLE_BALANCE_ID_TYPE_V0);

  Uint8List bytes = Util.hexToBytes(balanceId.toUpperCase());
  if (bytes.length < 32) {
    bytes = Util.paddedByteArray(bytes, 32);
  } else if (bytes.length > 32) {
    bytes = bytes.sublist(bytes.length - 32, bytes.length);
  }

  bId.v0 = XdrHash(bytes);
  _ledgerKey!.balanceID = bId;
  return this;
}