Skip to main content

Function Signature

Future<YieldXyzActionResponse> enter({
  required String yieldId,
  String? address,
  String? amount,
  String? arguments,
})

Description

Deposit assets into a yield-generating opportunity.

Parameters

ParameterTypeRequiredDescription
yieldIdStringYesThe ID of the yield opportunity to enter
addressString?NoWallet address (defaults to current wallet)
amountString?NoAmount to deposit
argumentsString?NoAdditional protocol-specific arguments as JSON string

Returns

YieldXyzActionResponse - An object containing:
PropertyTypeDescription
idStringAction ID for tracking
intentYieldXyzActionIntentAction intent (enter, exit, manage)
typeStringAction type
yieldIdStringThe yield opportunity ID
addressStringWallet address used
amountString?Deposit amount
amountRawString?Raw deposit amount
amountUsdString?USD equivalent amount
transactionsList<YieldXyzActionTransaction?>List of transactions to be signed and broadcast
executionPatternYieldXyzActionExecutionPatternExecution pattern (synchronous, asynchronous, batched)
createdAtStringCreation timestamp
completedAtString?Completion timestamp
statusYieldXyzActionStatusCurrent status (created, processing, success, failed, canceled, waitingForNext, stale)

Example

import 'package:portal_flutter/portal_flutter.dart';

final portal = Portal();

final response = await portal.yieldIntegrations.yieldxyz.enter(
  yieldId: 'aave-v3-usdc-ethereum',
  amount: '100.0',
);

print('Action ID: ${response.id}');
print('Transactions to sign: ${response.transactions.length}');

Errors

CodeDescription
NOT_INITIALIZEDPortal was not initialized
YIELD_FAILEDFailed to enter yield position