buildUserIntent method
Future<UserIntent>
buildUserIntent({
- required EvmAddr target,
- required BigInt value,
- required Uint8List data,
- BigInt? maxFeePerGas,
- BigInt? maxPriorityFeePerGas,
override
Implementation
@override
Future<UserIntent> buildUserIntent({
required EvmAddr target,
required BigInt value,
required Uint8List data,
BigInt? maxFeePerGas,
BigInt? maxPriorityFeePerGas,
}) async {
final callData = encodeExecute(target, value, data);
BigInt nonce;
Uint8List initCode;
try {
nonce = await getNonce();
initCode = Uint8List(0);
} on UnimplementedError {
nonce = BigInt.zero;
initCode = buildInitCode();
}
bool deployed;
try {
deployed = await isDeployed();
} on UnimplementedError {
deployed = false;
}
return UserIntent(
sender: address,
nonce: nonce,
initCode: deployed ? Uint8List(0) : initCode,
callData: callData,
maxFeePerGas: maxFeePerGas,
maxPriorityFeePerGas: maxPriorityFeePerGas,
);
}