Skip to main content

Function Signature

Future<YieldXyzTrackTransactionResponse> track(
  String transactionId,
  String txHash,
)

Description

Submit a blockchain transaction hash to update the status of a yield action. Use this after broadcasting a transaction to link the on-chain hash with the yield action.

Parameters

ParameterTypeRequiredDescription
transactionIdStringYesThe yield transaction ID to update
txHashStringYesThe blockchain transaction hash

Returns

YieldXyzTrackTransactionResponse - An object containing:
PropertyTypeDescription
successboolWhether the tracking was successful
transactionIdStringThe tracked transaction ID
statusYieldXyzActionTransactionStatus?Updated transaction status (notFound, created, blocked, waitingForSignature, signed, broadcasted, pending, confirmed, failed, skipped)
transactionYieldXyzActionTransaction?Full transaction details

Example

import 'package:portal_flutter/portal_flutter.dart';

final portal = Portal();

final response = await portal.yieldIntegrations.yieldxyz.track(
  'transaction-id-123',
  '0xabcdef1234567890...',
);

print('Tracked: ${response.success}');
print('Status: ${response.status}');

Errors

CodeDescription
NOT_INITIALIZEDPortal was not initialized
YIELD_FAILEDFailed to track yield transaction