decodePlpCancels function

All RequestCancelled receipts in result.

Implementation

List<PlpCancelReceipt> decodePlpCancels(
    PredictConfig cfg, DecodableTransactionResult result) {
  return _decodeAll(result, cfg.packages.predictV1, 'vault_events',
      'RequestCancelled', vault_events.RequestCancelled, (e) {
    final amount = _big(e['amount'] as Object);
    return PlpCancelReceipt(
      vaultId: normalizeSuiAddress(e['pool_vault_id'] as String),
      accountId: normalizeSuiAddress(e['account_id'] as String),
      recipient: normalizeSuiAddress(e['recipient'] as String),
      index: _big(e['index'] as Object),
      isSupply: e['is_supply'] as bool,
      amount: fromRaw(amount, 6),
      rawAmount: amount,
    );
  });
}