encode<V> static method

V encode<V>(
  1. ChargeDestination instance,
  2. Encoder<V> encoder
)

Implementation

static V encode<V>(
  ChargeDestination instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeString(
    'account',
    instance.account,
  );
  if (instance.amount != null) {
    container.encodeInt(
      'amount',
      instance.amount!,
    );
  }
  return container.value;
}